diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7bb4a5be1858..724541138d10 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -662,6 +662,9 @@ # ServiceLabel: %Monitor - Exporter # ServiceOwners: @cijothomas @reyang @rajkumar-rangaraj @TimothyMothra @vishweshbankwar +# PRLabel: %Monitor - LiveMetrics +/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/ @cijothomas @reyang @rajkumar-rangaraj @TimothyMothra @vishweshbankwar @xiang17 + # ServiceLabel: %Monitor - LiveMetrics # ServiceOwners: @cijothomas @reyang @rajkumar-rangaraj @TimothyMothra @vishweshbankwar @xiang17 @@ -674,6 +677,12 @@ # PRLabel: %Mixed Reality /sdk/objectanchors/ @crtreasu @rgarcia @JoshLove-msft +# PRLabel: %Remote Rendering +/sdk/remoterendering/ @FlorianBorn71 @MichaelZp0 @ChristopherManthei + +#ServiceLabel: %Remote Rendering +#ServiceOwners: @FlorianBorn71 @MichaelZp0 @ChristopherManthei + # ServiceLabel: %Mixed Reality # ServiceOwners: @crtreasu @rgarcia @@ -1000,6 +1009,12 @@ # ServiceLabel: %Network - Mobile %Mgmt # ServiceOwners: @ArthurMa1978 +# PRLabel: %Network - Cloud +/sdk/networkcloud/Azure.ResourceManager.*/ @Azure/azure-sdk-write-networkcloud + +# ServiceLabel: %Network - Cloud %Mgmt +# ServiceOwners: @Azure/azure-sdk-write-networkcloud + # PRLabel: %New Relic /sdk/newrelicobservability/Azure.ResourceManager.*/ @dipeshbhakat-microsoft @vipray-ms @@ -1043,6 +1058,12 @@ # ServiceLabel: %Spring App Discovery %Mgmt # ServiceOwners: @sunkun99 +# PRLabel: %Compute - Fleet +/sdk/computefleet/ @sahilarora92 @dhruvil009 + +# ServiceLabel: %Compute - Fleet +# ServiceOwners: @sahilarora92 @dhruvil009 + # ######## Eng Sys ######## /eng/ @hallipr @weshaggard @benbp /eng/common/ @Azure/azure-sdk-eng diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 0284b24acadc..8c17a695edcd 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -267,6 +267,14 @@ "Nvme" ] }, + { + "filename": "**/sdk/computefleet/**/*.cs", + "words": [ + "mbps", + "unattend", + "nvme" + ] + }, { "filename": "**/sdk/confidentialledger/**/*.cs", "words": [ diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml index 12545ab0ec1b..074f72e1f330 100644 --- a/eng/.docsettings.yml +++ b/eng/.docsettings.yml @@ -129,6 +129,7 @@ known_content_issues: - ['sdk/storage/Azure.Storage.Common/README.md','azure-sdk-tools/issues/404'] - ['sdk/textanalytics/Azure.AI.TextAnalytics.Legacy.Shared/README.md','https://github.com/Azure/azure-sdk-tools/issues/404'] - ['sdk/webpubsub/Azure.Messaging.WebPubSub/README.md', 'azure-sdk-tools/issues/404 - requires different name for auth section'] + - ['sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/README.md', 'Opt out of sections: https://github.com/Azure/azure-sdk-tools/issues/404'] - ['sdk/anomalydetector/Azure.AI.AnomalyDetector/README.md', '#25936: Needs Examples'] - ['sdk/personalizer/Azure.AI.Personalizer/README.md','#24535: Needs content'] diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index c6c97a76c82b..6d5506806664 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -98,7 +98,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -227,7 +227,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + @@ -388,7 +388,7 @@ - 1.0.0-dev.20240806.1 + 1.0.0-dev.20240823.1 diff --git a/eng/common/pipelines/templates/steps/save-package-properties.yml b/eng/common/pipelines/templates/steps/save-package-properties.yml new file mode 100644 index 000000000000..1808dc2a00f3 --- /dev/null +++ b/eng/common/pipelines/templates/steps/save-package-properties.yml @@ -0,0 +1,46 @@ +parameters: + - name: ServiceDirectory + type: string + default: "" + - name: DiffDirectory + type: string + default: $(Build.ArtifactStagingDirectory)/diff + - name: PackageInfoDirectory + type: string + default: $(Build.ArtifactStagingDirectory)/PackageInfo + - name: TargetPath + type: string + default: $(Build.SourcesDirectory) + - name: ScriptDirectory + type: string + default: eng/common/scripts + +steps: + - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + - task: Powershell@2 + displayName: Generate PR Diff + inputs: + filePath: ${{ parameters.ScriptDirectory }}/Generate-PR-Diff.ps1 + arguments: > + -TargetPath '${{ parameters.TargetPath }}' + -ArtifactPath '${{ parameters.DiffDirectory }}' + pwsh: true + + - task: Powershell@2 + displayName: Save package properties filtered for PR + inputs: + filePath: ${{ parameters.ScriptDirectory }}/Save-Package-Properties.ps1 + arguments: > + -PrDiff '${{ parameters.DiffDirectory }}/diff.json' + -OutDirectory '${{ parameters.PackageInfoDirectory }}' + pwsh: true + - ${{ else }}: + - task: Powershell@2 + displayName: Save package properties + inputs: + filePath: ${{ parameters.ScriptDirectory }}/Save-Package-Properties.ps1 + arguments: > + -ServiceDirectory '${{parameters.ServiceDirectory}}' + -OutDirectory '${{ parameters.PackageInfoDirectory }}' + -AddDevVersion:$${{ eq(variables['SetDevVersion'],'true') }} + pwsh: true diff --git a/eng/common/scripts/Generate-PR-Diff.ps1 b/eng/common/scripts/Generate-PR-Diff.ps1 index 7a31456b36ca..3b508b1cb994 100644 --- a/eng/common/scripts/Generate-PR-Diff.ps1 +++ b/eng/common/scripts/Generate-PR-Diff.ps1 @@ -13,27 +13,29 @@ The path under which changes will be detected. #> [CmdletBinding()] Param ( - [Parameter(Mandatory=$True)] + [Parameter(Mandatory = $True)] [string] $ArtifactPath, - [Parameter(Mandatory=$True)] + [Parameter(Mandatory = $True)] [string] $TargetPath ) . (Join-Path $PSScriptRoot "Helpers" "git-helpers.ps1") -function Get-ChangedServices { - Param ( - [Parameter(Mandatory=$True)] - [string[]] $ChangedFiles - ) +function Get-ChangedServices +{ + Param ( + [Parameter(Mandatory = $True)] + [string[]] $ChangedFiles + ) - $changedServices = $ChangedFiles | Foreach-Object { if ($_ -match "sdk/([^/]+)") { $matches[1] } } | Sort-Object -Unique + $changedServices = $ChangedFiles | Foreach-Object { if ($_ -match "sdk/([^/]+)") { $matches[1] } } | Sort-Object -Unique - return $changedServices + return $changedServices } -if (!(Test-Path $ArtifactPath)) { - New-Item -ItemType Directory -Path $ArtifactPath | Out-Null +if (!(Test-Path $ArtifactPath)) +{ + New-Item -ItemType Directory -Path $ArtifactPath | Out-Null } $ArtifactPath = Resolve-Path $ArtifactPath @@ -43,9 +45,13 @@ $changedFiles = Get-ChangedFiles -DiffPath $TargetPath $changedServices = Get-ChangedServices -ChangedFiles $changedFiles $result = [PSCustomObject]@{ - "ChangedFiles" = $changedFiles - "ChangedServices" = $changedServices - "PRNumber" = if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER } else { "-1" } + "ChangedFiles" = $changedFiles + "ChangedServices" = $changedServices + "PRNumber" = if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER } else { "-1" } } -$result | ConvertTo-Json | Out-File $ArtifactName +$json = $result | ConvertTo-Json +$json | Out-File $ArtifactName + +Write-Host "`nGenerated diff.json file at $ArtifactName" +Write-Host " $($json -replace "`n", "`n ")" diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index 2250b4f80ba6..6a70070beb56 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -15,7 +15,7 @@ class PackageProps [boolean]$IsNewSdk [string]$ArtifactName [string]$ReleaseStatus - [string[]]$DependentPackages + [string[]]$AdditionalValidationPackages PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory) { @@ -113,7 +113,7 @@ function Get-PrPkgProperties([string]$InputDiffJson) { $diff = Get-Content $InputDiffJson | ConvertFrom-Json $targetedFiles = $diff.ChangedFiles - $dependentPackagesForInclusion = @() + $additionalValidationPackages = @() $lookup = @{} foreach ($pkg in $allPackageProperties) @@ -129,19 +129,26 @@ function Get-PrPkgProperties([string]$InputDiffJson) { if ($shouldInclude) { $packagesWithChanges += $pkg - if ($pkg.DependentPackages) { - $dependentPackagesForInclusion += $pkg.DependentPackages + if ($pkg.AdditionalValidationPackages) { + $additionalValidationPackages += $pkg.AdditionalValidationPackages } } } } - foreach ($addition in $dependentPackagesForInclusion) { - if ($lookup[$addition]) { - $packagesWithChanges += $lookup[$addition] + foreach ($addition in $additionalValidationPackages) { + $key = $addition.Replace($RepoRoot, "").SubString(1) + + if ($lookup[$key]) { + $packagesWithChanges += $lookup[$key] } } + if ($AdditionalValidationPackagesFromPackageSetFn -and (Test-Path "Function:$AdditionalValidationPackagesFromPackageSetFn")) + { + $packagesWithChanges += &$AdditionalValidationPackagesFromPackageSetFn $packagesWithChanges $diff + } + return $packagesWithChanges } diff --git a/eng/common/scripts/Save-Package-Properties.ps1 b/eng/common/scripts/Save-Package-Properties.ps1 index c234d8b28ede..0257e73a1545 100644 --- a/eng/common/scripts/Save-Package-Properties.ps1 +++ b/eng/common/scripts/Save-Package-Properties.ps1 @@ -7,10 +7,10 @@ Saves package properties in source of a given service directory to JSON files. JSON files are named in the form .json or .json if an artifact name property is available in the package properties. -Can optionally add a dev version property which can be used logic for daily +Can optionally add a dev version property which can be used logic for daily builds. -In cases of collisions where track 2 packages (IsNewSdk = true) have the same +In cases of collisions where track 2 packages (IsNewSdk = true) have the same filename as track 1 packages (e.g. same artifact name or package name), the track 2 package properties will be written. @@ -21,22 +21,22 @@ Service directory in which to search for packages. A file path leading to a file generated from Generate-PR-Diff.json. This parameter takes precedence over serviceDirectory, do not provide both. .PARAMETER outDirectory -Output location (generally a package artifact directory in DevOps) for JSON +Output location (generally a package artifact directory in DevOps) for JSON files .PARAMETER addDevVersion -Reads the version out of the source and adds a DevVersion property to the -package properties JSON file. If the package properties JSON file already +Reads the version out of the source and adds a DevVersion property to the +package properties JSON file. If the package properties JSON file already exists, read the Version property from the existing package properties JSON file and set that as the Version property for the new output. This has the effect of -"adding" a DevVersion property to the file which could be different from the +"adding" a DevVersion property to the file which could be different from the Verison property in that file. #> [CmdletBinding()] Param ( [string] $serviceDirectory, - [Parameter(Mandatory=$True)] + [Parameter(Mandatory = $True)] [string] $outDirectory, [string] $prDiff, [switch] $addDevVersion @@ -44,7 +44,8 @@ Param ( . (Join-Path $PSScriptRoot common.ps1) -function SetOutput($outputPath, $incomingPackageSpec) { +function SetOutput($outputPath, $incomingPackageSpec) +{ # If there is an exsiting package info json file read that and set that as output object which gets properties updated here. if (Test-Path $outputPath) @@ -56,7 +57,7 @@ function SetOutput($outputPath, $incomingPackageSpec) { { $outputObject = $incomingPackageSpec } - + if ($addDevVersion) { @@ -75,16 +76,19 @@ function SetOutput($outputPath, $incomingPackageSpec) { -Value (ConvertTo-Json -InputObject $outputObject -Depth 100) } -function GetRelativePath($path) { +function GetRelativePath($path) +{ # If the path is empty return an empty string - if (!$path) { + if (!$path) + { return '' } # If the path is already relative return the path. Calling `GetRelativePath` # on a relative path converts the relative path to an absolute path based on # the current working directory which can result in unexpected outputs. - if (![IO.Path]::IsPathRooted($path)) { + if (![IO.Path]::IsPathRooted($path)) + { return $path } @@ -98,57 +102,76 @@ $exportedPaths = @{} $allPackageProperties = @() -if ($prDiff) { +if ($prDiff) +{ + Write-Host "Getting package properties for PR diff file: $prDiff" $allPackageProperties = Get-PrPkgProperties $prDiff + + if (!$allPackageProperties) + { + Write-Host "No packages found matching PR diff file $prDiff" + Write-Host "Setting NoPackagesChanged variable to true" + Write-Host "##vso[task.setvariable variable=NoPackagesChanged]true" + exit 0 + } } -else { +else +{ + Write-Host "Getting package properties for service directory: $serviceDirectory" $allPackageProperties = Get-AllPkgProperties $serviceDirectory + + if (!$allPackageProperties) + { + Write-Error "Package properties are not available for service directory $serviceDirectory" + exit 1 + } } -if ($allPackageProperties) +if (-not (Test-Path -Path $outDirectory)) { - if (-not (Test-Path -Path $outDirectory)) + New-Item -ItemType Directory -Force -Path $outDirectory | Out-Null +} + +foreach ($pkg in $allPackageProperties) +{ + if ($pkg.Name) + { + Write-Host "" + Write-Host "Package Name: $($pkg.Name)" + Write-Host "Package Version: $($pkg.Version)" + Write-Host "Package SDK Type: $($pkg.SdkType)" + Write-Host "Artifact Name: $($pkg.ArtifactName)" + Write-Host "Release date: $($pkg.ReleaseStatus)" + $configFilePrefix = $pkg.Name + + if ($pkg.ArtifactName) { - New-Item -ItemType Directory -Force -Path $outDirectory + $configFilePrefix = $pkg.ArtifactName } - foreach($pkg in $allPackageProperties) + + $outputPath = Join-Path -Path $outDirectory "$configFilePrefix.json" + Write-Host "Output path of json file: $outputPath" + + $outDir = Split-Path $outputPath -parent + if (-not (Test-Path -path $outDir)) { - if ($pkg.Name) { - Write-Host "Package Name: $($pkg.Name)" - Write-Host "Package Version: $($pkg.Version)" - Write-Host "Package SDK Type: $($pkg.SdkType)" - Write-Host "Artifact Name: $($pkg.ArtifactName)" - Write-Host "Release date: $($pkg.ReleaseStatus)" - $configFilePrefix = $pkg.Name - if ($pkg.ArtifactName) - { - $configFilePrefix = $pkg.ArtifactName - } - $outputPath = Join-Path -Path $outDirectory "$configFilePrefix.json" - Write-Host "Output path of json file: $outputPath" - $outDir = Split-Path $outputPath -parent - if (-not (Test-Path -path $outDir)) - { - Write-Host "Creating directory $($outDir) for json property file" - New-Item -ItemType Directory -Path $outDir - } - - # If package properties for a track 2 (IsNewSdk = true) package has - # already been written, skip writing to that same path. - if ($exportedPaths.ContainsKey($outputPath) -and $exportedPaths[$outputPath].IsNewSdk -eq $true) { - Write-Host "Track 2 package info with file name $($outputPath) already exported. Skipping export." - continue - } - $exportedPaths[$outputPath] = $pkg - - SetOutput $outputPath $pkg - } + Write-Host "Creating directory $($outDir) for json property file" + New-Item -ItemType Directory -Path $outDir | Out-Null } - Get-ChildItem -Path $outDirectory -} -else -{ - Write-Error "Package properties are not available for service directory $serviceDirectory or $prdiff" - exit 1 + # If package properties for a track 2 (IsNewSdk = true) package has + # already been written, skip writing to that same path. + if ($exportedPaths.ContainsKey($outputPath) -and $exportedPaths[$outputPath].IsNewSdk -eq $true) + { + Write-Host "Track 2 package info with file name $($outputPath) already exported. Skipping export." + continue + } + + $exportedPaths[$outputPath] = $pkg + SetOutput $outputPath $pkg + } } + +$fileNames = (Get-ChildItem -Path $outDirectory).Name +Write-Host "`nFiles written to $outDirectory`:" +Write-Host " $($fileNames -join "`n ")" diff --git a/eng/common/scripts/Test-SampleMetadata.ps1 b/eng/common/scripts/Test-SampleMetadata.ps1 index 8499b70a4926..c091ca51def0 100644 --- a/eng/common/scripts/Test-SampleMetadata.ps1 +++ b/eng/common/scripts/Test-SampleMetadata.ps1 @@ -422,6 +422,8 @@ begin { "office-word", "office-yammer", "passport-azure-ad", + "playwright", + "playwright-testing", "power-apps", "power-automate", "power-bi", diff --git a/eng/common/scripts/common.ps1 b/eng/common/scripts/common.ps1 index 0025d1c6fe66..831b4719f88a 100644 --- a/eng/common/scripts/common.ps1 +++ b/eng/common/scripts/common.ps1 @@ -62,7 +62,8 @@ $GetEmitterAdditionalOptionsFn = "Get-${Language}-EmitterAdditionalOptions" $GetEmitterNameFn = "Get-${Language}-EmitterName" $GetDirectoriesForGenerationFn = "Get-${Language}-DirectoriesForGeneration" $UpdateGeneratedSdksFn = "Update-${Language}-GeneratedSdks" -$IsApiviewStatusCheckRequiredFn = "Get-${Language}-ApiviewStatusCheckRequirement" +$IsApiviewStatusCheckRequiredFn = "Get-${Language}-ApiviewStatusCheckRequirement" +$AdditionalValidationPackagesFromPackageSetFn = "Get-${Language}-AdditionalValidationPackagesFromPackageSet" # Expected to be set in eng/scripts/docs/Docs-Onboarding.ps1 $SetDocsPackageOnboarding = "Set-${Language}-DocsPackageOnboarding" diff --git a/eng/common/testproxy/target_version.txt b/eng/common/testproxy/target_version.txt index 26b6c79cf6f3..cefa0fb9592d 100644 --- a/eng/common/testproxy/target_version.txt +++ b/eng/common/testproxy/target_version.txt @@ -1 +1 @@ -1.0.0-dev.20240806.1 +1.0.0-dev.20240823.1 diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 02f43e4a6f25..15a305817b06 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240818.1" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240828.1" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", @@ -22,9 +22,9 @@ } }, "node_modules/@autorest/csharp": { - "version": "3.0.0-beta.20240818.1", - "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240818.1.tgz", - "integrity": "sha512-Mne78KvgVuPFP8LPB+jnVeFQ2Q6yfBZUpRD9Mbac9vCiP/jxcF0GHLaj3if+WRyB/meZOnn2CECD8v/CWnsWvw==" + "version": "3.0.0-beta.20240828.1", + "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20240828.1.tgz", + "integrity": "sha512-EEmlBBH9IC1PFmW2yoXPEagvTsrhodQifhF/Grdz+SigDj4L4fCM0ucdspAZf+Zxom3rJPYZMIP49uhbquvjFA==" }, "node_modules/@azure-tools/typespec-autorest": { "version": "0.45.0", @@ -117,12 +117,12 @@ } }, "node_modules/@azure-tools/typespec-csharp": { - "version": "0.2.0-beta.20240818.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240818.1.tgz", - "integrity": "sha512-gqDVxYwq944B0waiQDI9OEV+hmsLFlfXdjPggKRb6tZXgDrVHw8PgraXFmZUtnk7djXbvazECNQ/tI2yuUz8DQ==", + "version": "0.2.0-beta.20240828.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20240828.1.tgz", + "integrity": "sha512-Op9eMX0RbXmXCkqHpfKEOc8RbGNVbLkqiCWMKTEdK3T9gF7rraSsZ4cgJz7ubVEtjeaYllLH9XzS1qHhgN7ARw==", "dependencies": { - "@autorest/csharp": "3.0.0-beta.20240818.1", - "@typespec/http-client-csharp": "0.1.9-alpha.20240815.3", + "@autorest/csharp": "3.0.0-beta.20240828.1", + "@typespec/http-client-csharp": "0.1.9-alpha.20240826.1", "json-serialize-refs": "0.1.0-0" }, "peerDependencies": { @@ -265,9 +265,9 @@ } }, "node_modules/@typespec/http-client-csharp": { - "version": "0.1.9-alpha.20240815.3", - "resolved": "https://registry.npmjs.org/@typespec/http-client-csharp/-/http-client-csharp-0.1.9-alpha.20240815.3.tgz", - "integrity": "sha512-YD+sl67JvENY+oGk/2Pqz1yMkklq62WW3bvRQwwCvckt3Cc6a+GEmovbF+VkgRbizxU48nmSbR61tZ5oJ56gUA==", + "version": "0.1.9-alpha.20240826.1", + "resolved": "https://registry.npmjs.org/@typespec/http-client-csharp/-/http-client-csharp-0.1.9-alpha.20240826.1.tgz", + "integrity": "sha512-i3XM4DXan5WKl/SNAFgyYEAyHXt51diQrMyR7TvCOCte6MJgYM1ilH66pV8AlhDCLscGXzIprurwX6hd7qmSUA==", "dependencies": { "json-serialize-refs": "0.1.0-0" }, @@ -636,9 +636,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { "braces": "^3.0.3", diff --git a/eng/emitter-package.json b/eng/emitter-package.json index a637f39a45e3..79e858bd3623 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,7 +1,7 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20240818.1" + "@azure-tools/typespec-csharp": "0.2.0-beta.20240828.1" }, "devDependencies": { "@azure-tools/typespec-autorest": "0.45.0", diff --git a/eng/pipelines/templates/stages/1es-redirect.yml b/eng/pipelines/templates/stages/1es-redirect.yml index 09ca2440ebcd..a9025c74954b 100644 --- a/eng/pipelines/templates/stages/1es-redirect.yml +++ b/eng/pipelines/templates/stages/1es-redirect.yml @@ -11,7 +11,7 @@ resources: - repository: azure-sdk-build-tools type: git name: internal/azure-sdk-build-tools - ref: refs/tags/azure-sdk-build-tools_20240711.1 + ref: refs/tags/azure-sdk-build-tools_20240826.1 parameters: - name: stages @@ -60,6 +60,8 @@ extends: # See https://dev.azure.com/securitytools/SecurityIntegration/_wiki/wikis/Guardian/1378/Glob-Format # Exclude Microsoft.Azure.KeyVault.Core.dll track 1 dependency that we no longer support but is causing issues analyzeTargetGlob: +:file|**/*.dll;+:file|**/*.exe;-:f|**/net452/Microsoft.Azure.KeyVault.Core.dll;-:f|**/net461/Microsoft.Azure.KeyVault.Core.dll;-:f|**/tools/NuGet.exe;-:f|**/tools/gpg/**/*.dll;-:f|**/tools/gpg/**/*.exe;-:f|**/tools/azcopy/**/*.exe;-:f|**/tools/azcopy/**/*.dll;-:f|**/aotcompatibility/**/*.exe + # Turn off the build warnings caused by disabling some sdl checks + createAdoIssuesForJustificationsForDisablement: false eslint: enabled: false justificationForDisabling: 'ESLint injected task has failures because it uses an old version of mkdirp. We should not fail for tools not controlled by the repo. See: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3499746' diff --git a/eng/service.proj b/eng/service.proj index bc473731f3f1..7fcd0b393c0e 100644 --- a/eng/service.proj +++ b/eng/service.proj @@ -15,8 +15,6 @@ - - diff --git a/eng/templates/Azure.ResourceManager.Template/.template.config/template.json b/eng/templates/Azure.ResourceManager.Template/.template.config/template.json index 94d5c03086da..2463ab5b258a 100644 --- a/eng/templates/Azure.ResourceManager.Template/.template.config/template.json +++ b/eng/templates/Azure.ResourceManager.Template/.template.config/template.json @@ -46,13 +46,37 @@ "description": "The Azure provider name. ie. Microsoft.Network or Microsoft.Compute", "replaces": "ProviderFullName" }, - "tagVersion": { + "TypeSpecDirectory": { "type": "parameter", "datatype":"text", "isRequired": false, - "description": "The optional parameter specifies the tag in the README.MD. If empty, the default tag in the README.MD is used.", + "description": "TypeSpecDirectory under sdk/providername.", + "defaultValue": "TypeSpecDirectory", + "replaces": "TypeSpecDirectory" + }, + "CommitId": { + "type": "parameter", + "datatype":"text", + "isRequired": false, + "description": "the commit id of Azure spec repo.", + "defaultValue": "CommitId", + "replaces": "CommitId" + }, + "ChangeLogH2Title": { + "type": "parameter", + "datatype":"text", + "isRequired": false, + "description": "the H2 title of Changelog", + "defaultValue": "1.0.0-beta.1 (Unreleased)", + "replaces": "ChangeLogH2Title" + }, + "ChangeLogSdkDescription": { + "type": "parameter", + "datatype":"text", + "isRequired": false, + "description": "Sdk description", "defaultValue": "", - "replaces": "SwaggerVersionTag" + "replaces": "ChangeLogSdkDescription" }, "includeCI": { "type": "parameter", @@ -61,12 +85,12 @@ "description": "The optional parameter specifies whether generate related pipline ci.yml and test-resources.json in parent folder.", "defaultValue": "false" }, - "ProviderShortNameLowercase": { + "LowercaseProviderShortName": { "type": "derived", "datatype": "text", "valueSource": "provider", "valueTransform": "ProviderShortNameLowerForm", - "replaces": "ProviderNameLowercase" + "replaces": "LowercaseProviderShortName" }, "ProviderShortName": { "type": "derived", @@ -88,25 +112,6 @@ { "regex": "\\.", "replacement": "" } ] } - }, - "tagPrefix": { - "type": "generated", - "generator": "switch", - "replaces": "tagPrefix", - "parameters": { - "evaluator": "MSBUILD", - "datatype": "string", - "cases": [ - { - "condition": "('tagVersion' == '')", - "value": "" - }, - { - "condition": "('tagVersion' != '')", - "value": "tag:" - } - ] - } } }, "forms": { diff --git a/eng/templates/Azure.ResourceManager.Template/CHANGELOG.md b/eng/templates/Azure.ResourceManager.Template/CHANGELOG.md index 6a9f3bac33c1..9410023df867 100644 --- a/eng/templates/Azure.ResourceManager.Template/CHANGELOG.md +++ b/eng/templates/Azure.ResourceManager.Template/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## ChangeLogH2Title + +ChangeLogSdkDescription ### Features Added diff --git a/eng/templates/Azure.ResourceManager.Template/assets.json b/eng/templates/Azure.ResourceManager.Template/assets.json index 8fe6b015af19..44e528c06061 100644 --- a/eng/templates/Azure.ResourceManager.Template/assets.json +++ b/eng/templates/Azure.ResourceManager.Template/assets.json @@ -1,6 +1,6 @@ { "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", - "TagPrefix": "net//Azure.ResourceManager.Template", + "TagPrefix": "net/LowercaseProviderShortName/Azure.ResourceManager.Template", "Tag": "" } diff --git a/eng/templates/Azure.ResourceManager.Template/src/autorest.md b/eng/templates/Azure.ResourceManager.Template/src/autorest.md deleted file mode 100644 index cbbc44c8aad4..000000000000 --- a/eng/templates/Azure.ResourceManager.Template/src/autorest.md +++ /dev/null @@ -1,56 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -``` yaml -azure-arm: true -csharp: true -library-name: ProviderShortName -namespace: Azure.ResourceManager.ProviderShortName -require: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/ProviderNameLowercase/resource-manager/readme.md -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../samples/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true - -#mgmt-debug: -# show-serialized-names: true - -tagPrefix SwaggerVersionTag - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - -``` \ No newline at end of file diff --git a/eng/templates/Azure.ResourceManager.Template/tsp-location.yaml b/eng/templates/Azure.ResourceManager.Template/tsp-location.yaml new file mode 100644 index 000000000000..cd8ab8802f68 --- /dev/null +++ b/eng/templates/Azure.ResourceManager.Template/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification/LowercaseProviderShortName/TypeSpecDirectory +commit: CommitId +repo: Azure/azure-rest-api-specs \ No newline at end of file diff --git a/eng/templates/README.md b/eng/templates/README.md index 35e0508087b9..94efe37d8fd9 100644 --- a/eng/templates/README.md +++ b/eng/templates/README.md @@ -42,7 +42,7 @@ Following parameter is available ### Next Step -1. Inspect `src\autorest.md` to ensure the REST Api path is valid +1. Inspect `tsp-location.yaml` to ensure the REST Api path is valid 2. Run `dotnet build` to ensure empty project builds successfully. 3. Run `dotnet build /t:GenerateCode` to generate C# code and ensure no fatal errors. 4. Run `dotnet build` to ensure now generated project builds successfully. diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample10_SecretReference.md b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample10_SecretReference.md index c159b3a0cf58..7d3882f978dc 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample10_SecretReference.md +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/samples/Sample10_SecretReference.md @@ -6,7 +6,7 @@ When App Configuration creates such keys, it stores the URIs of Key Vault values Your application is responsible for authenticating properly to both App Configuration and Key Vault and resolving values. The two services don't communicate directly. -You can use the [configuration provider](https://github.com/Azure/AppConfiguration-DotnetProvider) to do resolve Secret references automatically; +You can use the [configuration provider](https://github.com/Azure/AppConfiguration-DotnetProvider) to resolve Secret references automatically. Secret references are settings that follow specific JSON schema for the `Value`, and the `application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8` content type. The `Azure.Data.AppConfiguration` library provides a strongly-typed way of managing Secret references. diff --git a/sdk/attestation/Azure.Security.Attestation/src/AttestationToken.cs b/sdk/attestation/Azure.Security.Attestation/src/AttestationToken.cs index 7ad749047d52..f972e740f6a9 100644 --- a/sdk/attestation/Azure.Security.Attestation/src/AttestationToken.cs +++ b/sdk/attestation/Azure.Security.Attestation/src/AttestationToken.cs @@ -13,6 +13,7 @@ using System.Linq; using System.ComponentModel; using Azure.Core.Pipeline; +using System.Text.Json.Serialization; namespace Azure.Security.Attestation { @@ -658,7 +659,7 @@ private static string GenerateSecuredJsonWebToken(BinaryData body, AttestationTo }; var serializationOptions = new JsonSerializerOptions { - IgnoreNullValues = true, + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }; byte[] jwtHeader = JsonSerializer.SerializeToUtf8Bytes(header, serializationOptions); string encodedHeader = Base64Url.Encode(jwtHeader); diff --git a/sdk/batch/ci.data.yml b/sdk/batch/ci.data.yml index 881610e1be24..195b0056a758 100644 --- a/sdk/batch/ci.data.yml +++ b/sdk/batch/ci.data.yml @@ -11,8 +11,6 @@ trigger: - sdk/batch/ci.data.yml - sdk/batch/service.projects - sdk/batch/Microsoft.Azure.Batch - - sdk/batch/MicrosoftAzureBatchFileStaging - - sdk/batch/Microsoft.Azure.Batch.Conventions.Files exclude: - sdk/batch/Azure.ResourceManager.Batch/ @@ -28,8 +26,6 @@ pr: - sdk/batch/ci.data.yml - sdk/batch/service.projects - sdk/batch/Microsoft.Azure.Batch - - sdk/batch/MicrosoftAzureBatchFileStaging - - sdk/batch/Microsoft.Azure.Batch.Conventions.Files exclude: - sdk/batch/Azure.ResourceManager.Batch/ @@ -42,8 +38,4 @@ extends: BuildSnippets: false Artifacts: - name: Microsoft.Azure.Batch - safeName: MicrosoftAzureBatch - - name: Microsoft.Azure.Batch.FileStaging - safeName: MicrosoftAzureBatchFileStaging - - name: Microsoft.Azure.Batch.Conventions.Files - safeName: MicrosoftAzureBatchConventionsFiles + safeName: MicrosoftAzureBatch \ No newline at end of file diff --git a/sdk/batch/service.projects b/sdk/batch/service.projects index 4dab13fedd21..519aced9b150 100644 --- a/sdk/batch/service.projects +++ b/sdk/batch/service.projects @@ -20,7 +20,7 @@ - + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md index 803aca9a0355..354e9a8b5a16 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md @@ -8,7 +8,7 @@ Conversation Language Understanding - aka CLU for short - is a cloud-based conve Conversation Summarization is one feature offered by Azure AI Language, which is a combination of generative Large Language models and task-optimized encoder models that offer summarization solutions with higher quality, cost efficiency, and lower latency. -Conversation PII detection another feature offered by Azure AI Language, which is a collection of machine learning and AI algorithms to identify, categorize, and redact sensitive information in text. The Conversational PII model is a specialized model for handling speech transcriptions and the more informal, conversational tone of meeting and call transcripts. +Conversation PII detection another feature offered by Azure AI Language, which is a collection of machine learning and AI algorithms to identify, categorize, and redact sensitive information in text. The Conversational PII model is a specialized model for handling speech transcriptions and the more informal, conversational tone of meeting and call transcripts. [Source code][conversationanalysis_client_src] | [Package (NuGet)][conversationanalysis_nuget_package] | [API reference documentation][conversationanalysis_refdocs] | [Samples][conversationanalysis_samples] | [Product documentation][conversationanalysis_docs] | [Analysis REST API documentation][conversationanalysis_restdocs] @@ -94,6 +94,35 @@ ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, cre Note that regional endpoints do not support AAD authentication. Instead, create a [custom domain][custom_domain] name for your resource to use AAD authentication. +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +|SDK version |Supported API version of service +|-------------|----------------------------------------------------- +|2.0.0-beta.1 | 2022-05-01, 2023-04-01, 2024-05-01, 2024-05-15-preview (default) +|1.1.0 | 2022-05-01, 2023-04-01 (default) +|1.0.0 | 2022-05-01 (default) + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateConversationAnalysisClientForSpecificApiVersion +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); +ConversationsClientOptions options = new ConversationsClientOptions(ConversationsClientOptions.ServiceVersion.V2024_05_01); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +If you do not select an api version we will default to the latest version available, which has the possibility of being a preview version. + ## Key concepts ### ConversationAnalysisClient diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/README.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/README.md index d2c48cd68225..98f303c8c81a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/README.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/README.md @@ -20,5 +20,5 @@ You can work with request and response content more easily by using our [Dynamic - [Analyze an utterance - Orchestration project](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample2_AnalyzeConversation_OrchestrationPrediction.md) - [Analyze an utterance in a different language](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample3_AnalyzeConversationWithLanguage.md) - [Analyze an utterance using extra options](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample4_AnalyzeConversationWithOptions.md) -- [Analyze a conversation with Conversation PII](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_AnalyzeConversation_ConversationPii.md) +- [Analyze a conversation with Conversation PII](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample8_AnalyzeConversation_ConversationPii.md) - [Analyze a conversation with Conversation Summarization](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample6_AnalyzeConversation_ConversationSummarization.md) diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md index f7f054ba8eb0..360527108ea0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample1_AnalyzeConversation_ConversationPrediction.md @@ -14,11 +14,11 @@ using Azure.AI.Language.Conversations; To analyze an utterance, you need to first create a `ConversationAnalysisClient` using an endpoint and API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. -```C# Snippet:ConversationAnalysisClient_Create +```C# Snippet:CreateConversationAnalysisClientForSpecificApiVersion Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); - -ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +ConversationsClientOptions options = new ConversationsClientOptions(ConversationsClientOptions.ServiceVersion.V2024_05_01); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential, options); ``` Once you have created a client, you can call synchronous or asynchronous methods. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md new file mode 100644 index 000000000000..488202b17078 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_ImportProject.md @@ -0,0 +1,165 @@ +# Import a project + +This sample demonstrates how to import a project. To get started, you'll need to create a Cognitive Language service endpoint and an API key. See the [README](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.Language.Conversations_1.1.0/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md) for links and instructions. + +> [!NOTE] +> Conversational Authoring is not supported in version 2.0.0-beta.1. If you use Conversational Authoring, please continue to use version 1.1.0. + +Start by importing the namespace for the `ConversationAuthoringClient` and related classes: + +```C# +using Azure.Core; +using Azure.AI.Language.Conversations.Authoring; +``` + +To import a project, you'll need to first create a `ConversationAuthoringClient` using an endpoint and an API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. + +```C# +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); + +ConversationAuthoringClient client = new ConversationAuthoringClient(endpoint, credential); +``` + +Once you have created a client, you can call synchronous or asynchronous methods. Typically, the content would come from a file but a small sample is shown here for demonstration purposes. + +## Synchronous + +```C# +string projectName = "Menu"; + +// Define our project assets and import. In practice this would most often be read from a file. +var importData = new +{ + projectFileVersion = "2022-05-01", + metadata = new { + projectName, + projectKind = "Conversation", + multilingual = true, + language = "en", + }, + + assets = new + { + projectKind = "Conversation", + entities = new[] // ConversationalAnalysisAuthoringConversationExportedEntity + { + new + { + category = "Contact", + compositionSetting = "combineComponents", + prebuilts = new[] + { + new + { + category = "Person.Name", + }, + }, + + // ... more entities. + } + }, + + intents = new[] // ConversationalAnalysisAuthoringConversationExportedIntent + { + new + { + category = "Send", + }, + + // ... more intents. + }, + + utterances = new[] // ConversationalAnalysisAuthoringConversationExportedUtterance + { + new + { + text = "Send an email to Johnson", + language = "en", + intent = "Send", + entities = new[] + { + new + { + category = "Contact", + offset = 17, + length = 7, + }, + }, + }, + new + { + text = "Send Kathy a calendar invite", + language = "en", + intent = "Send", + entities = new[] + { + new + { + category = "Contact", + offset = 5, + length = 5, + }, + }, + }, + + // ... more utterances. + }, + }, + + // Use Utf16CodeUnit for strings in .NET. + stringIndexType = "Utf16CodeUnit", +}; + +Operation importOperation = client.ImportProject(WaitUntil.Completed, projectName, RequestContent.Create(importData)); + +// Train the model. +var trainData = new +{ + modelLabel = "Sample5", + trainingMode = "standard", +}; + +Console.WriteLine($"Training project {projectName}..."); +Operation trainOperation = client.Train(WaitUntil.Completed, projectName, RequestContent.Create(trainData)); + + // Deploy the model. + var deployData = new + { + trainedModelLabel = "Sample5", + }; + +Console.WriteLine($"Deploying project {projectName} to production..."); +Operation deployOperation = client.DeployProject(WaitUntil.Completed, projectName, "production", RequestContent.Create(deployData)); + +Console.WriteLine("Import complete"); +``` + +## Asynchronous + +Using the same `importData` definition above, you can make an asynchronous request by calling `ImportProjectAsync`: + +```C# +Operation importOperation = await client.ImportProjectAsync(WaitUntil.Completed, projectName, RequestContent.Create(importData)); + +// Train the model. +var trainData = new +{ + modelLabel = "Sample5", + trainingMode = "standard", +}; + +Console.WriteLine($"Training project {projectName}..."); +Operation trainOperation = await client.TrainAsync(WaitUntil.Completed, projectName, RequestContent.Create(trainData)); + +// Deploy the model. +var deployData = new +{ + trainedModelLabel = "Sample5", +}; + +Console.WriteLine($"Deploying project {projectName} to production..."); +Operation deployOperation = await client.DeployProjectAsync(WaitUntil.Completed, projectName, "production", RequestContent.Create(deployData)); + +Console.WriteLine("Import complete"); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample6_AnalyzeConversation_ConversationSummarization.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample6_AnalyzeConversation_ConversationSummarization.md index 1988f7fa15f7..653147aefb0f 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample6_AnalyzeConversation_ConversationSummarization.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample6_AnalyzeConversation_ConversationSummarization.md @@ -14,11 +14,11 @@ using Azure.AI.Language.Conversations; To analyze an utterance, you need to first create a `ConversationAnalysisClient` using an endpoint and API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. -```C# Snippet:ConversationAnalysisClient_Create +```C# Snippet:CreateConversationAnalysisClientForSpecificApiVersion Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); - -ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential); +ConversationsClientOptions options = new ConversationsClientOptions(ConversationsClientOptions.ServiceVersion.V2024_05_01); +ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential, options); ``` Once you have created a client, you can call synchronous or asynchronous methods. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample7_ExportProject.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample7_ExportProject.md new file mode 100644 index 000000000000..1385cc563016 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample7_ExportProject.md @@ -0,0 +1,76 @@ +# Export a project + +This sample demonstrates how to export a project. To get started, you'll need to create a Cognitive Language service endpoint and an API key. See the [README](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.Language.Conversations_1.1.0/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md) for links and instructions. + +> [!NOTE] +> Conversational Authoring is not supported in version 2.0.0-beta.1. If you use Conversational Authoring, please continue to use version 1.1.0. + +Start by importing the namespace for the `ConversationAuthoringClient` and related classes: + +```C# +using Azure.Core; +using Azure.AI.Language.Conversations.Authoring; +``` + +To export a project, you'll need to first create a `ConversationAuthoringClient` using an endpoint and an API key. These can be stored in an environment variable, configuration setting, or any way that works for your application. + +```C# +Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); +AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); + +ConversationAuthoringClient client = new ConversationAuthoringClient(endpoint, credential); +``` + +Once you have created a client, you can call synchronous or asynchronous methods. Typically, the content would come from a file but a small sample is shown here for demonstration purposes. + +## Synchronous + +Exporting a project returns an operation. Once this operation completes, you can get the `resultUrl` out of the response body and pass through the HTTP pipeline exposed by the client to download the project. + +```C# +string projectName = "project-to-export"; +Operation exportOperation = client.ExportProject(WaitUntil.Completed, projectName); + +// Get the resultUrl from the response, which contains the exported project. +using JsonDocument doc = JsonDocument.Parse(exportOperation.Value.ToStream()); +string resultUrl = doc.RootElement.GetProperty("resultUrl").GetString(); + +// Use the client pipeline to create and send a request to download the raw URL. +RequestUriBuilder builder = new RequestUriBuilder(); +builder.Reset(new Uri(resultUrl)); + +Request request = client.Pipeline.CreateRequest(); +request.Method = RequestMethod.Get; +request.Uri = builder; + +// Save the project to a file in the current working directory. +Response response = client.Pipeline.SendRequest(request, cancellationToken: default); + +string path = "project.json"; +response.ContentStream.CopyTo(File.Create(path)); +``` + +## Asynchronous + +```C# +string projectName = "project-to-export"; +Operation exportOperation = await client.ExportProjectAsync(WaitUntil.Completed, projectName); + +// Get the resultUrl from the response, which contains the exported project. +using JsonDocument doc = JsonDocument.Parse(exportOperation.Value.ToStream()); +string resultUrl = doc.RootElement.GetProperty("resultUrl").GetString(); + +// Use the client pipeline to create and send a request to download the raw URL. +RequestUriBuilder builder = new RequestUriBuilder(); +builder.Reset(new Uri(resultUrl)); + +Request request = client.Pipeline.CreateRequest(); +request.Method = RequestMethod.Get; +request.Uri = builder; + +// Save the project to a file in the current working directory. +Response response = await client.Pipeline.SendRequestAsync(request, cancellationToken: default); + +string path = "project.json"; +await response.ContentStream.CopyToAsync(File.Create(path)); +``` diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_AnalyzeConversation_ConversationPii.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample8_AnalyzeConversation_ConversationPii.md similarity index 98% rename from sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_AnalyzeConversation_ConversationPii.md rename to sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample8_AnalyzeConversation_ConversationPii.md index c01baa621f33..666773152f58 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample5_AnalyzeConversation_ConversationPii.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/samples/Sample8_AnalyzeConversation_ConversationPii.md @@ -1,4 +1,4 @@ -# Analyze a conversation with Conversation Summarization +# Analyze a conversation with Conversation PII This sample demonstrates how to detect and redact personally identifiable information from a conversation with Conversation Pii. To get started, you'll need to create a Cognitive Language service endpoint and an API key. See the [README](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/cognitivelanguage/Azure.AI.Language.Conversations/README.md) for links and instructions. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs index 90ea66beed09..b99bc4763d79 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/tests/Samples/Readme.cs @@ -28,6 +28,16 @@ public void CreateConversationClient() #endregion } + public void CreateConversationClientWithSpecificApiVersion() + { + #region Snippet:CreateConversationAnalysisClientForSpecificApiVersion + Uri endpoint = new Uri("https://myaccount.cognitiveservices.azure.com"); + AzureKeyCredential credential = new AzureKeyCredential("{api-key}"); + ConversationsClientOptions options = new ConversationsClientOptions(ConversationsClientOptions.ServiceVersion.V2024_05_01); + ConversationAnalysisClient client = new ConversationAnalysisClient(endpoint, credential, options); + #endregion + } + public void CreateConversationClientWithDefaultAzureCredential() { #region Snippet:ConversationAnalysisClient_CreateWithDefaultAzureCredential diff --git a/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md b/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md index 5cc92772446a..8ed448e95d6d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md +++ b/sdk/compute/Azure.ResourceManager.Compute/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.6.0-beta.1 (Unreleased) +## 1.7.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,20 @@ ### Other Changes +## 1.6.0 (2024-08-26) + +### Features Added + +- Added a new read-only property `LogicalSectorSize` to `DiskRestorePointData` class. +- Added new properties `SkuProfile` and `ZonalPlatformFaultDomainAlignMode` to `VirtualMachineScaleSetData` class. +- Added new properties `Zones`, `ZonalPlatformFaultDomainAlignMode`, and `SkuProfile` to `VirtualMachineScaleSetPatch` class. +- Added a new property `ScheduledEventsPolicy` to `AvailabilitySetPatch` and `AvailabilitySetData` class. + +### Breaking Changes + +- `ExcludeExtensions` property in `ComputeSecurityPostureReference` is replaced by `ExcludeExtensionNames` property which takes in a list of strings. +- `IsVmAgentPlatformUpdatesEnabled` property in `WindowsConfiguration` class is now read-only. + ## 1.5.0 (2024-05-10) ### Features Added diff --git a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs index 44e614e1003d..903d9f114b7b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/api/Azure.ResourceManager.Compute.netstandard2.0.cs @@ -23,6 +23,7 @@ public AvailabilitySetData(Azure.Core.AzureLocation location) { } public int? PlatformFaultDomainCount { get { throw null; } set { } } public int? PlatformUpdateDomainCount { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ProximityPlacementGroupId { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy ScheduledEventsPolicy { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.ComputeSku Sku { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList Statuses { get { throw null; } } public System.Collections.Generic.IList VirtualMachines { get { throw null; } } @@ -1189,6 +1190,7 @@ internal DiskRestorePointData() { } public Azure.ResourceManager.Compute.Models.DiskEncryption Encryption { get { throw null; } } public string FamilyId { get { throw null; } } public Azure.ResourceManager.Compute.Models.HyperVGeneration? HyperVGeneration { get { throw null; } } + public int? LogicalSectorSize { get { throw null; } } public Azure.ResourceManager.Compute.Models.NetworkAccessPolicy? NetworkAccessPolicy { get { throw null; } } public Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType? OSType { get { throw null; } } public Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess? PublicNetworkAccess { get { throw null; } } @@ -2459,11 +2461,13 @@ public VirtualMachineScaleSetData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy ScheduledEventsPolicy { get { throw null; } set { } } public bool? SinglePlacementGroup { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.ComputeSku Sku { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ComputeSkuProfile SkuProfile { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.SpotRestorePolicy SpotRestorePolicy { get { throw null; } set { } } public System.DateTimeOffset? TimeCreated { get { throw null; } } public string UniqueId { get { throw null; } } public Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy UpgradePolicy { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile VirtualMachineProfile { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode? ZonalPlatformFaultDomainAlignMode { get { throw null; } set { } } public bool? ZoneBalance { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } Azure.ResourceManager.Compute.VirtualMachineScaleSetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3180,8 +3184,12 @@ public AdditionalUnattendContent() { } public static partial class ArmComputeModelFactory { public static Azure.ResourceManager.Compute.Models.AccessUri AccessUri(string accessSas = null, string securityDataAccessSas = null) { throw null; } - public static Azure.ResourceManager.Compute.AvailabilitySetData AvailabilitySetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Compute.Models.ComputeSku sku = null, int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IEnumerable virtualMachines = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, System.Collections.Generic.IEnumerable statuses = null) { throw null; } - public static Azure.ResourceManager.Compute.Models.AvailabilitySetPatch AvailabilitySetPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Compute.Models.ComputeSku sku = null, int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IEnumerable virtualMachines = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, System.Collections.Generic.IEnumerable statuses = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Compute.AvailabilitySetData AvailabilitySetData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Compute.Models.ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, System.Collections.Generic.IEnumerable virtualMachines, Azure.Core.ResourceIdentifier proximityPlacementGroupId, System.Collections.Generic.IEnumerable statuses) { throw null; } + public static Azure.ResourceManager.Compute.AvailabilitySetData AvailabilitySetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Compute.Models.ComputeSku sku = null, int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IEnumerable virtualMachines = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, System.Collections.Generic.IEnumerable statuses = null, Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy scheduledEventsPolicy = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Compute.Models.AvailabilitySetPatch AvailabilitySetPatch(System.Collections.Generic.IDictionary tags, Azure.ResourceManager.Compute.Models.ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, System.Collections.Generic.IEnumerable virtualMachines, Azure.Core.ResourceIdentifier proximityPlacementGroupId, System.Collections.Generic.IEnumerable statuses) { throw null; } + public static Azure.ResourceManager.Compute.Models.AvailabilitySetPatch AvailabilitySetPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Compute.Models.ComputeSku sku = null, int? platformUpdateDomainCount = default(int?), int? platformFaultDomainCount = default(int?), System.Collections.Generic.IEnumerable virtualMachines = null, Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, System.Collections.Generic.IEnumerable statuses = null, Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy scheduledEventsPolicy = null) { throw null; } public static Azure.ResourceManager.Compute.Models.AvailablePatchSummary AvailablePatchSummary(Azure.ResourceManager.Compute.Models.PatchOperationStatus? status = default(Azure.ResourceManager.Compute.Models.PatchOperationStatus?), string assessmentActivityId = null, bool? rebootPending = default(bool?), int? criticalAndSecurityPatchCount = default(int?), int? otherPatchCount = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Compute.Models.ComputeApiError error = null) { throw null; } public static Azure.ResourceManager.Compute.Models.BootDiagnosticsInstanceView BootDiagnosticsInstanceView(System.Uri consoleScreenshotBlobUri = null, System.Uri serialConsoleLogBlobUri = null, Azure.ResourceManager.Compute.Models.InstanceViewStatus status = null) { throw null; } public static Azure.ResourceManager.Compute.CapacityReservationData CapacityReservationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Compute.Models.ComputeSku sku = null, System.Collections.Generic.IEnumerable zones = null, string reservationId = null, int? platformFaultDomainCount = default(int?), System.Collections.Generic.IEnumerable virtualMachinesAssociated = null, System.DateTimeOffset? provisioningOn = default(System.DateTimeOffset?), string provisioningState = null, Azure.ResourceManager.Compute.Models.CapacityReservationInstanceView instanceView = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?)) { throw null; } @@ -3250,7 +3258,9 @@ public static partial class ArmComputeModelFactory public static Azure.ResourceManager.Compute.Models.DiskImagePatch DiskImagePatch(System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier sourceVirtualMachineId = null, Azure.ResourceManager.Compute.Models.ImageStorageProfile storageProfile = null, string provisioningState = null, Azure.ResourceManager.Compute.Models.HyperVGeneration? hyperVGeneration = default(Azure.ResourceManager.Compute.Models.HyperVGeneration?)) { throw null; } public static Azure.ResourceManager.Compute.Models.DiskInstanceView DiskInstanceView(string name = null, System.Collections.Generic.IEnumerable encryptionSettings = null, System.Collections.Generic.IEnumerable statuses = null) { throw null; } public static Azure.ResourceManager.Compute.Models.DiskRestorePointAttributes DiskRestorePointAttributes(Azure.Core.ResourceIdentifier id = null, Azure.ResourceManager.Compute.Models.RestorePointEncryption encryption = null, Azure.Core.ResourceIdentifier sourceDiskRestorePointId = null) { throw null; } - public static Azure.ResourceManager.Compute.DiskRestorePointData DiskRestorePointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType? osType = default(Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType?), Azure.ResourceManager.Compute.Models.HyperVGeneration? hyperVGeneration = default(Azure.ResourceManager.Compute.Models.HyperVGeneration?), Azure.ResourceManager.Compute.Models.DiskPurchasePlan purchasePlan = null, Azure.ResourceManager.Compute.Models.SupportedCapabilities supportedCapabilities = null, string familyId = null, string sourceUniqueId = null, Azure.ResourceManager.Compute.Models.DiskEncryption encryption = null, bool? supportsHibernation = default(bool?), Azure.ResourceManager.Compute.Models.NetworkAccessPolicy? networkAccessPolicy = default(Azure.ResourceManager.Compute.Models.NetworkAccessPolicy?), Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess?), Azure.Core.ResourceIdentifier diskAccessId = null, float? completionPercent = default(float?), string replicationState = null, Azure.Core.AzureLocation? sourceResourceLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Compute.Models.DiskSecurityProfile securityProfile = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Compute.DiskRestorePointData DiskRestorePointData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.DateTimeOffset? timeCreated, Azure.Core.ResourceIdentifier sourceResourceId, Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType? osType, Azure.ResourceManager.Compute.Models.HyperVGeneration? hyperVGeneration, Azure.ResourceManager.Compute.Models.DiskPurchasePlan purchasePlan, Azure.ResourceManager.Compute.Models.SupportedCapabilities supportedCapabilities, string familyId, string sourceUniqueId, Azure.ResourceManager.Compute.Models.DiskEncryption encryption, bool? supportsHibernation, Azure.ResourceManager.Compute.Models.NetworkAccessPolicy? networkAccessPolicy, Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess? publicNetworkAccess, Azure.Core.ResourceIdentifier diskAccessId, float? completionPercent, string replicationState, Azure.Core.AzureLocation? sourceResourceLocation, Azure.ResourceManager.Compute.Models.DiskSecurityProfile securityProfile) { throw null; } + public static Azure.ResourceManager.Compute.DiskRestorePointData DiskRestorePointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType? osType = default(Azure.ResourceManager.Compute.Models.SupportedOperatingSystemType?), Azure.ResourceManager.Compute.Models.HyperVGeneration? hyperVGeneration = default(Azure.ResourceManager.Compute.Models.HyperVGeneration?), Azure.ResourceManager.Compute.Models.DiskPurchasePlan purchasePlan = null, Azure.ResourceManager.Compute.Models.SupportedCapabilities supportedCapabilities = null, string familyId = null, string sourceUniqueId = null, Azure.ResourceManager.Compute.Models.DiskEncryption encryption = null, bool? supportsHibernation = default(bool?), Azure.ResourceManager.Compute.Models.NetworkAccessPolicy? networkAccessPolicy = default(Azure.ResourceManager.Compute.Models.NetworkAccessPolicy?), Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Compute.Models.DiskPublicNetworkAccess?), Azure.Core.ResourceIdentifier diskAccessId = null, float? completionPercent = default(float?), string replicationState = null, Azure.Core.AzureLocation? sourceResourceLocation = default(Azure.Core.AzureLocation?), Azure.ResourceManager.Compute.Models.DiskSecurityProfile securityProfile = null, int? logicalSectorSize = default(int?)) { throw null; } public static Azure.ResourceManager.Compute.Models.DiskRestorePointInstanceView DiskRestorePointInstanceView(string id = null, Azure.ResourceManager.Compute.Models.DiskRestorePointReplicationStatus replicationStatus = null) { throw null; } public static Azure.ResourceManager.Compute.Models.DiskRestorePointReplicationStatus DiskRestorePointReplicationStatus(Azure.ResourceManager.Compute.Models.InstanceViewStatus status = null, int? completionPercent = default(int?)) { throw null; } public static Azure.ResourceManager.Compute.Models.DiskSku DiskSku(Azure.ResourceManager.Compute.Models.DiskStorageAccountType? name = default(Azure.ResourceManager.Compute.Models.DiskStorageAccountType?), string tier = null) { throw null; } @@ -3373,7 +3383,9 @@ public static partial class ArmComputeModelFactory public static Azure.ResourceManager.Compute.VirtualMachineScaleSetData VirtualMachineScaleSetData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Compute.Models.ComputeSku sku, Azure.ResourceManager.Compute.Models.ComputePlan plan, Azure.ResourceManager.Models.ManagedServiceIdentity identity, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy upgradePolicy, Azure.ResourceManager.Compute.Models.AutomaticRepairsPolicy automaticRepairsPolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, Azure.Core.ResourceIdentifier proximityPlacementGroupId, Azure.Core.ResourceIdentifier hostGroupId, Azure.ResourceManager.Compute.Models.AdditionalCapabilities additionalCapabilities, Azure.ResourceManager.Compute.Models.ScaleInPolicy scaleInPolicy, Azure.ResourceManager.Compute.Models.OrchestrationMode? orchestrationMode, Azure.ResourceManager.Compute.Models.SpotRestorePolicy spotRestorePolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, System.DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Compute.VirtualMachineScaleSetData VirtualMachineScaleSetData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Compute.Models.ComputeSku sku, Azure.ResourceManager.Compute.Models.ComputePlan plan, Azure.ResourceManager.Models.ManagedServiceIdentity identity, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation, string etag, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy upgradePolicy, Azure.ResourceManager.Compute.Models.AutomaticRepairsPolicy automaticRepairsPolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, Azure.Core.ResourceIdentifier proximityPlacementGroupId, Azure.Core.ResourceIdentifier hostGroupId, Azure.ResourceManager.Compute.Models.AdditionalCapabilities additionalCapabilities, Azure.ResourceManager.Compute.Models.ScaleInPolicy scaleInPolicy, Azure.ResourceManager.Compute.Models.OrchestrationMode? orchestrationMode, Azure.ResourceManager.Compute.Models.SpotRestorePolicy spotRestorePolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, System.DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, Azure.ResourceManager.Compute.Models.ResiliencyPolicy resiliencyPolicy) { throw null; } - public static Azure.ResourceManager.Compute.VirtualMachineScaleSetData VirtualMachineScaleSetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Compute.Models.ComputeSku sku = null, Azure.ResourceManager.Compute.Models.ComputePlan plan = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null, string etag = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy upgradePolicy = null, Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy scheduledEventsPolicy = null, Azure.ResourceManager.Compute.Models.AutomaticRepairsPolicy automaticRepairsPolicy = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile virtualMachineProfile = null, string provisioningState = null, bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVms = default(bool?), string uniqueId = null, bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, Azure.Core.ResourceIdentifier hostGroupId = null, Azure.ResourceManager.Compute.Models.AdditionalCapabilities additionalCapabilities = null, Azure.ResourceManager.Compute.Models.ScaleInPolicy scaleInPolicy = null, Azure.ResourceManager.Compute.Models.OrchestrationMode? orchestrationMode = default(Azure.ResourceManager.Compute.Models.OrchestrationMode?), Azure.ResourceManager.Compute.Models.SpotRestorePolicy spotRestorePolicy = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?), bool? isMaximumCapacityConstrained = default(bool?), Azure.ResourceManager.Compute.Models.ResiliencyPolicy resiliencyPolicy = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Compute.VirtualMachineScaleSetData VirtualMachineScaleSetData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ResourceManager.Compute.Models.ComputeSku sku, Azure.ResourceManager.Compute.Models.ComputePlan plan, Azure.ResourceManager.Models.ManagedServiceIdentity identity, System.Collections.Generic.IEnumerable zones, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation, string etag, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy upgradePolicy, Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy scheduledEventsPolicy, Azure.ResourceManager.Compute.Models.AutomaticRepairsPolicy automaticRepairsPolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, Azure.Core.ResourceIdentifier proximityPlacementGroupId, Azure.Core.ResourceIdentifier hostGroupId, Azure.ResourceManager.Compute.Models.AdditionalCapabilities additionalCapabilities, Azure.ResourceManager.Compute.Models.ScaleInPolicy scaleInPolicy, Azure.ResourceManager.Compute.Models.OrchestrationMode? orchestrationMode, Azure.ResourceManager.Compute.Models.SpotRestorePolicy spotRestorePolicy, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, System.DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, Azure.ResourceManager.Compute.Models.ResiliencyPolicy resiliencyPolicy) { throw null; } + public static Azure.ResourceManager.Compute.VirtualMachineScaleSetData VirtualMachineScaleSetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Compute.Models.ComputeSku sku = null, Azure.ResourceManager.Compute.Models.ComputePlan plan = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null, string etag = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy upgradePolicy = null, Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy scheduledEventsPolicy = null, Azure.ResourceManager.Compute.Models.AutomaticRepairsPolicy automaticRepairsPolicy = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetVmProfile virtualMachineProfile = null, string provisioningState = null, bool? overprovision = default(bool?), bool? doNotRunExtensionsOnOverprovisionedVms = default(bool?), string uniqueId = null, bool? singlePlacementGroup = default(bool?), bool? zoneBalance = default(bool?), int? platformFaultDomainCount = default(int?), Azure.Core.ResourceIdentifier proximityPlacementGroupId = null, Azure.Core.ResourceIdentifier hostGroupId = null, Azure.ResourceManager.Compute.Models.AdditionalCapabilities additionalCapabilities = null, Azure.ResourceManager.Compute.Models.ScaleInPolicy scaleInPolicy = null, Azure.ResourceManager.Compute.Models.OrchestrationMode? orchestrationMode = default(Azure.ResourceManager.Compute.Models.OrchestrationMode?), Azure.ResourceManager.Compute.Models.SpotRestorePolicy spotRestorePolicy = null, Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy = null, System.DateTimeOffset? timeCreated = default(System.DateTimeOffset?), bool? isMaximumCapacityConstrained = default(bool?), Azure.ResourceManager.Compute.Models.ResiliencyPolicy resiliencyPolicy = null, Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode = default(Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode?), Azure.ResourceManager.Compute.Models.ComputeSkuProfile skuProfile = null) { throw null; } public static Azure.ResourceManager.Compute.VirtualMachineScaleSetExtensionData VirtualMachineScaleSetExtensionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), System.BinaryData settings = null, System.BinaryData protectedSettings = null, string provisioningState = null, System.Collections.Generic.IEnumerable provisionAfterExtensions = null, bool? suppressFailures = default(bool?), Azure.ResourceManager.Compute.Models.KeyVaultSecretReference keyVaultProtectedSettings = null) { throw null; } public static Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetExtensionPatch VirtualMachineScaleSetExtensionPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), System.BinaryData settings = null, System.BinaryData protectedSettings = null, string provisioningState = null, System.Collections.Generic.IEnumerable provisionAfterExtensions = null, bool? suppressFailures = default(bool?), Azure.ResourceManager.Compute.Models.KeyVaultSecretReference keyVaultProtectedSettings = null) { throw null; } public static Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetInstanceView VirtualMachineScaleSetInstanceView(System.Collections.Generic.IEnumerable virtualMachineStatusesSummary = null, System.Collections.Generic.IEnumerable extensions = null, System.Collections.Generic.IEnumerable statuses = null, System.Collections.Generic.IEnumerable orchestrationServices = null) { throw null; } @@ -3391,6 +3403,7 @@ public static partial class ArmComputeModelFactory public static Azure.ResourceManager.Compute.Models.VirtualMachineSize VirtualMachineSize(string name = null, int? numberOfCores = default(int?), int? osDiskSizeInMB = default(int?), int? resourceDiskSizeInMB = default(int?), int? memoryInMB = default(int?), int? maxDataDiskCount = default(int?)) { throw null; } public static Azure.ResourceManager.Compute.Models.VirtualMachineSoftwarePatchProperties VirtualMachineSoftwarePatchProperties(string patchId = null, string name = null, string version = null, string kbId = null, System.Collections.Generic.IEnumerable classifications = null, Azure.ResourceManager.Compute.Models.VmGuestPatchRebootBehavior? rebootBehavior = default(Azure.ResourceManager.Compute.Models.VmGuestPatchRebootBehavior?), string activityId = null, System.DateTimeOffset? publishedOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Compute.Models.PatchAssessmentState? assessmentState = default(Azure.ResourceManager.Compute.Models.PatchAssessmentState?)) { throw null; } public static Azure.ResourceManager.Compute.Models.VirtualMachineStatusCodeCount VirtualMachineStatusCodeCount(string code = null, int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Compute.Models.WindowsConfiguration WindowsConfiguration(bool? provisionVmAgent = default(bool?), bool? isAutomaticUpdatesEnabled = default(bool?), string timeZone = null, System.Collections.Generic.IEnumerable additionalUnattendContent = null, Azure.ResourceManager.Compute.Models.PatchSettings patchSettings = null, System.Collections.Generic.IEnumerable winRMListeners = null, bool? isVmAgentPlatformUpdatesEnabled = default(bool?)) { throw null; } } public partial class AttachDetachDataDisksRequest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -3434,6 +3447,7 @@ public AvailabilitySetPatch() { } public int? PlatformFaultDomainCount { get { throw null; } set { } } public int? PlatformUpdateDomainCount { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ProximityPlacementGroupId { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ScheduledEventsPolicy ScheduledEventsPolicy { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.ComputeSku Sku { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList Statuses { get { throw null; } } public System.Collections.Generic.IList VirtualMachines { get { throw null; } } @@ -3837,6 +3851,24 @@ internal CommunityGalleryMetadata() { } public static bool operator !=(Azure.ResourceManager.Compute.Models.ComponentName left, Azure.ResourceManager.Compute.Models.ComponentName right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeAllocationStrategy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeAllocationStrategy(string value) { throw null; } + public static Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy CapacityOptimized { get { throw null; } } + public static Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy LowestPrice { get { throw null; } } + public bool Equals(Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy left, Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy right) { throw null; } + public static implicit operator Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy left, Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy right) { throw null; } + public override string ToString() { throw null; } + } public partial class ComputeApiError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal ComputeApiError() { } @@ -4197,9 +4229,14 @@ public ComputeScheduledEventsProfile() { } } public partial class ComputeSecurityPostureReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public ComputeSecurityPostureReference() { } + public ComputeSecurityPostureReference(Azure.Core.ResourceIdentifier id) { } + public System.Collections.Generic.IList ExcludeExtensionNames { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.Collections.Generic.IList ExcludeExtensions { get { throw null; } } public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } + public bool? IsOverridable { get { throw null; } set { } } Azure.ResourceManager.Compute.Models.ComputeSecurityPostureReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Compute.Models.ComputeSecurityPostureReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4218,6 +4255,27 @@ public ComputeSku() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ComputeSkuProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeSkuProfile() { } + public Azure.ResourceManager.Compute.Models.ComputeAllocationStrategy? AllocationStrategy { get { throw null; } set { } } + public System.Collections.Generic.IList VmSizes { get { throw null; } } + Azure.ResourceManager.Compute.Models.ComputeSkuProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Compute.Models.ComputeSkuProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeSkuProfileVmSize : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeSkuProfileVmSize() { } + public string Name { get { throw null; } set { } } + Azure.ResourceManager.Compute.Models.ComputeSkuProfileVmSize System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Compute.Models.ComputeSkuProfileVmSize System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public enum ComputeStatusLevelType { Info = 0, @@ -7113,6 +7171,18 @@ public ScheduledEventsPolicy() { } public static bool operator !=(Azure.ResourceManager.Compute.Models.SecurityEncryptionType left, Azure.ResourceManager.Compute.Models.SecurityEncryptionType right) { throw null; } public override string ToString() { throw null; } } + public partial class SecurityPostureReferenceUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecurityPostureReferenceUpdate() { } + public System.Collections.Generic.IList ExcludeExtensions { get { throw null; } } + public string Id { get { throw null; } set { } } + public bool? IsOverridable { get { throw null; } set { } } + Azure.ResourceManager.Compute.Models.SecurityPostureReferenceUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Compute.Models.SecurityPostureReferenceUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class SecurityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SecurityProfile() { } @@ -8625,9 +8695,12 @@ public VirtualMachineScaleSetPatch() { } public Azure.ResourceManager.Compute.Models.ScaleInPolicy ScaleInPolicy { get { throw null; } set { } } public bool? SinglePlacementGroup { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.ComputeSku Sku { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ComputeSkuProfile SkuProfile { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.SpotRestorePolicy SpotRestorePolicy { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpgradePolicy UpgradePolicy { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpdateVmProfile VirtualMachineProfile { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode? ZonalPlatformFaultDomainAlignMode { get { throw null; } set { } } + public System.Collections.Generic.IList Zones { get { throw null; } } Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -8874,6 +8947,7 @@ public VirtualMachineScaleSetUpdateVmProfile() { } public Azure.ResourceManager.Compute.Models.ComputeScheduledEventsProfile ScheduledEventsProfile { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.Compute.Models.TerminateNotificationProfile ScheduledEventsTerminateNotificationProfile { get { throw null; } set { } } + public Azure.ResourceManager.Compute.Models.SecurityPostureReferenceUpdate SecurityPostureReference { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.SecurityProfile SecurityProfile { get { throw null; } set { } } public Azure.ResourceManager.Compute.Models.VirtualMachineScaleSetUpdateStorageProfile StorageProfile { get { throw null; } set { } } public string UserData { get { throw null; } set { } } @@ -9390,7 +9464,7 @@ public WindowsConfiguration() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public bool? EnableAutomaticUpdates { get { throw null; } set { } } public bool? IsAutomaticUpdatesEnabled { get { throw null; } set { } } - public bool? IsVmAgentPlatformUpdatesEnabled { get { throw null; } set { } } + public bool? IsVmAgentPlatformUpdatesEnabled { get { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] set { } } public Azure.ResourceManager.Compute.Models.PatchSettings PatchSettings { get { throw null; } set { } } public bool? ProvisionVmAgent { get { throw null; } set { } } public string TimeZone { get { throw null; } set { } } @@ -9499,4 +9573,22 @@ public enum WinRMListenerProtocolType Http = 0, Https = 1, } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ZonalPlatformFaultDomainAlignMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ZonalPlatformFaultDomainAlignMode(string value) { throw null; } + public static Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode Aligned { get { throw null; } } + public static Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode Unaligned { get { throw null; } } + public bool Equals(Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode left, Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode left, Azure.ResourceManager.Compute.Models.ZonalPlatformFaultDomainAlignMode right) { throw null; } + public override string ToString() { throw null; } + } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/assets.json b/sdk/compute/Azure.ResourceManager.Compute/assets.json index a20dd911a915..0389918c4ce8 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/assets.json +++ b/sdk/compute/Azure.ResourceManager.Compute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/compute/Azure.ResourceManager.Compute", - "Tag": "net/compute/Azure.ResourceManager.Compute_4ea075e9ca" + "Tag": "net/compute/Azure.ResourceManager.Compute_d32ee065f6" } diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetCollection.cs index 1212fd7bfed8..7c3ad3e4d59e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetCollection.cs @@ -15,12 +15,52 @@ namespace Azure.ResourceManager.Compute.Samples { public partial class Sample_AvailabilitySetCollection { + // Create an availability set with Scheduled Event Policy. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAnAvailabilitySetWithScheduledEventPolicy() + { + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json + // this example is just showing the usage of "AvailabilitySets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "{subscription-id}"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvailabilitySetResource + AvailabilitySetCollection collection = resourceGroupResource.GetAvailabilitySets(); + + // invoke the operation + string availabilitySetName = "myAvailabilitySet"; + AvailabilitySetData data = new AvailabilitySetData(new AzureLocation("westus")) + { + PlatformUpdateDomainCount = 20, + PlatformFaultDomainCount = 2, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, availabilitySetName, data); + AvailabilitySetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AvailabilitySetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Create an availability set. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnAvailabilitySet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Create.json // this example is just showing the usage of "AvailabilitySets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +100,7 @@ public async Task CreateOrUpdate_CreateAnAvailabilitySet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_AvailabilitySetGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +134,7 @@ public async Task Get_AvailabilitySetGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_AvailabilitySetGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +164,7 @@ public async Task Exists_AvailabilitySetGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_AvailabilitySetGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +206,7 @@ public async Task GetIfExists_AvailabilitySetGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_AvailabilitySetGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,7 +240,7 @@ public async Task Get_AvailabilitySetGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_AvailabilitySetGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -230,7 +270,7 @@ public async Task Exists_AvailabilitySetGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_AvailabilitySetGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -272,7 +312,7 @@ public async Task GetIfExists_AvailabilitySetGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_AvailabilitySetListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -308,7 +348,7 @@ public async Task GetAll_AvailabilitySetListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_AvailabilitySetListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetResource.cs index 761ba5a02026..91c711f85ab9 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_AvailabilitySetResource.cs @@ -22,7 +22,7 @@ public partial class Sample_AvailabilitySetResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_AvailabilitySetUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task Update_AvailabilitySetUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_AvailabilitySetUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task Update_AvailabilitySetUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_AvailabilitySetDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task Delete_AvailabilitySetDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_AvailabilitySetDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +162,7 @@ public async Task Delete_AvailabilitySetDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_AvailabilitySetGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -193,7 +193,7 @@ public async Task Get_AvailabilitySetGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_AvailabilitySetGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -224,7 +224,7 @@ public async Task Get_AvailabilitySetGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAvailabilitySets_ListAvailabilitySetsInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json // this example is just showing the usage of "AvailabilitySets_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -257,7 +257,7 @@ public async Task GetAvailabilitySets_ListAvailabilitySetsInASubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAvailableSizes_AvailabilitySetListAvailableSizesMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_ListAvailableSizes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -287,7 +287,7 @@ public async Task GetAvailableSizes_AvailabilitySetListAvailableSizesMaximumSetG [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAvailableSizes_AvailabilitySetListAvailableSizesMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json // this example is just showing the usage of "AvailabilitySets_ListAvailableSizes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationCollection.cs index 85e049c2e4d2..226fdb6ba18a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_CapacityReservationCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateACapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json // this example is just showing the usage of "CapacityReservations_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -71,7 +71,7 @@ public async Task CreateOrUpdate_CreateOrUpdateACapacityReservation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetACapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Get.json // this example is just showing the usage of "CapacityReservations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -107,7 +107,7 @@ public async Task Get_GetACapacityReservation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetACapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Get.json // this example is just showing the usage of "CapacityReservations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,7 +139,7 @@ public async Task Exists_GetACapacityReservation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetACapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Get.json // this example is just showing the usage of "CapacityReservations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +183,7 @@ public async Task GetIfExists_GetACapacityReservation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListCapacityReservationsInReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json // this example is just showing the usage of "CapacityReservations_ListByCapacityReservationGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupCollection.cs index 6ff8b25544a9..0a48cac0834b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_CapacityReservationGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateACapacityReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json // this example is just showing the usage of "CapacityReservationGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task CreateOrUpdate_CreateOrUpdateACapacityReservationGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetACapacityReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json // this example is just showing the usage of "CapacityReservationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Get_GetACapacityReservationGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetACapacityReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json // this example is just showing the usage of "CapacityReservationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +144,7 @@ public async Task Exists_GetACapacityReservationGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetACapacityReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json // this example is just showing the usage of "CapacityReservationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -187,7 +187,7 @@ public async Task GetIfExists_GetACapacityReservationGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListCapacityReservationGroupsInResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json // this example is just showing the usage of "CapacityReservationGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupResource.cs index e33b25617b67..a7784c4c8681 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationGroupResource.cs @@ -21,7 +21,7 @@ public partial class Sample_CapacityReservationGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CapacityReservationGroupUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json // this example is just showing the usage of "CapacityReservationGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task Update_CapacityReservationGroupUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CapacityReservationGroupUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json // this example is just showing the usage of "CapacityReservationGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Update_CapacityReservationGroupUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CapacityReservationGroupDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json // this example is just showing the usage of "CapacityReservationGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -118,7 +118,7 @@ public async Task Delete_CapacityReservationGroupDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CapacityReservationGroupDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json // this example is just showing the usage of "CapacityReservationGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +145,7 @@ public async Task Delete_CapacityReservationGroupDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetACapacityReservationGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Get.json // this example is just showing the usage of "CapacityReservationGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,7 +177,7 @@ public async Task Get_GetACapacityReservationGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCapacityReservationGroups_ListCapacityReservationGroupsInSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json // this example is just showing the usage of "CapacityReservationGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task GetCapacityReservationGroups_ListCapacityReservationGroupsInSu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCapacityReservationGroups_ListCapacityReservationGroupsWithResourceIdsOnlyInSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json // this example is just showing the usage of "CapacityReservationGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationResource.cs index 98c70fa45723..0b29fa036165 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_CapacityReservationResource.cs @@ -20,7 +20,7 @@ public partial class Sample_CapacityReservationResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CapacityReservationUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json // this example is just showing the usage of "CapacityReservations_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task Update_CapacityReservationUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CapacityReservationUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json // this example is just showing the usage of "CapacityReservations_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Update_CapacityReservationUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CapacityReservationDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json // this example is just showing the usage of "CapacityReservations_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Delete_CapacityReservationDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_CapacityReservationDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json // this example is just showing the usage of "CapacityReservations_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task Delete_CapacityReservationDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetACapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/capacityReservationExamples/CapacityReservation_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Get.json // this example is just showing the usage of "CapacityReservations_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionCollection.cs index ba93e5962e9b..7bac8aa9b062 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ComputePrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApproveAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json // this example is just showing the usage of "DiskAccesses_UpdateAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_ApproveAPrivateEndpointConnectionUnderADiskAcce [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json // this example is just showing the usage of "DiskAccesses_GetAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Get_GetInformationAboutAPrivateEndpointConnectionUnderADiskAcc [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json // this example is just showing the usage of "DiskAccesses_GetAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +130,7 @@ public async Task Exists_GetInformationAboutAPrivateEndpointConnectionUnderADisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json // this example is just showing the usage of "DiskAccesses_GetAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +173,7 @@ public async Task GetIfExists_GetInformationAboutAPrivateEndpointConnectionUnder [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json // this example is just showing the usage of "DiskAccesses_ListPrivateEndpointConnections" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionResource.cs index d1bbf96ccaa3..c5a61688bba2 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ComputePrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ComputePrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApproveAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json // this example is just showing the usage of "DiskAccesses_UpdateAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Update_ApproveAPrivateEndpointConnectionUnderADiskAccessResour [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json // this example is just showing the usage of "DiskAccesses_GetAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +93,7 @@ public async Task Get_GetInformationAboutAPrivateEndpointConnectionUnderADiskAcc [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAPrivateEndpointConnectionUnderADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json // this example is just showing the usage of "DiskAccesses_DeleteAPrivateEndpointConnection" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostCollection.cs index 51a6dd3d239c..ef901137f1ff 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DedicatedHostCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateADedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json // this example is just showing the usage of "DedicatedHosts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -67,7 +67,7 @@ public async Task CreateOrUpdate_CreateOrUpdateADedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetADedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Get.json // this example is just showing the usage of "DedicatedHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -103,7 +103,7 @@ public async Task Get_GetADedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetADedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Get.json // this example is just showing the usage of "DedicatedHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -135,7 +135,7 @@ public async Task Exists_GetADedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetADedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Get.json // this example is just showing the usage of "DedicatedHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +179,7 @@ public async Task GetIfExists_GetADedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_DedicatedHostListByHostGroupMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_ListByHostGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -216,7 +216,7 @@ public async Task GetAll_DedicatedHostListByHostGroupMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_DedicatedHostListByHostGroupMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_ListByHostGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupCollection.cs index 4662d129c9fb..820f7175c470 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DedicatedHostGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateADedicatedHostGroupWithUltraSSDSupport() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json // this example is just showing the usage of "DedicatedHostGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -69,7 +69,7 @@ public async Task CreateOrUpdate_CreateOrUpdateADedicatedHostGroupWithUltraSSDSu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateADedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json // this example is just showing the usage of "DedicatedHostGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task CreateOrUpdate_CreateOrUpdateADedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CreateADedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -151,7 +151,7 @@ public async Task Get_CreateADedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CreateADedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -181,7 +181,7 @@ public async Task Exists_CreateADedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CreateADedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -223,7 +223,7 @@ public async Task GetIfExists_CreateADedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CreateAnUltraSSDEnabledDedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -257,7 +257,7 @@ public async Task Get_CreateAnUltraSSDEnabledDedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_CreateAnUltraSSDEnabledDedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -287,7 +287,7 @@ public async Task Exists_CreateAnUltraSSDEnabledDedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_CreateAnUltraSSDEnabledDedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -329,7 +329,7 @@ public async Task GetIfExists_CreateAnUltraSSDEnabledDedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_DedicatedHostGroupListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -365,7 +365,7 @@ public async Task GetAll_DedicatedHostGroupListByResourceGroupMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_DedicatedHostGroupListByResourceGroupMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupResource.cs index b846ae205c08..e392947354bc 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostGroupResource.cs @@ -21,7 +21,7 @@ public partial class Sample_DedicatedHostGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DedicatedHostGroupUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task Update_DedicatedHostGroupUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DedicatedHostGroupUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Update_DedicatedHostGroupUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DedicatedHostGroupDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Delete_DedicatedHostGroupDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DedicatedHostGroupDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -151,7 +151,7 @@ public async Task Delete_DedicatedHostGroupDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CreateADedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -182,7 +182,7 @@ public async Task Get_CreateADedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_CreateAnUltraSSDEnabledDedicatedHostGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json // this example is just showing the usage of "DedicatedHostGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -213,7 +213,7 @@ public async Task Get_CreateAnUltraSSDEnabledDedicatedHostGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDedicatedHostGroups_DedicatedHostGroupListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -245,7 +245,7 @@ public async Task GetDedicatedHostGroups_DedicatedHostGroupListBySubscriptionMax [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDedicatedHostGroups_DedicatedHostGroupListBySubscriptionMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHostGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostResource.cs index 3d9b4a0c9d5a..c06bd27dd566 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DedicatedHostResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DedicatedHostResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DedicatedHostUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task Update_DedicatedHostUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DedicatedHostUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Update_DedicatedHostUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_DedicatedHostUpdateResize() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json // this example is just showing the usage of "DedicatedHosts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +137,7 @@ public async Task Update_DedicatedHostUpdateResize() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DedicatedHostDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Delete_DedicatedHostDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DedicatedHostDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json // this example is just showing the usage of "DedicatedHosts_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -193,7 +193,7 @@ public async Task Delete_DedicatedHostDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetADedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Get.json // this example is just showing the usage of "DedicatedHosts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -226,7 +226,7 @@ public async Task Get_GetADedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_RestartDedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Restart.json // this example is just showing the usage of "DedicatedHosts_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -254,7 +254,7 @@ public async Task Restart_RestartDedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_RedeployDedicatedHost() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json // this example is just showing the usage of "DedicatedHosts_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -282,7 +282,7 @@ public async Task Redeploy_RedeployDedicatedHost() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAvailableSizes_GetAvailableDedicatedHostSizes() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json // this example is just showing the usage of "DedicatedHosts_ListAvailableSizes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessCollection.cs index 4dac2c643882..4813a47a7efe 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_DiskAccessCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Create.json // this example is just showing the usage of "DiskAccesses_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task CreateOrUpdate_CreateADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskAccessResourceWithPrivateEndpoints() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +90,7 @@ public async Task Get_GetInformationAboutADiskAccessResourceWithPrivateEndpoints [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutADiskAccessResourceWithPrivateEndpoints() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task Exists_GetInformationAboutADiskAccessResourceWithPrivateEndpoi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutADiskAccessResourceWithPrivateEndpoints() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +162,7 @@ public async Task GetIfExists_GetInformationAboutADiskAccessResourceWithPrivateE [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,7 +196,7 @@ public async Task Get_GetInformationAboutADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -226,7 +226,7 @@ public async Task Exists_GetInformationAboutADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -268,7 +268,7 @@ public async Task GetIfExists_GetInformationAboutADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAllDiskAccessResourcesInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json // this example is just showing the usage of "DiskAccesses_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessResource.cs index 6a2912480098..b1b8a5e113f8 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskAccessResource.cs @@ -21,7 +21,7 @@ public partial class Sample_DiskAccessResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Update.json // this example is just showing the usage of "DiskAccesses_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Update_UpdateADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskAccessResourceWithPrivateEndpoints() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetInformationAboutADiskAccessResourceWithPrivateEndpoints [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get.json // this example is just showing the usage of "DiskAccesses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Get_GetInformationAboutADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteADiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Delete.json // this example is just showing the usage of "DiskAccesses_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -150,7 +150,7 @@ public async Task Delete_DeleteADiskAccessResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDiskAccesses_ListAllDiskAccessResourcesInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json // this example is just showing the usage of "DiskAccesses_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -182,7 +182,7 @@ public async Task GetDiskAccesses_ListAllDiskAccessResourcesInASubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPrivateLinkResources_ListAllPossiblePrivateLinkResourcesUnderDiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json // this example is just showing the usage of "DiskAccesses_GetPrivateLinkResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetCollection.cs index 11fcd188062f..2fc438e848cf 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_DiskEncryptionSetCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json // this example is just showing the usage of "DiskEncryptionSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task CreateOrUpdate_CreateADiskEncryptionSetWithKeyVaultFromADiffer [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADiskEncryptionSetWithKeyVaultFromADifferentTenant() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json // this example is just showing the usage of "DiskEncryptionSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -111,7 +111,7 @@ public async Task CreateOrUpdate_CreateADiskEncryptionSetWithKeyVaultFromADiffer [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json // this example is just showing the usage of "DiskEncryptionSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,7 +155,7 @@ public async Task CreateOrUpdate_CreateADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -189,7 +189,7 @@ public async Task Get_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFa [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -219,7 +219,7 @@ public async Task Exists_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotatio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -261,7 +261,7 @@ public async Task GetIfExists_GetInformationAboutADiskEncryptionSetWhenAutoKeyRo [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -295,7 +295,7 @@ public async Task Get_GetInformationAboutADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -325,7 +325,7 @@ public async Task Exists_GetInformationAboutADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -367,7 +367,7 @@ public async Task GetIfExists_GetInformationAboutADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAllDiskEncryptionSetsInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json // this example is just showing the usage of "DiskEncryptionSets_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetResource.cs index 29667fb503e4..57e882b72875 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskEncryptionSetResource.cs @@ -22,7 +22,7 @@ public partial class Sample_DiskEncryptionSetResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json // this example is just showing the usage of "DiskEncryptionSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +61,7 @@ public async Task Update_UpdateADiskEncryptionSetWithRotationToLatestKeyVersionE [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json // this example is just showing the usage of "DiskEncryptionSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Update_UpdateADiskEncryptionSetWithRotationToLatestKeyVersionE [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json // this example is just showing the usage of "DiskEncryptionSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -145,7 +145,7 @@ public async Task Update_UpdateADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -176,7 +176,7 @@ public async Task Get_GetInformationAboutADiskEncryptionSetWhenAutoKeyRotationFa [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json // this example is just showing the usage of "DiskEncryptionSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -207,7 +207,7 @@ public async Task Get_GetInformationAboutADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteADiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json // this example is just showing the usage of "DiskEncryptionSets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -234,7 +234,7 @@ public async Task Delete_DeleteADiskEncryptionSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDiskEncryptionSets_ListAllDiskEncryptionSetsInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json // this example is just showing the usage of "DiskEncryptionSets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -266,7 +266,7 @@ public async Task GetDiskEncryptionSets_ListAllDiskEncryptionSetsInASubscription [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAssociatedResources_ListAllResourcesThatAreEncryptedWithThisDiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json // this example is just showing the usage of "DiskEncryptionSets_ListAssociatedResources" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageCollection.cs index 3e4fde7c1449..197b9c69fcc2 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_DiskImageCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromABlobWithDiskEncryptionSetResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -67,7 +67,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromABlobWithDiskEncr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromABlob() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromABlob.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromABlob.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromABlob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAManagedDiskWithD [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromAManagedDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromAManagedDisk.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -205,7 +205,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -251,7 +251,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromASnapshotWithDisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromASnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromASnapshot.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -297,7 +297,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAnExistingVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_CreateFromAVM.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromAVM.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -336,7 +336,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageFromAnExistingVirtual [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDiskFromABlob() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -389,7 +389,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -442,7 +442,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDiskFromASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json // this example is just showing the usage of "Images_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -495,7 +495,7 @@ public async Task CreateOrUpdate_CreateAVirtualMachineImageThatIncludesADataDisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAVirtualMachineImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Get.json // this example is just showing the usage of "Images_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -529,7 +529,7 @@ public async Task Get_GetInformationAboutAVirtualMachineImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutAVirtualMachineImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Get.json // this example is just showing the usage of "Images_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -559,7 +559,7 @@ public async Task Exists_GetInformationAboutAVirtualMachineImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutAVirtualMachineImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Get.json // this example is just showing the usage of "Images_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -601,7 +601,7 @@ public async Task GetIfExists_GetInformationAboutAVirtualMachineImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAllVirtualMachineImagesInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_ListByResourceGroup.json // this example is just showing the usage of "Images_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageResource.cs index 38c47436abfa..f61afb36162f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskImageResource.cs @@ -21,7 +21,7 @@ public partial class Sample_DiskImageResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdatesTagsOfAnImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Update.json // this example is just showing the usage of "Images_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task Update_UpdatesTagsOfAnImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ImageDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json // this example is just showing the usage of "Images_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Delete_ImageDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ImageDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json // this example is just showing the usage of "Images_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,7 +116,7 @@ public async Task Delete_ImageDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAVirtualMachineImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Get.json // this example is just showing the usage of "Images_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -147,7 +147,7 @@ public async Task Get_GetInformationAboutAVirtualMachineImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetDiskImages_ListAllVirtualMachineImagesInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/imageExamples/Image_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_ListBySubscription.json // this example is just showing the usage of "Images_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointCollection.cs index 3c9bb934a58d..dfd22e80d1ae 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_DiskRestorePointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnIncrementalDiskRestorePointResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetAnIncrementalDiskRestorePointResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAnIncrementalDiskRestorePointResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,7 +87,7 @@ public async Task Exists_GetAnIncrementalDiskRestorePointResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAnIncrementalDiskRestorePointResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task GetIfExists_GetAnIncrementalDiskRestorePointResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task Get_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromAD [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -199,7 +199,7 @@ public async Task Exists_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFro [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -243,7 +243,7 @@ public async Task GetIfExists_GetAnIncrementalDiskRestorePointWhenSourceResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetAnIncrementalDiskRestorePointResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json // this example is just showing the usage of "DiskRestorePoint_ListByRestorePoint" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointResource.cs index f48a97fb28cc..fea879c3541c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_DiskRestorePointResource.cs @@ -20,7 +20,7 @@ public partial class Sample_DiskRestorePointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnIncrementalDiskRestorePointResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task Get_GetAnIncrementalDiskRestorePointResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json // this example is just showing the usage of "DiskRestorePoint_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Get_GetAnIncrementalDiskRestorePointWhenSourceResourceIsFromAD [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GrantAccess_GrantsAccessToADiskRestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json // this example is just showing the usage of "DiskRestorePoint_GrantAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task GrantAccess_GrantsAccessToADiskRestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RevokeAccess_RevokesAccessToADiskRestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json // this example is just showing the usage of "DiskRestorePoint_RevokeAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskCollection.cs index 9622a9ba9380..3d4754fdd785 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_ManagedDiskCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAConfidentialVMSupportedDiskEncryptedWithCustomerManagedKey() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -73,7 +73,7 @@ public async Task CreateOrUpdate_CreateAConfidentialVMSupportedDiskEncryptedWith [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskAndAssociateWithDiskAccessResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithDiskAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithDiskAccess.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +115,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskAndAssociateWithDiskAccessRes [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskAndAssociateWithDiskEncryptionSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskAndAssociateWithDiskEncryptio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskByCopyingASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -201,7 +201,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskByCopyingASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -244,7 +244,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskByImportingAnUnmanagedBlobFro [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -286,7 +286,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskByImportingAnUnmanagedBlobFro [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromImportSecureCreateOption() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromImportSecure.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromImportSecure.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -335,7 +335,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromImportSecureCreateOption( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromUploadPreparedSecureCreateOption() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -382,7 +382,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromUploadPreparedSecureCreat [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromAPlatformImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -428,7 +428,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromAPlatformImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryCommunityImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -474,7 +474,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryComm [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryDirectSharedImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -520,7 +520,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryDire [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -566,7 +566,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromAnAzureComputeGalleryImag [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -608,7 +608,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromAnExistingManagedDiskInTh [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskFromElasticSanVolumeSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -650,7 +650,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskFromElasticSanVolumeSnapshot( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithDataAccessAuthMode() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -691,7 +691,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithDataAccessAuthMode() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithOptimizedForFrequentAttach() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -732,7 +732,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithOptimizedForFrequentAttac [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithPerformancePlus() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_PerformancePlus.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_PerformancePlus.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -774,7 +774,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithPerformancePlus() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithPremiumV2AccountType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -820,7 +820,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithPremiumV2AccountType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithSecurityProfile() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -870,7 +870,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithSecurityProfile() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithSsdZrsAccountType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -914,7 +914,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithSsdZrsAccountType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -967,7 +967,7 @@ public async Task CreateOrUpdate_CreateAManagedDiskWithUltraAccountTypeWithReadO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAManagedUploadDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_UploadDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_UploadDisk.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1009,7 +1009,7 @@ public async Task CreateOrUpdate_CreateAManagedUploadDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnEmptyManagedDiskInExtendedLocation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_InExtendedLocation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_InExtendedLocation.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1053,7 +1053,7 @@ public async Task CreateOrUpdate_CreateAnEmptyManagedDiskInExtendedLocation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnEmptyManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_Empty.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_Empty.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1093,7 +1093,7 @@ public async Task CreateOrUpdate_CreateAnEmptyManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnUltraManagedDiskWithLogicalSectorSize512E() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json // this example is just showing the usage of "Disks_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1140,7 +1140,7 @@ public async Task CreateOrUpdate_CreateAnUltraManagedDiskWithLogicalSectorSize51 [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Get.json // this example is just showing the usage of "Disks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1174,7 +1174,7 @@ public async Task Get_GetInformationAboutAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Get.json // this example is just showing the usage of "Disks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1204,7 +1204,7 @@ public async Task Exists_GetInformationAboutAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Get.json // this example is just showing the usage of "Disks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1246,7 +1246,7 @@ public async Task GetIfExists_GetInformationAboutAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAllManagedDisksInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_ListByResourceGroup.json // this example is just showing the usage of "Disks_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskResource.cs index d572806803d3..419ba7de9bda 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ManagedDiskResource.cs @@ -21,7 +21,7 @@ public partial class Sample_ManagedDiskResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateABurstingEnabledManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +58,7 @@ public async Task Update_CreateOrUpdateABurstingEnabledManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToAddAcceleratedNetworking() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +97,7 @@ public async Task Update_UpdateAManagedDiskToAddAcceleratedNetworking() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToAddArchitecture() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task Update_UpdateAManagedDiskToAddArchitecture() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToAddPurchasePlan() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,7 +175,7 @@ public async Task Update_UpdateAManagedDiskToAddPurchasePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToAddSupportsHibernation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -211,7 +211,7 @@ public async Task Update_UpdateAManagedDiskToAddSupportsHibernation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToChangeTier() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_ChangeTier.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -247,7 +247,7 @@ public async Task Update_UpdateAManagedDiskToChangeTier() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToDisableBursting() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_DisableBursting.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -283,7 +283,7 @@ public async Task Update_UpdateAManagedDiskToDisableBursting() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskToDisableOptimizedForFrequentAttach() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -319,7 +319,7 @@ public async Task Update_UpdateAManagedDiskToDisableOptimizedForFrequentAttach() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAManagedDiskWithDiskControllerTypes() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -358,7 +358,7 @@ public async Task Update_UpdateAManagedDiskWithDiskControllerTypes() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateManagedDiskToRemoveDiskAccessResourceAssociation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json // this example is just showing the usage of "Disks_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -394,7 +394,7 @@ public async Task Update_UpdateManagedDiskToRemoveDiskAccessResourceAssociation( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Get.json // this example is just showing the usage of "Disks_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -425,7 +425,7 @@ public async Task Get_GetInformationAboutAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Delete.json // this example is just showing the usage of "Disks_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -452,7 +452,7 @@ public async Task Delete_DeleteAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetManagedDisks_ListAllManagedDisksInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_ListBySubscription.json // this example is just showing the usage of "Disks_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -484,7 +484,7 @@ public async Task GetManagedDisks_ListAllManagedDisksInASubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GrantAccess_GetASasOnAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_BeginGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_BeginGetAccess.json // this example is just showing the usage of "Disks_GrantAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -516,7 +516,7 @@ public async Task GrantAccess_GetASasOnAManagedDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GrantAccess_GetSasOnManagedDiskAndVMGuestState() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json // this example is just showing the usage of "Disks_GrantAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -548,7 +548,7 @@ public async Task GrantAccess_GetSasOnManagedDiskAndVMGuestState() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RevokeAccess_RevokeAccessToAManagedDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/diskExamples/Disk_EndGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_EndGetAccess.json // this example is just showing the usage of "Disks_RevokeAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupCollection.cs index f748329831ef..48462229016b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_ProximityPlacementGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAProximityPlacementGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json // this example is just showing the usage of "ProximityPlacementGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAProximityPlacementGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetProximityPlacementGroups() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json // this example is just showing the usage of "ProximityPlacementGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Get_GetProximityPlacementGroups() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetProximityPlacementGroups() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json // this example is just showing the usage of "ProximityPlacementGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task Exists_GetProximityPlacementGroups() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetProximityPlacementGroups() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json // this example is just showing the usage of "ProximityPlacementGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +174,7 @@ public async Task GetIfExists_GetProximityPlacementGroups() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListProximityPlacementGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json // this example is just showing the usage of "ProximityPlacementGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupResource.cs index fd2910e1b341..73f9e5600c5f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_ProximityPlacementGroupResource.cs @@ -21,7 +21,7 @@ public partial class Sample_ProximityPlacementGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAProximityPlacementGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json // this example is just showing the usage of "ProximityPlacementGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task Update_UpdateAProximityPlacementGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAProximityPlacementGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json // this example is just showing the usage of "ProximityPlacementGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Delete_DeleteAProximityPlacementGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetProximityPlacementGroups() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json // this example is just showing the usage of "ProximityPlacementGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Get_GetProximityPlacementGroups() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetProximityPlacementGroups_ListProximityPlacementGroups() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json // this example is just showing the usage of "ProximityPlacementGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointCollection.cs index b1c2d6815157..a626baa023fd 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_RestorePointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CopyARestorePointToADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json // this example is just showing the usage of "RestorePoints_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +60,7 @@ public async Task CreateOrUpdate_CopyARestorePointToADifferentRegion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Create.json // this example is just showing the usage of "RestorePoints_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task CreateOrUpdate_CreateARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +141,7 @@ public async Task Get_GetARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task Exists_GetARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -215,7 +215,7 @@ public async Task GetIfExists_GetARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRestorePointWithInstanceView() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -250,7 +250,7 @@ public async Task Get_GetRestorePointWithInstanceView() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRestorePointWithInstanceView() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -281,7 +281,7 @@ public async Task Exists_GetRestorePointWithInstanceView() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRestorePointWithInstanceView() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupCollection.cs index 278e49e1ce45..90f19542dd5f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_RestorePointGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateARestorePointCollectionForCrossRegionCopy() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json // this example is just showing the usage of "RestorePointCollections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -67,7 +67,7 @@ public async Task CreateOrUpdate_CreateOrUpdateARestorePointCollectionForCrossRe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateARestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json // this example is just showing the usage of "RestorePointCollections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task CreateOrUpdate_CreateOrUpdateARestorePointCollection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -147,7 +147,7 @@ public async Task Get_GetARestorePointCollectionButNotTheRestorePointsContainedI [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,7 +177,7 @@ public async Task Exists_GetARestorePointCollectionButNotTheRestorePointsContain [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -219,7 +219,7 @@ public async Task GetIfExists_GetARestorePointCollectionButNotTheRestorePointsCo [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -253,7 +253,7 @@ public async Task Get_GetARestorePointCollectionIncludingTheRestorePointsContain [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -283,7 +283,7 @@ public async Task Exists_GetARestorePointCollectionIncludingTheRestorePointsCont [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -325,7 +325,7 @@ public async Task GetIfExists_GetARestorePointCollectionIncludingTheRestorePoint [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsTheListOfRestorePointCollectionsInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json // this example is just showing the usage of "RestorePointCollections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupResource.cs index 55d04bdc1b56..5629709a8917 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointGroupResource.cs @@ -21,7 +21,7 @@ public partial class Sample_RestorePointGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_RestorePointCollectionUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json // this example is just showing the usage of "RestorePointCollections_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +63,7 @@ public async Task Update_RestorePointCollectionUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_RestorePointCollectionUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json // this example is just showing the usage of "RestorePointCollections_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Update_RestorePointCollectionUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_RestorePointCollectionDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json // this example is just showing the usage of "RestorePointCollections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Delete_RestorePointCollectionDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_RestorePointCollectionDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json // this example is just showing the usage of "RestorePointCollections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task Delete_RestorePointCollectionDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -180,7 +180,7 @@ public async Task Get_GetARestorePointCollectionButNotTheRestorePointsContainedI [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json // this example is just showing the usage of "RestorePointCollections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -211,7 +211,7 @@ public async Task Get_GetARestorePointCollectionIncludingTheRestorePointsContain [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetRestorePointGroups_GetsTheListOfRestorePointCollectionsInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json // this example is just showing the usage of "RestorePointCollections_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointResource.cs index 80a253862449..35ca6bb17350 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_RestorePointResource.cs @@ -20,7 +20,7 @@ public partial class Sample_RestorePointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CopyARestorePointToADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json // this example is just showing the usage of "RestorePoints_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task Update_CopyARestorePointToADifferentRegion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Create.json // this example is just showing the usage of "RestorePoints_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -100,7 +100,7 @@ public async Task Update_CreateARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_RestorePointDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json // this example is just showing the usage of "RestorePoints_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task Delete_RestorePointDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_RestorePointDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json // this example is just showing the usage of "RestorePoints_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task Delete_RestorePointDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARestorePoint() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -188,7 +188,7 @@ public async Task Get_GetARestorePoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRestorePointWithInstanceView() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json // this example is just showing the usage of "RestorePoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotCollection.cs index 5a1a1912945a..f6f3e9560e08 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_SnapshotCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +64,7 @@ public async Task CreateOrUpdate_CreateASnapshotByImportingAnUnmanagedBlobFromAD [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,7 +106,7 @@ public async Task CreateOrUpdate_CreateASnapshotByImportingAnUnmanagedBlobFromTh [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotFromAnElasticSanVolumeSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -148,7 +148,7 @@ public async Task CreateOrUpdate_CreateASnapshotFromAnElasticSanVolumeSnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -191,7 +191,7 @@ public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -233,7 +233,7 @@ public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json // this example is just showing the usage of "Snapshots_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -275,7 +275,7 @@ public async Task CreateOrUpdate_CreateASnapshotFromAnExistingSnapshotInTheSameO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Get.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -309,7 +309,7 @@ public async Task Get_GetInformationAboutASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Get.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -339,7 +339,7 @@ public async Task Exists_GetInformationAboutASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Get.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -381,7 +381,7 @@ public async Task GetIfExists_GetInformationAboutASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAnIncrementalSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -415,7 +415,7 @@ public async Task Get_GetInformationAboutAnIncrementalSnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetInformationAboutAnIncrementalSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -445,7 +445,7 @@ public async Task Exists_GetInformationAboutAnIncrementalSnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetInformationAboutAnIncrementalSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -487,7 +487,7 @@ public async Task GetIfExists_GetInformationAboutAnIncrementalSnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAllSnapshotsInAResourceGroup() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json // this example is just showing the usage of "Snapshots_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotResource.cs index 55b3ea8ce23e..a1f5cf3c675c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SnapshotResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SnapshotResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateASnapshotWithAcceleratedNetworking() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json // this example is just showing the usage of "Snapshots_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task Update_UpdateASnapshotWithAcceleratedNetworking() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Update.json // this example is just showing the usage of "Snapshots_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -107,7 +107,7 @@ public async Task Update_UpdateASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Get.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task Get_GetInformationAboutASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetInformationAboutAnIncrementalSnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json // this example is just showing the usage of "Snapshots_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -169,7 +169,7 @@ public async Task Get_GetInformationAboutAnIncrementalSnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Delete.json // this example is just showing the usage of "Snapshots_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,7 +196,7 @@ public async Task Delete_DeleteASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSnapshots_ListAllSnapshotsInASubscription() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_ListBySubscription.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_ListBySubscription.json // this example is just showing the usage of "Snapshots_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -228,7 +228,7 @@ public async Task GetSnapshots_ListAllSnapshotsInASubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GrantAccess_GetASasOnASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json // this example is just showing the usage of "Snapshots_GrantAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -260,7 +260,7 @@ public async Task GrantAccess_GetASasOnASnapshot() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RevokeAccess_RevokeAccessToASnapshot() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2023-10-02/examples/snapshotExamples/Snapshot_EndGetAccess.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_EndGetAccess.json // this example is just showing the usage of "Snapshots_RevokeAccess" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyCollection.cs index 3cdfe79a85be..656fb087eb44 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_SshPublicKeyCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_SshPublicKeyListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetAll_SshPublicKeyListByResourceGroupMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_SshPublicKeyListByResourceGroupMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task GetAll_SshPublicKeyListByResourceGroupMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateANewSSHPublicKeyResource() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Create.json // this example is just showing the usage of "SshPublicKeys_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task CreateOrUpdate_CreateANewSSHPublicKeyResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnSshPublicKey() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json // this example is just showing the usage of "SshPublicKeys_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Get_GetAnSshPublicKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAnSshPublicKey() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json // this example is just showing the usage of "SshPublicKeys_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -195,7 +195,7 @@ public async Task Exists_GetAnSshPublicKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAnSshPublicKey() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json // this example is just showing the usage of "SshPublicKeys_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyResource.cs index 06c213099020..bf39ea29ce94 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SshPublicKeyResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SshPublicKeyResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSshPublicKeys_SshPublicKeyListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task GetSshPublicKeys_SshPublicKeyListBySubscriptionMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSshPublicKeys_SshPublicKeyListBySubscriptionMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -85,7 +85,7 @@ public async Task GetSshPublicKeys_SshPublicKeyListBySubscriptionMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_SshPublicKeyUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +124,7 @@ public async Task Update_SshPublicKeyUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_SshPublicKeyUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -156,7 +156,7 @@ public async Task Update_SshPublicKeyUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_SshPublicKeyDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -183,7 +183,7 @@ public async Task Delete_SshPublicKeyDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_SshPublicKeyDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json // this example is just showing the usage of "SshPublicKeys_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task Delete_SshPublicKeyDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnSshPublicKey() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Get.json // this example is just showing the usage of "SshPublicKeys_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -241,7 +241,7 @@ public async Task Get_GetAnSshPublicKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GenerateKeyPair_GenerateAnSSHKeyPairWithEd25519Encryption() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json // this example is just showing the usage of "SshPublicKeys_GenerateKeyPair" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -260,7 +260,7 @@ public async Task GenerateKeyPair_GenerateAnSSHKeyPairWithEd25519Encryption() // invoke the operation SshGenerateKeyPairInputContent content = new SshGenerateKeyPairInputContent() { - EncryptionType = SshEncryptionType.RSA, + EncryptionType = SshEncryptionType.Ed25519, }; SshPublicKeyGenerateKeyPairResult result = await sshPublicKey.GenerateKeyPairAsync(content: content); @@ -272,7 +272,7 @@ public async Task GenerateKeyPair_GenerateAnSSHKeyPairWithEd25519Encryption() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GenerateKeyPair_GenerateAnSSHKeyPairWithRSAEncryption() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json // this example is just showing the usage of "SshPublicKeys_GenerateKeyPair" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -303,7 +303,7 @@ public async Task GenerateKeyPair_GenerateAnSSHKeyPairWithRSAEncryption() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GenerateKeyPair_GenerateAnSSHKeyPair() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json // this example is just showing the usage of "SshPublicKeys_GenerateKeyPair" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 0bcdb3d0eafc..a1d33d2dd501 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsages_UsageListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json // this example is just showing the usage of "Usage_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task GetUsages_UsageListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetUsages_UsageListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json // this example is just showing the usage of "Usage_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +79,7 @@ public async Task GetUsages_UsageListMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineSizes_VirtualMachineSizesListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineSizes_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task GetVirtualMachineSizes_VirtualMachineSizesListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineSizes_VirtualMachineSizesListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineSizes_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +137,7 @@ public async Task GetVirtualMachineSizes_VirtualMachineSizesListMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImage_VirtualMachineImageGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +167,7 @@ public async Task GetVirtualMachineImage_VirtualMachineImageGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImage_VirtualMachineImageGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -197,7 +197,7 @@ public async Task GetVirtualMachineImage_VirtualMachineImageGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImages_VirtualMachineImageListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -226,7 +226,7 @@ public async Task GetVirtualMachineImages_VirtualMachineImageListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImages_VirtualMachineImageListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -255,7 +255,7 @@ public async Task GetVirtualMachineImages_VirtualMachineImageListMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageOffers_VirtualMachineImageListOffersMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListOffers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -285,7 +285,7 @@ public async Task GetVirtualMachineImageOffers_VirtualMachineImageListOffersMaxi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageOffers_VirtualMachineImageListOffersMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListOffers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -315,7 +315,7 @@ public async Task GetVirtualMachineImageOffers_VirtualMachineImageListOffersMini [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagePublishers_VirtualMachineImageListPublishersMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListPublishers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -344,7 +344,7 @@ public async Task GetVirtualMachineImagePublishers_VirtualMachineImageListPublis [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagePublishers_VirtualMachineImageListPublishersMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListPublishers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -373,7 +373,7 @@ public async Task GetVirtualMachineImagePublishers_VirtualMachineImageListPublis [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageSkus_VirtualMachineImageListSkusMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -404,7 +404,7 @@ public async Task GetVirtualMachineImageSkus_VirtualMachineImageListSkusMaximumS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageSkus_VirtualMachineImageListSkusMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -435,7 +435,7 @@ public async Task GetVirtualMachineImageSkus_VirtualMachineImageListSkusMinimumS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesByEdgeZone_VirtualMachineImagesEdgeZoneListByEdgeZoneMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListByEdgeZone" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -465,7 +465,7 @@ public async Task GetVirtualMachineImagesByEdgeZone_VirtualMachineImagesEdgeZone [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesByEdgeZone_VirtualMachineImagesEdgeZoneListByEdgeZoneMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImages_ListByEdgeZone" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -495,7 +495,7 @@ public async Task GetVirtualMachineImagesByEdgeZone_VirtualMachineImagesEdgeZone [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesEdgeZone_VirtualMachineImagesEdgeZoneGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -521,7 +521,7 @@ public async Task GetVirtualMachineImagesEdgeZone_VirtualMachineImagesEdgeZoneGe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesEdgeZone_VirtualMachineImagesEdgeZoneGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -547,7 +547,7 @@ public async Task GetVirtualMachineImagesEdgeZone_VirtualMachineImagesEdgeZoneGe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -576,7 +576,7 @@ public async Task GetVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneL [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -605,7 +605,7 @@ public async Task GetVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneL [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOffersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListOffersMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListOffers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -636,7 +636,7 @@ public async Task GetOffersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdg [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOffersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListOffersMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListOffers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -667,7 +667,7 @@ public async Task GetOffersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdg [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPublishersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListPublishersMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListPublishers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -697,7 +697,7 @@ public async Task GetPublishersVirtualMachineImagesEdgeZones_VirtualMachineImage [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPublishersVirtualMachineImagesEdgeZones_VirtualMachineImagesEdgeZoneListPublishersMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListPublishers" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -727,7 +727,7 @@ public async Task GetPublishersVirtualMachineImagesEdgeZones_VirtualMachineImage [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageEdgeZoneSkus_VirtualMachineImagesEdgeZoneListSkusMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -759,7 +759,7 @@ public async Task GetVirtualMachineImageEdgeZoneSkus_VirtualMachineImagesEdgeZon [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineImageEdgeZoneSkus_VirtualMachineImagesEdgeZoneListSkusMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineImagesEdgeZone_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -791,7 +791,7 @@ public async Task GetVirtualMachineImageEdgeZoneSkus_VirtualMachineImagesEdgeZon [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ExportLogAnalyticsRequestRateByInterval_ExportLogsWhichContainAllApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriodBrokenDownByIntervals() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json // this example is just showing the usage of "LogAnalytics_ExportRequestRateByInterval" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -822,7 +822,7 @@ public async Task ExportLogAnalyticsRequestRateByInterval_ExportLogsWhichContain [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ExportLogAnalyticsThrottledRequests_ExportLogsWhichContainAllThrottledApiRequestsMadeToComputeResourceProviderWithinTheGivenTimePeriod() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json // this example is just showing the usage of "LogAnalytics_ExportThrottledRequests" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineCollection.cs index 815cd4f384f4..352de45c2930 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_VirtualMachineCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingAssessmentModeOfImageDefault() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingAssessmentModeOf [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,7 +200,7 @@ public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingPatchModeOfAutom [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingPatchModeOfImageDefault() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -286,7 +286,7 @@ public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingPatchModeOfImage [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -373,7 +373,7 @@ public async Task CreateOrUpdate_CreateALinuxVmWithAPatchSettingsPatchModeAndAss [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMFromACommunityGalleryImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -448,7 +448,7 @@ public async Task CreateOrUpdate_CreateAVMFromACommunityGalleryImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMFromASharedGalleryImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -523,7 +523,7 @@ public async Task CreateOrUpdate_CreateAVMFromASharedGalleryImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -617,7 +617,7 @@ public async Task CreateOrUpdate_CreateAVMWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithHibernationEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -704,7 +704,7 @@ public async Task CreateOrUpdate_CreateAVMWithHibernationEnabled() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithProxyAgentSettingsOfEnabledAndMode() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -790,7 +790,7 @@ public async Task CreateOrUpdate_CreateAVMWithProxyAgentSettingsOfEnabledAndMode [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithUefiSettingsOfSecureBootAndVTPM() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -877,7 +877,7 @@ public async Task CreateOrUpdate_CreateAVMWithUefiSettingsOfSecureBootAndVTPM() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -961,7 +961,7 @@ public async Task CreateOrUpdate_CreateAVMWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1050,7 +1050,7 @@ public async Task CreateOrUpdate_CreateAVMWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithEncryptionIdentity() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1139,7 +1139,7 @@ public async Task CreateOrUpdate_CreateAVMWithEncryptionIdentity() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithNetworkInterfaceConfiguration() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1235,7 +1235,7 @@ public async Task CreateOrUpdate_CreateAVMWithNetworkInterfaceConfiguration() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1335,7 +1335,7 @@ public async Task CreateOrUpdate_CreateAVMWithNetworkInterfaceConfigurationWithP [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithCustomerManagedKeys() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1427,7 +1427,7 @@ public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithCust [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithNonPersistedTPMSecurityEncryptionType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1518,7 +1518,7 @@ public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithNonP [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithPlatformManagedKeys() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1609,7 +1609,7 @@ public async Task CreateOrUpdate_CreateAVMWithSecurityTypeConfidentialVMWithPlat [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1696,7 +1696,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingAssessmentMode [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOS() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1783,7 +1783,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAut [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1876,7 +1876,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAut [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1964,7 +1964,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfAut [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfManual() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2051,7 +2051,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithAPatchSettingPatchModeOfMan [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2139,7 +2139,7 @@ public async Task CreateOrUpdate_CreateAWindowsVmWithPatchSettingsPatchModeAndAs [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateACustomImageVmFromAnUnmanagedGeneralizedOsImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2209,7 +2209,7 @@ public async Task CreateOrUpdate_CreateACustomImageVmFromAnUnmanagedGeneralizedO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAPlatformImageVmWithUnmanagedOsAndDataDisks() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2296,7 +2296,7 @@ public async Task CreateOrUpdate_CreateAPlatformImageVmWithUnmanagedOsAndDataDis [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmFromACustomImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2371,7 +2371,7 @@ public async Task CreateOrUpdate_CreateAVmFromACustomImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmFromAGeneralizedSharedImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2446,7 +2446,7 @@ public async Task CreateOrUpdate_CreateAVmFromAGeneralizedSharedImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmFromASpecializedSharedImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2515,7 +2515,7 @@ public async Task CreateOrUpdate_CreateAVmFromASpecializedSharedImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2595,7 +2595,7 @@ public async Task CreateOrUpdate_CreateAVmInAVirtualMachineScaleSetWithCustomerA [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmInAnAvailabilitySet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2674,7 +2674,7 @@ public async Task CreateOrUpdate_CreateAVmInAnAvailabilitySet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithApplicationProfile() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2763,7 +2763,7 @@ public async Task CreateOrUpdate_CreateAVmWithApplicationProfile() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2862,7 +2862,7 @@ public async Task CreateOrUpdate_CreateAVmWithDiskEncryptionSetResourceIdInTheOs [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithHostEncryptionUsingEncryptionAtHostProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2950,7 +2950,7 @@ public async Task CreateOrUpdate_CreateAVmWithHostEncryptionUsingEncryptionAtHos [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithScheduledEventsProfile() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3055,7 +3055,7 @@ public async Task CreateOrUpdate_CreateAVmWithScheduledEventsProfile() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithAMarketplaceImagePlan() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3139,7 +3139,7 @@ public async Task CreateOrUpdate_CreateAVmWithAMarketplaceImagePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithAnExtensionsTimeBudget() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3223,7 +3223,7 @@ public async Task CreateOrUpdate_CreateAVmWithAnExtensionsTimeBudget() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithBootDiagnostics() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3306,7 +3306,7 @@ public async Task CreateOrUpdate_CreateAVmWithBootDiagnostics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithDataDisksUsingCopyAndRestoreOptions() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3400,7 +3400,7 @@ public async Task CreateOrUpdate_CreateAVmWithDataDisksUsingCopyAndRestoreOption [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithEmptyDataDisks() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3488,7 +3488,7 @@ public async Task CreateOrUpdate_CreateAVmWithEmptyDataDisks() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3577,7 +3577,7 @@ public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInCache [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3666,7 +3666,7 @@ public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInNvmeD [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3755,7 +3755,7 @@ public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDiskProvisioningInResou [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3843,7 +3843,7 @@ public async Task CreateOrUpdate_CreateAVmWithEphemeralOsDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithManagedBootDiagnostics() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3925,7 +3925,7 @@ public async Task CreateOrUpdate_CreateAVmWithManagedBootDiagnostics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithPasswordAuthentication() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4003,7 +4003,7 @@ public async Task CreateOrUpdate_CreateAVmWithPasswordAuthentication() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithPremiumStorage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4081,7 +4081,7 @@ public async Task CreateOrUpdate_CreateAVmWithPremiumStorage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVmWithSshAuthentication() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4170,7 +4170,7 @@ public async Task CreateOrUpdate_CreateAVmWithSshAuthentication() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAVMWithCapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json // this example is just showing the usage of "VirtualMachines_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4255,7 +4255,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAVMWithCapacityReservation() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4290,7 +4290,7 @@ public async Task Get_GetAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4321,7 +4321,7 @@ public async Task Exists_GetAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4364,7 +4364,7 @@ public async Task GetIfExists_GetAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4398,7 +4398,7 @@ public async Task Get_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutoma [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4428,7 +4428,7 @@ public async Task Exists_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAut [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4470,7 +4470,7 @@ public async Task GetIfExists_GetAVirtualMachinePlacedOnADedicatedHostGroupThrou [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineWithDiskControllerTypeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4505,7 +4505,7 @@ public async Task Get_GetAVirtualMachineWithDiskControllerTypeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachineWithDiskControllerTypeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4536,7 +4536,7 @@ public async Task Exists_GetAVirtualMachineWithDiskControllerTypeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachineWithDiskControllerTypeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4579,7 +4579,7 @@ public async Task GetIfExists_GetAVirtualMachineWithDiskControllerTypeProperties [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4613,7 +4613,7 @@ public async Task Get_GetAVirtualMachineWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachineWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4643,7 +4643,7 @@ public async Task Exists_GetAVirtualMachineWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachineWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4685,7 +4685,7 @@ public async Task GetIfExists_GetAVirtualMachineWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4722,7 +4722,7 @@ public async Task GetAll_VirtualMachineListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionCollection.cs index 23da9fe3b7c5..64266ea996ee 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineExtensionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineExtensionCreateOrUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -105,7 +105,7 @@ public async Task CreateOrUpdate_VirtualMachineExtensionCreateOrUpdateMaximumSet [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineExtensionCreateOrUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,7 +142,7 @@ public async Task CreateOrUpdate_VirtualMachineExtensionCreateOrUpdateMinimumSet [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +178,7 @@ public async Task Get_VirtualMachineExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +210,7 @@ public async Task Exists_VirtualMachineExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -254,7 +254,7 @@ public async Task GetIfExists_VirtualMachineExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -289,7 +289,7 @@ public async Task Get_VirtualMachineExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -320,7 +320,7 @@ public async Task Exists_VirtualMachineExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -363,7 +363,7 @@ public async Task GetIfExists_VirtualMachineExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -401,7 +401,7 @@ public async Task GetAll_VirtualMachineExtensionListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageCollection.cs index 14ee270ff7da..36c427bbf98e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineExtensionImageCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionImageGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task Get_VirtualMachineExtensionImageGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineExtensionImageGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +88,7 @@ public async Task Exists_VirtualMachineExtensionImageGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineExtensionImageGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task GetIfExists_VirtualMachineExtensionImageGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionImageGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +168,7 @@ public async Task Get_VirtualMachineExtensionImageGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineExtensionImageGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,7 +200,7 @@ public async Task Exists_VirtualMachineExtensionImageGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineExtensionImageGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -244,7 +244,7 @@ public async Task GetIfExists_VirtualMachineExtensionImageGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionImageListTypesMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_ListTypes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -281,7 +281,7 @@ public async Task GetAll_VirtualMachineExtensionImageListTypesMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionImageListTypesMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_ListTypes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -318,7 +318,7 @@ public async Task GetAll_VirtualMachineExtensionImageListTypesMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionImageListVersionsMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_ListVersions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -359,7 +359,7 @@ public async Task GetAll_VirtualMachineExtensionImageListVersionsMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineExtensionImageListVersionsMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_ListVersions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageResource.cs index 15147ea7ee2d..d06b1e238510 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionImageResource.cs @@ -19,7 +19,7 @@ public partial class Sample_VirtualMachineExtensionImageResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionImageGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_VirtualMachineExtensionImageGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionImageGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensionImages_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionResource.cs index 471feb982a21..0e6fb23ce46a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineExtensionResource.cs @@ -22,7 +22,7 @@ public partial class Sample_VirtualMachineExtensionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Update.json // this example is just showing the usage of "VirtualMachineExtensions_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -71,7 +71,7 @@ public async Task Update_UpdateVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VirtualMachineExtensionDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Delete_VirtualMachineExtensionDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VirtualMachineExtensionDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +127,7 @@ public async Task Delete_VirtualMachineExtensionDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -160,7 +160,7 @@ public async Task Get_VirtualMachineExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineResource.cs index ea7529766ce3..d0d219cd78b3 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineResource.cs @@ -22,7 +22,7 @@ public partial class Sample_VirtualMachineResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachinesByLocation_ListsAllTheVirtualMachinesUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ListBySubscription_ByLocation.json // this example is just showing the usage of "VirtualMachines_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task GetVirtualMachinesByLocation_ListsAllTheVirtualMachinesUnderTh [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Capture_VirtualMachineCaptureMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Capture" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task Capture_VirtualMachineCaptureMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Capture_VirtualMachineCaptureMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Capture" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Capture_VirtualMachineCaptureMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAVMByDetachingDataDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json // this example is just showing the usage of "VirtualMachines_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,7 +200,7 @@ public async Task Update_UpdateAVMByDetachingDataDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAVMByForceDetachingDataDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json // this example is just showing the usage of "VirtualMachines_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -288,7 +288,7 @@ public async Task Update_UpdateAVMByForceDetachingDataDisk() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ForceDeleteAVM() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json // this example is just showing the usage of "VirtualMachines_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -316,7 +316,7 @@ public async Task Delete_ForceDeleteAVM() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -348,7 +348,7 @@ public async Task Get_GetAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -379,7 +379,7 @@ public async Task Get_GetAVirtualMachinePlacedOnADedicatedHostGroupThroughAutoma [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineWithDiskControllerTypeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -411,7 +411,7 @@ public async Task Get_GetAVirtualMachineWithDiskControllerTypeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachines_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -442,7 +442,7 @@ public async Task Get_GetAVirtualMachineWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InstanceView_GetVirtualMachineInstanceView() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json // this example is just showing the usage of "VirtualMachines_InstanceView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -469,7 +469,7 @@ public async Task InstanceView_GetVirtualMachineInstanceView() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InstanceView_GetInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachines_InstanceView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -496,7 +496,7 @@ public async Task InstanceView_GetInstanceViewOfAVirtualMachinePlacedOnADedicate [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ConvertToManagedDisks_VirtualMachineConvertToManagedDisksMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_ConvertToManagedDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -523,7 +523,7 @@ public async Task ConvertToManagedDisks_VirtualMachineConvertToManagedDisksMaxim [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ConvertToManagedDisks_VirtualMachineConvertToManagedDisksMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_ConvertToManagedDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -550,7 +550,7 @@ public async Task ConvertToManagedDisks_VirtualMachineConvertToManagedDisksMinim [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineDeallocateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -578,7 +578,7 @@ public async Task Deallocate_VirtualMachineDeallocateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineDeallocateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -605,7 +605,7 @@ public async Task Deallocate_VirtualMachineDeallocateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Generalize_GeneralizeAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Generalize.json // this example is just showing the usage of "VirtualMachines_Generalize" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -632,7 +632,7 @@ public async Task Generalize_GeneralizeAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachines_VirtualMachineListAllMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -666,7 +666,7 @@ public async Task GetVirtualMachines_VirtualMachineListAllMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachines_VirtualMachineListAllMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -698,7 +698,7 @@ public async Task GetVirtualMachines_VirtualMachineListAllMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAvailableSizes_ListsAllAvailableVirtualMachineSizesToWhichTheSpecifiedVirtualMachineCanBeResized() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ListAvailableVmSizes.json // this example is just showing the usage of "VirtualMachines_ListAvailableSizes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -728,7 +728,7 @@ public async Task GetAvailableSizes_ListsAllAvailableVirtualMachineSizesToWhichT [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachinePowerOffMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -756,7 +756,7 @@ public async Task PowerOff_VirtualMachinePowerOffMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachinePowerOffMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -783,7 +783,7 @@ public async Task PowerOff_VirtualMachinePowerOffMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reapply_ReapplyTheStateOfAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Reapply.json // this example is just showing the usage of "VirtualMachines_Reapply" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -810,7 +810,7 @@ public async Task Reapply_ReapplyTheStateOfAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineRestartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -837,7 +837,7 @@ public async Task Restart_VirtualMachineRestartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineRestartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -864,7 +864,7 @@ public async Task Restart_VirtualMachineRestartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineStartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -891,7 +891,7 @@ public async Task PowerOn_VirtualMachineStartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineStartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -918,7 +918,7 @@ public async Task PowerOn_VirtualMachineStartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineRedeployMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -945,7 +945,7 @@ public async Task Redeploy_VirtualMachineRedeployMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineRedeployMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -972,7 +972,7 @@ public async Task Redeploy_VirtualMachineRedeployMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_ReimageANonEphemeralVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json // this example is just showing the usage of "VirtualMachines_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1009,7 +1009,7 @@ public async Task Reimage_ReimageANonEphemeralVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_ReimageAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json // this example is just showing the usage of "VirtualMachines_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1040,7 +1040,7 @@ public async Task Reimage_ReimageAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveBootDiagnosticsData_RetrieveBootDiagnosticsDataOfAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json // this example is just showing the usage of "VirtualMachines_RetrieveBootDiagnosticsData" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1068,7 +1068,7 @@ public async Task RetrieveBootDiagnosticsData_RetrieveBootDiagnosticsDataOfAVirt [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachinePerformMaintenanceMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1095,7 +1095,7 @@ public async Task PerformMaintenance_VirtualMachinePerformMaintenanceMaximumSetG [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachinePerformMaintenanceMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1122,7 +1122,7 @@ public async Task PerformMaintenance_VirtualMachinePerformMaintenanceMinimumSetG [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SimulateEviction_SimulateEvictionAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json // this example is just showing the usage of "VirtualMachines_SimulateEviction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1149,7 +1149,7 @@ public async Task SimulateEviction_SimulateEvictionAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AssessPatches_AssessPatchStateOfAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json // this example is just showing the usage of "VirtualMachines_AssessPatches" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1177,7 +1177,7 @@ public async Task AssessPatches_AssessPatchStateOfAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InstallPatches_InstallPatchStateOfAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json // this example is just showing the usage of "VirtualMachines_InstallPatches" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1217,7 +1217,7 @@ public async Task InstallPatches_InstallPatchStateOfAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AttachDetachDataDisks_VirtualMachineAttachDetachDataDisksMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachines_AttachDetachDataDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1276,7 +1276,7 @@ public async Task AttachDetachDataDisks_VirtualMachineAttachDetachDataDisksMaxim [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AttachDetachDataDisks_VirtualMachineAttachDetachDataDisksMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachines_AttachDetachDataDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1315,7 +1315,7 @@ public async Task AttachDetachDataDisks_VirtualMachineAttachDetachDataDisksMinim [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RunCommand_VirtualMachineRunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand.json // this example is just showing the usage of "VirtualMachines_RunCommand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandCollection.cs index 13dd9df4c7a7..bbde704b4e6f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineRunCommandCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json // this example is just showing the usage of "VirtualMachineRunCommands_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -78,7 +78,7 @@ public async Task CreateOrUpdate_CreateOrUpdateARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json // this example is just showing the usage of "VirtualMachineRunCommands_GetByVirtualMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task Get_GetARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json // this example is just showing the usage of "VirtualMachineRunCommands_GetByVirtualMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,7 +144,7 @@ public async Task Exists_GetARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json // this example is just showing the usage of "VirtualMachineRunCommands_GetByVirtualMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -187,7 +187,7 @@ public async Task GetIfExists_GetARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRunCommandsInAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_List.json // this example is just showing the usage of "VirtualMachineRunCommands_ListByVirtualMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandResource.cs index dafa659bcf75..407e0e761969 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineRunCommandResource.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineRunCommandResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineRunCommands_VirtualMachineRunCommandList() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/RunCommand_List.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/RunCommand_List.json // this example is just showing the usage of "VirtualMachineRunCommands_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task GetVirtualMachineRunCommands_VirtualMachineRunCommandList() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineRunCommand_VirtualMachineRunCommandGet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/RunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/RunCommand_Get.json // this example is just showing the usage of "VirtualMachineRunCommands_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -77,7 +77,7 @@ public async Task GetVirtualMachineRunCommand_VirtualMachineRunCommandGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Update.json // this example is just showing the usage of "VirtualMachineRunCommands_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +131,7 @@ public async Task Update_UpdateARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json // this example is just showing the usage of "VirtualMachineRunCommands_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,7 +159,7 @@ public async Task Delete_DeleteARunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetARunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineRunCommand_Get.json // this example is just showing the usage of "VirtualMachineRunCommands_GetByVirtualMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetCollection.cs index 47a1ff24f457..3dde6dd43ad9 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_VirtualMachineScaleSetCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMSSWithAnExtensionThatHasSuppressFailuresEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,7 +139,7 @@ public async Task CreateOrUpdate_CreateAVMSSWithAnExtensionThatHasSuppressFailur [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAVMSSWithAnExtensionWithProtectedSettingsFromKeyVault() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -258,7 +258,7 @@ public async Task CreateOrUpdate_CreateAVMSSWithAnExtensionWithProtectedSettings [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -343,7 +343,7 @@ public async Task CreateOrUpdate_CreateACustomImageScaleSetFromAnUnmanagedGenera [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAPlatformImageScaleSetWithUnmanagedOsDisks() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -438,7 +438,7 @@ public async Task CreateOrUpdate_CreateAPlatformImageScaleSetWithUnmanagedOsDisk [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetFromACustomImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -529,7 +529,7 @@ public async Task CreateOrUpdate_CreateAScaleSetFromACustomImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetFromAGeneralizedSharedImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -620,7 +620,7 @@ public async Task CreateOrUpdate_CreateAScaleSetFromAGeneralizedSharedImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetFromASpecializedSharedImage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -705,7 +705,7 @@ public async Task CreateOrUpdate_CreateAScaleSetFromASpecializedSharedImage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -813,7 +813,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWhereNicConfigHasDisableTcpState [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithApplicationProfile() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -918,7 +918,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithApplicationProfile() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1028,7 +1028,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1133,7 +1133,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithDiskEncryptionSetResourceInO [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithFpgaNetworkInterfaces() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1239,7 +1239,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithFpgaNetworkInterfaces() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1343,7 +1343,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithHostEncryptionUsingEncryptio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1461,7 +1461,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithNetworkInterfacesWithPublicI [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithOSImageScheduledEventsEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1563,7 +1563,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithOSImageScheduledEventsEnable [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithProxyAgentSettingsOfEnabledAndMode() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1665,7 +1665,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithProxyAgentSettingsOfEnabledA [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithResilientVMCreationEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1763,7 +1763,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithResilientVMCreationEnabled() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithResilientVMDeletionEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1861,7 +1861,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithResilientVMDeletionEnabled() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithSecurityPostureReference() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1938,10 +1938,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSecurityPostureReference() } }, }, - SecurityPostureReference = new ComputeSecurityPostureReference() - { - Id = new ResourceIdentifier("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), - }, + SecurityPostureReference = new ComputeSecurityPostureReference(new ResourceIdentifier("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest")), }, Overprovision = true, }; @@ -1960,7 +1957,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSecurityPostureReference() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithSecurityTypeAsConfidentialVM() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2067,7 +2064,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSecurityTypeAsConfidentialVM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithSecurityTypeAsConfidentialVMAndNonPersistedTPMSecurityEncryptionType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2174,7 +2171,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSecurityTypeAsConfidentialVM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithServiceArtifactReference() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2270,7 +2267,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithServiceArtifactReference() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithUefiSettingsOfSecureBootAndVTPM() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2373,7 +2370,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithUefiSettingsOfSecureBootAndV [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithAMarketplaceImagePlan() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2473,7 +2470,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithAMarketplaceImagePlan() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithAnAzureApplicationGateway() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2574,7 +2571,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithAnAzureApplicationGateway() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithAnAzureLoadBalancer() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2686,7 +2683,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithAnAzureLoadBalancer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithAutomaticRepairsEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2794,7 +2791,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithAutomaticRepairsEnabled() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithBootDiagnostics() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2893,7 +2890,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithBootDiagnostics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithEmptyDataDisksOnEachVm() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -2998,7 +2995,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithEmptyDataDisksOnEachVm() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3103,7 +3100,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDiskProvisioningI [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDisksUsingPlacementProperty() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3208,7 +3205,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDisksUsingPlaceme [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDisks() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3312,7 +3309,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithEphemeralOsDisks() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithExtensionTimeBudget() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3428,7 +3425,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithExtensionTimeBudget() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithManagedBootDiagnostics() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3526,7 +3523,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithManagedBootDiagnostics() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithPasswordAuthentication() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3620,7 +3617,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithPasswordAuthentication() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithPremiumStorage() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3714,7 +3711,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithPremiumStorage() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithPriorityMixPolicy() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3813,7 +3810,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithPriorityMixPolicy() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithScaleInPolicy() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -3910,12 +3907,127 @@ public async Task CreateOrUpdate_CreateAScaleSetWithScaleInPolicy() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Create a scale set with sku profile + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAScaleSetWithSkuProfile() + { + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile.json + // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "{subscription-id}"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VirtualMachineScaleSetResource + VirtualMachineScaleSetCollection collection = resourceGroupResource.GetVirtualMachineScaleSets(); + + // invoke the operation + string virtualMachineScaleSetName = "{vmss-name}"; + VirtualMachineScaleSetData data = new VirtualMachineScaleSetData(new AzureLocation("westus")) + { + Sku = new ComputeSku() + { + Name = "Mix", + Capacity = 10, + }, + VirtualMachineProfile = new VirtualMachineScaleSetVmProfile() + { + OSProfile = new VirtualMachineScaleSetOSProfile() + { + ComputerNamePrefix = "{vmss-name}", + AdminUsername = "{your-username}", + AdminPassword = "{your-password}", + }, + StorageProfile = new VirtualMachineScaleSetStorageProfile() + { + ImageReference = new ImageReference() + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-Datacenter", + Version = "latest", + }, + OSDisk = new VirtualMachineScaleSetOSDisk(DiskCreateOptionType.FromImage) + { + Caching = CachingType.ReadWrite, + ManagedDisk = new VirtualMachineScaleSetManagedDisk() + { + StorageAccountType = StorageAccountType.StandardLrs, + }, + }, + }, + NetworkProfile = new VirtualMachineScaleSetNetworkProfile() + { + NetworkInterfaceConfigurations = +{ +new VirtualMachineScaleSetNetworkConfiguration("{vmss-name}") +{ +Primary = true, +IPConfigurations = +{ +new VirtualMachineScaleSetIPConfiguration("{vmss-name}") +{ +SubnetId = new ResourceIdentifier("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), +} +}, +EnableIPForwarding = true, +} +}, + }, + Priority = VirtualMachinePriorityType.Spot, + EvictionPolicy = VirtualMachineEvictionPolicyType.Deallocate, + BillingMaxPrice = -1, + }, + SinglePlacementGroup = false, + OrchestrationMode = OrchestrationMode.Flexible, + PriorityMixPolicy = new VirtualMachineScaleSetPriorityMixPolicy() + { + BaseRegularPriorityCount = 4, + RegularPriorityPercentageAboveBase = 50, + }, + SkuProfile = new ComputeSkuProfile() + { + VmSizes = +{ +new ComputeSkuProfileVmSize() +{ +Name = "Standard_D8s_v5", +},new ComputeSkuProfileVmSize() +{ +Name = "Standard_E16s_v5", +},new ComputeSkuProfileVmSize() +{ +Name = "Standard_D2s_v5", +} +}, + AllocationStrategy = ComputeAllocationStrategy.CapacityOptimized, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, virtualMachineScaleSetName, data); + VirtualMachineScaleSetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + VirtualMachineScaleSetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Create a scale set with spot restore policy [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithSpotRestorePolicy() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4017,7 +4129,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSpotRestorePolicy() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithSshAuthentication() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4122,7 +4234,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithSshAuthentication() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithTerminateScheduledEventsEnabled() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4224,7 +4336,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithTerminateScheduledEventsEnab [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4319,7 +4431,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithVirtualMachinesInDifferentZones() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4428,7 +4540,7 @@ public async Task CreateOrUpdate_CreateAScaleSetWithVirtualMachinesInDifferentZo [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAScaleSetWithVmSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4523,12 +4635,116 @@ public async Task CreateOrUpdate_CreateAScaleSetWithVmSizeProperties() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Create a scale set with zonalPlatformFaultDomainAlignMode as Aligned + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned() + { + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithZonalPlatformFaultDomainAlignMode.json + // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "{subscription-id}"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this VirtualMachineScaleSetResource + VirtualMachineScaleSetCollection collection = resourceGroupResource.GetVirtualMachineScaleSets(); + + // invoke the operation + string virtualMachineScaleSetName = "{vmss-name}"; + VirtualMachineScaleSetData data = new VirtualMachineScaleSetData(new AzureLocation("westus")) + { + Sku = new ComputeSku() + { + Name = "Standard_D1_v2", + Tier = "Standard", + Capacity = 3, + }, + UpgradePolicy = new VirtualMachineScaleSetUpgradePolicy() + { + Mode = VirtualMachineScaleSetUpgradeMode.Manual, + }, + ScheduledEventsPolicy = new ScheduledEventsPolicy() + { + UserInitiatedRedeploy = new UserInitiatedRedeploy() + { + AutomaticallyApprove = true, + }, + AutomaticallyApprove = true, + Enable = true, + }, + VirtualMachineProfile = new VirtualMachineScaleSetVmProfile() + { + OSProfile = new VirtualMachineScaleSetOSProfile() + { + ComputerNamePrefix = "{vmss-name}", + AdminUsername = "{your-username}", + AdminPassword = "{your-password}", + }, + StorageProfile = new VirtualMachineScaleSetStorageProfile() + { + ImageReference = new ImageReference() + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-Datacenter", + Version = "latest", + }, + OSDisk = new VirtualMachineScaleSetOSDisk(DiskCreateOptionType.FromImage) + { + Caching = CachingType.ReadWrite, + ManagedDisk = new VirtualMachineScaleSetManagedDisk() + { + StorageAccountType = StorageAccountType.StandardLrs, + }, + }, + }, + NetworkProfile = new VirtualMachineScaleSetNetworkProfile() + { + NetworkInterfaceConfigurations = +{ +new VirtualMachineScaleSetNetworkConfiguration("{vmss-name}") +{ +Primary = true, +IPConfigurations = +{ +new VirtualMachineScaleSetIPConfiguration("{vmss-name}") +{ +SubnetId = new ResourceIdentifier("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), +} +}, +EnableIPForwarding = true, +} +}, + }, + }, + Overprovision = true, + ZonalPlatformFaultDomainAlignMode = ZonalPlatformFaultDomainAlignMode.Aligned, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, virtualMachineScaleSetName, data); + VirtualMachineScaleSetResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + VirtualMachineScaleSetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Create or update a scale set with capacity reservation. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAScaleSetWithCapacityReservation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json // this example is just showing the usage of "VirtualMachineScaleSets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4623,7 +4839,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAScaleSetWithCapacityReservation( [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4658,7 +4874,7 @@ public async Task Get_GetVMScaleSetVMWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetVMScaleSetVMWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4689,7 +4905,7 @@ public async Task Exists_GetVMScaleSetVMWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetVMScaleSetVMWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4732,7 +4948,7 @@ public async Task GetIfExists_GetVMScaleSetVMWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4766,7 +4982,7 @@ public async Task Get_GetAVirtualMachineScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachineScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4796,7 +5012,7 @@ public async Task Exists_GetAVirtualMachineScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachineScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4838,7 +5054,7 @@ public async Task GetIfExists_GetAVirtualMachineScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4872,7 +5088,7 @@ public async Task Get_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThrou [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4902,7 +5118,7 @@ public async Task Exists_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupTh [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4944,7 +5160,7 @@ public async Task GetIfExists_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSetWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -4979,7 +5195,7 @@ public async Task Get_GetAVirtualMachineScaleSetWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAVirtualMachineScaleSetWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -5010,7 +5226,7 @@ public async Task Exists_GetAVirtualMachineScaleSetWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAVirtualMachineScaleSetWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -5053,7 +5269,7 @@ public async Task GetIfExists_GetAVirtualMachineScaleSetWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -5089,7 +5305,7 @@ public async Task GetAll_VirtualMachineScaleSetListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionCollection.cs index fd37694c3c01..6db66c5e18fe 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineScaleSetExtensionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -76,7 +76,7 @@ public async Task CreateOrUpdate_VirtualMachineScaleSetExtensionCreateOrUpdateMa [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -113,7 +113,7 @@ public async Task CreateOrUpdate_VirtualMachineScaleSetExtensionCreateOrUpdateMi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task Get_VirtualMachineScaleSetExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineScaleSetExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -181,7 +181,7 @@ public async Task Exists_VirtualMachineScaleSetExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineScaleSetExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -225,7 +225,7 @@ public async Task GetIfExists_VirtualMachineScaleSetExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -260,7 +260,7 @@ public async Task Get_VirtualMachineScaleSetExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VirtualMachineScaleSetExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -291,7 +291,7 @@ public async Task Exists_VirtualMachineScaleSetExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_VirtualMachineScaleSetExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -334,7 +334,7 @@ public async Task GetIfExists_VirtualMachineScaleSetExtensionGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetExtensionListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -371,7 +371,7 @@ public async Task GetAll_VirtualMachineScaleSetExtensionListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetExtensionListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionResource.cs index 9984e9982f82..f4b1bf57b913 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetExtensionResource.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineScaleSetExtensionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetExtensionUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -74,7 +74,7 @@ public async Task Update_VirtualMachineScaleSetExtensionUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetExtensionUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -108,7 +108,7 @@ public async Task Update_VirtualMachineScaleSetExtensionUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VirtualMachineScaleSetExtensionDeleteMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task Delete_VirtualMachineScaleSetExtensionDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VirtualMachineScaleSetExtensionDeleteMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -164,7 +164,7 @@ public async Task Delete_VirtualMachineScaleSetExtensionDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetExtensionGetMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -197,7 +197,7 @@ public async Task Get_VirtualMachineScaleSetExtensionGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetExtensionGetMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetResource.cs index e5388ae7908e..5b2e60026754 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetResource.cs @@ -24,7 +24,7 @@ public partial class Sample_VirtualMachineScaleSetResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineScaleSetsByLocation_ListsAllTheVMScaleSetsUnderTheSpecifiedSubscriptionForTheSpecifiedLocation() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListBySubscription_ByLocation.json // this example is just showing the usage of "VirtualMachineScaleSets_ListByLocation" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetVirtualMachineScaleSetsByLocation_ListsAllTheVMScaleSetsUnd [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,6 +96,10 @@ public async Task Update_VirtualMachineScaleSetUpdateMaximumSetGen() [new ResourceIdentifier("key3951")] = new UserAssignedIdentity(), }, }, + Zones = +{ +"1","2","3" +}, UpgradePolicy = new VirtualMachineScaleSetUpgradePolicy() { Mode = VirtualMachineScaleSetUpgradeMode.Manual, @@ -402,7 +406,7 @@ public async Task Update_VirtualMachineScaleSetUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -435,7 +439,7 @@ public async Task Update_VirtualMachineScaleSetUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ForceDeleteAVMScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json // this example is just showing the usage of "VirtualMachineScaleSets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -463,7 +467,7 @@ public async Task Delete_ForceDeleteAVMScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithDiskControllerType() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -495,7 +499,7 @@ public async Task Get_GetVMScaleSetVMWithDiskControllerType() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -526,7 +530,7 @@ public async Task Get_GetAVirtualMachineScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -557,7 +561,7 @@ public async Task Get_GetAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThrou [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAVirtualMachineScaleSetWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -589,7 +593,7 @@ public async Task Get_GetAVirtualMachineScaleSetWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineScaleSetDeallocateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -624,7 +628,7 @@ public async Task Deallocate_VirtualMachineScaleSetDeallocateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineScaleSetDeallocateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -651,7 +655,7 @@ public async Task Deallocate_VirtualMachineScaleSetDeallocateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task DeleteInstances_VirtualMachineScaleSetDeleteInstancesMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_DeleteInstances" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -683,7 +687,7 @@ public async Task DeleteInstances_VirtualMachineScaleSetDeleteInstancesMaximumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task DeleteInstances_VirtualMachineScaleSetDeleteInstancesMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_DeleteInstances" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -714,7 +718,7 @@ public async Task DeleteInstances_VirtualMachineScaleSetDeleteInstancesMinimumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetInstanceView_VirtualMachineScaleSetGetInstanceViewMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_GetInstanceView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -741,7 +745,7 @@ public async Task GetInstanceView_VirtualMachineScaleSetGetInstanceViewMaximumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetInstanceView_VirtualMachineScaleSetGetInstanceViewMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_GetInstanceView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -768,7 +772,7 @@ public async Task GetInstanceView_VirtualMachineScaleSetGetInstanceViewMinimumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineScaleSets_VirtualMachineScaleSetListAllMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -800,7 +804,7 @@ public async Task GetVirtualMachineScaleSets_VirtualMachineScaleSetListAllMaximu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineScaleSets_VirtualMachineScaleSetListAllMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -832,7 +836,7 @@ public async Task GetVirtualMachineScaleSets_VirtualMachineScaleSetListAllMinimu [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_VirtualMachineScaleSetListSkusMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -862,7 +866,7 @@ public async Task GetSkus_VirtualMachineScaleSetListSkusMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_VirtualMachineScaleSetListSkusMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -892,7 +896,7 @@ public async Task GetSkus_VirtualMachineScaleSetListSkusMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOSUpgradeHistory_VirtualMachineScaleSetGetOSUpgradeHistoryMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_GetOSUpgradeHistory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -922,7 +926,7 @@ public async Task GetOSUpgradeHistory_VirtualMachineScaleSetGetOSUpgradeHistoryM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOSUpgradeHistory_VirtualMachineScaleSetGetOSUpgradeHistoryMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_GetOSUpgradeHistory" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -952,7 +956,7 @@ public async Task GetOSUpgradeHistory_VirtualMachineScaleSetGetOSUpgradeHistoryM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachineScaleSetPowerOffMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -987,7 +991,7 @@ public async Task PowerOff_VirtualMachineScaleSetPowerOffMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachineScaleSetPowerOffMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1014,7 +1018,7 @@ public async Task PowerOff_VirtualMachineScaleSetPowerOffMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineScaleSetRestartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1048,7 +1052,7 @@ public async Task Restart_VirtualMachineScaleSetRestartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineScaleSetRestartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1075,7 +1079,7 @@ public async Task Restart_VirtualMachineScaleSetRestartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineScaleSetStartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1109,7 +1113,7 @@ public async Task PowerOn_VirtualMachineScaleSetStartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineScaleSetStartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1136,7 +1140,7 @@ public async Task PowerOn_VirtualMachineScaleSetStartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reapply_VirtualMachineScaleSetsReapplyMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Reapply" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1163,7 +1167,7 @@ public async Task Reapply_VirtualMachineScaleSetsReapplyMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reapply_VirtualMachineScaleSetsReapplyMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Reapply" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1190,7 +1194,7 @@ public async Task Reapply_VirtualMachineScaleSetsReapplyMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineScaleSetRedeployMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1224,7 +1228,7 @@ public async Task Redeploy_VirtualMachineScaleSetRedeployMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineScaleSetRedeployMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1251,7 +1255,7 @@ public async Task Redeploy_VirtualMachineScaleSetRedeployMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachineScaleSetPerformMaintenanceMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1285,7 +1289,7 @@ public async Task PerformMaintenance_VirtualMachineScaleSetPerformMaintenanceMax [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachineScaleSetPerformMaintenanceMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1312,7 +1316,7 @@ public async Task PerformMaintenance_VirtualMachineScaleSetPerformMaintenanceMin [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateInstances_VirtualMachineScaleSetUpdateInstancesMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_UpdateInstances" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1343,7 +1347,7 @@ public async Task UpdateInstances_VirtualMachineScaleSetUpdateInstancesMaximumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateInstances_VirtualMachineScaleSetUpdateInstancesMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_UpdateInstances" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1374,7 +1378,7 @@ public async Task UpdateInstances_VirtualMachineScaleSetUpdateInstancesMinimumSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_VirtualMachineScaleSetReimageMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1410,7 +1414,7 @@ public async Task Reimage_VirtualMachineScaleSetReimageMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_VirtualMachineScaleSetReimageMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1437,7 +1441,7 @@ public async Task Reimage_VirtualMachineScaleSetReimageMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ReimageAll_VirtualMachineScaleSetReimageAllMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ReimageAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1471,7 +1475,7 @@ public async Task ReimageAll_VirtualMachineScaleSetReimageAllMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ReimageAll_VirtualMachineScaleSetReimageAllMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ReimageAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1498,7 +1502,7 @@ public async Task ReimageAll_VirtualMachineScaleSetReimageAllMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ApproveRollingUpgrade_VirtualMachineScaleSetApproveRollingUpgrade() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json // this example is just showing the usage of "VirtualMachineScaleSets_ApproveRollingUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1532,7 +1536,7 @@ public async Task ApproveRollingUpgrade_VirtualMachineScaleSetApproveRollingUpgr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ForceRecoveryServiceFabricPlatformUpdateDomainWalk_VirtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1560,7 +1564,7 @@ public async Task ForceRecoveryServiceFabricPlatformUpdateDomainWalk_VirtualMach [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ForceRecoveryServiceFabricPlatformUpdateDomainWalk_VirtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1588,7 +1592,7 @@ public async Task ForceRecoveryServiceFabricPlatformUpdateDomainWalk_VirtualMach [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ConvertToSinglePlacementGroup_VirtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ConvertToSinglePlacementGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1619,7 +1623,7 @@ public async Task ConvertToSinglePlacementGroup_VirtualMachineScaleSetConvertToS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ConvertToSinglePlacementGroup_VirtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_ConvertToSinglePlacementGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1647,7 +1651,7 @@ public async Task ConvertToSinglePlacementGroup_VirtualMachineScaleSetConvertToS [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SetOrchestrationServiceState_VirtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_SetOrchestrationServiceState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1675,7 +1679,7 @@ public async Task SetOrchestrationServiceState_VirtualMachineScaleSetSetOrchestr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SetOrchestrationServiceState_VirtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSets_SetOrchestrationServiceState" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1703,7 +1707,7 @@ public async Task SetOrchestrationServiceState_VirtualMachineScaleSetSetOrchestr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CancelVirtualMachineScaleSetRollingUpgrade_VirtualMachineScaleSetRollingUpgradeCancelMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_Cancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1730,7 +1734,7 @@ public async Task CancelVirtualMachineScaleSetRollingUpgrade_VirtualMachineScale [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CancelVirtualMachineScaleSetRollingUpgrade_VirtualMachineScaleSetRollingUpgradeCancelMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_Cancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1757,7 +1761,7 @@ public async Task CancelVirtualMachineScaleSetRollingUpgrade_VirtualMachineScale [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StartOSUpgrade_VirtualMachineScaleSetRollingUpgradeStartOSUpgradeMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1784,7 +1788,7 @@ public async Task StartOSUpgrade_VirtualMachineScaleSetRollingUpgradeStartOSUpgr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StartOSUpgrade_VirtualMachineScaleSetRollingUpgradeStartOSUpgradeMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1811,7 +1815,7 @@ public async Task StartOSUpgrade_VirtualMachineScaleSetRollingUpgradeStartOSUpgr [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task StartExtensionUpgradeVirtualMachineScaleSetRollingUpgrade_StartAnExtensionRollingUpgrade() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_StartExtensionUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetRollingUpgradeResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetRollingUpgradeResource.cs index d0017e268481..96e791efcc8b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetRollingUpgradeResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetRollingUpgradeResource.cs @@ -19,7 +19,7 @@ public partial class Sample_VirtualMachineScaleSetRollingUpgradeResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_GetLatest" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +50,7 @@ public async Task Get_VirtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VirtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetRollingUpgrades_GetLatest" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmCollection.cs index 4e12c58ba421..1a17b4cc2f06 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineScaleSetVmCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineScaleSetVMUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -389,7 +389,7 @@ public async Task CreateOrUpdate_VirtualMachineScaleSetVMUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VirtualMachineScaleSetVMUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -426,7 +426,7 @@ public async Task CreateOrUpdate_VirtualMachineScaleSetVMUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -461,7 +461,7 @@ public async Task Get_GetVMScaleSetVMWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetVMScaleSetVMWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -492,7 +492,7 @@ public async Task Exists_GetVMScaleSetVMWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetVMScaleSetVMWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -535,7 +535,7 @@ public async Task GetIfExists_GetVMScaleSetVMWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -570,7 +570,7 @@ public async Task Get_GetVMScaleSetVMWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetVMScaleSetVMWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -601,7 +601,7 @@ public async Task Exists_GetVMScaleSetVMWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetVMScaleSetVMWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -644,7 +644,7 @@ public async Task GetIfExists_GetVMScaleSetVMWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetVMListMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -684,7 +684,7 @@ public async Task GetAll_VirtualMachineScaleSetVMListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VirtualMachineScaleSetVMListMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionCollection.cs index 794d97412768..ba3c05eb0a57 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineScaleSetVmExtensionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Create.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -104,7 +104,7 @@ public async Task Get_GetVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -136,7 +136,7 @@ public async Task Exists_GetVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -180,7 +180,7 @@ public async Task GetIfExists_GetVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListExtensionsInVmssInstance() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_List.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionResource.cs index 5f2dbacf78be..c135579c54db 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmExtensionResource.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineScaleSetVmExtensionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Update.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task Update_UpdateVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Delete.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +95,7 @@ public async Task Delete_DeleteVirtualMachineScaleSetVMExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVirtualMachineScaleSetVMExtension() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmResource.cs index c8b6c8ef4181..9120da9247cc 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmResource.cs @@ -21,7 +21,7 @@ public partial class Sample_VirtualMachineScaleSetVmResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_VirtualMachineScaleSetVMReimageMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Reimage_VirtualMachineScaleSetVMReimageMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Reimage_VirtualMachineScaleSetVMReimageMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +82,7 @@ public async Task Reimage_VirtualMachineScaleSetVMReimageMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ReimageAll_VirtualMachineScaleSetVMReimageAllMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_ReimageAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,7 +110,7 @@ public async Task ReimageAll_VirtualMachineScaleSetVMReimageAllMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ReimageAll_VirtualMachineScaleSetVMReimageAllMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_ReimageAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -138,7 +138,7 @@ public async Task ReimageAll_VirtualMachineScaleSetVMReimageAllMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ApproveRollingUpgrade_VirtualMachineScaleSetVMApproveRollingUpgrade() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_ApproveRollingUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task ApproveRollingUpgrade_VirtualMachineScaleSetVMApproveRollingUp [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineScaleSetVMDeallocateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -194,7 +194,7 @@ public async Task Deallocate_VirtualMachineScaleSetVMDeallocateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Deallocate_VirtualMachineScaleSetVMDeallocateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -222,7 +222,7 @@ public async Task Deallocate_VirtualMachineScaleSetVMDeallocateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetVMUpdateMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -587,7 +587,7 @@ public async Task Update_VirtualMachineScaleSetVMUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VirtualMachineScaleSetVMUpdateMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -621,7 +621,7 @@ public async Task Update_VirtualMachineScaleSetVMUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ForceDeleteAVirtualMachineFromAVMScaleSet() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -650,7 +650,7 @@ public async Task Delete_ForceDeleteAVirtualMachineFromAVMScaleSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithUserData() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -682,7 +682,7 @@ public async Task Get_GetVMScaleSetVMWithUserData() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVMScaleSetVMWithVMSizeProperties() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -714,7 +714,7 @@ public async Task Get_GetVMScaleSetVMWithVMSizeProperties() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetInstanceView_GetInstanceViewOfAVirtualMachineFromAVMScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_GetInstanceView" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -742,7 +742,7 @@ public async Task GetInstanceView_GetInstanceViewOfAVirtualMachineFromAVMScaleSe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachineScaleSetVMPowerOffMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -771,7 +771,7 @@ public async Task PowerOff_VirtualMachineScaleSetVMPowerOffMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOff_VirtualMachineScaleSetVMPowerOffMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_PowerOff" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -799,7 +799,7 @@ public async Task PowerOff_VirtualMachineScaleSetVMPowerOffMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineScaleSetVMRestartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -827,7 +827,7 @@ public async Task Restart_VirtualMachineScaleSetVMRestartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_VirtualMachineScaleSetVMRestartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -855,7 +855,7 @@ public async Task Restart_VirtualMachineScaleSetVMRestartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineScaleSetVMStartMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -883,7 +883,7 @@ public async Task PowerOn_VirtualMachineScaleSetVMStartMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PowerOn_VirtualMachineScaleSetVMStartMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -911,7 +911,7 @@ public async Task PowerOn_VirtualMachineScaleSetVMStartMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineScaleSetVMRedeployMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -939,7 +939,7 @@ public async Task Redeploy_VirtualMachineScaleSetVMRedeployMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Redeploy_VirtualMachineScaleSetVMRedeployMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_Redeploy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -967,7 +967,7 @@ public async Task Redeploy_VirtualMachineScaleSetVMRedeployMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RetrieveBootDiagnosticsData_RetrieveBootDiagnosticsDataOfAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_RetrieveBootDiagnosticsData" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -996,7 +996,7 @@ public async Task RetrieveBootDiagnosticsData_RetrieveBootDiagnosticsDataOfAVirt [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachineScaleSetVMPerformMaintenanceMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1024,7 +1024,7 @@ public async Task PerformMaintenance_VirtualMachineScaleSetVMPerformMaintenanceM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PerformMaintenance_VirtualMachineScaleSetVMPerformMaintenanceMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_PerformMaintenance" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1052,7 +1052,7 @@ public async Task PerformMaintenance_VirtualMachineScaleSetVMPerformMaintenanceM [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task SimulateEviction_SimulateEvictionAVirtualMachine() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_SimulateEviction" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1080,7 +1080,7 @@ public async Task SimulateEviction_SimulateEvictionAVirtualMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AttachDetachDataDisks_VirtualMachineScaleSetVMAttachDetachDataDisksMaximumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_AttachDetachDataDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1138,7 +1138,7 @@ public async Task AttachDetachDataDisks_VirtualMachineScaleSetVMAttachDetachData [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AttachDetachDataDisks_VirtualMachineScaleSetVMAttachDetachDataDisksMinimumSetGen() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_AttachDetachDataDisks" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -1178,7 +1178,7 @@ public async Task AttachDetachDataDisks_VirtualMachineScaleSetVMAttachDetachData [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RunCommand_VirtualMachineScaleSetVMsRunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json // this example is just showing the usage of "VirtualMachineScaleSetVMs_RunCommand" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandCollection.cs index 2da24f5c669c..6a6be30c2979 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineScaleSetVmRunCommandCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateVirtualMachineScaleSetVMRunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task CreateOrUpdate_CreateVirtualMachineScaleSetVMRunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVirtualMachineScaleSetVMRunCommands() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +120,7 @@ public async Task Get_GetVirtualMachineScaleSetVMRunCommands() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetVirtualMachineScaleSetVMRunCommands() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,7 +152,7 @@ public async Task Exists_GetVirtualMachineScaleSetVMRunCommands() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetVirtualMachineScaleSetVMRunCommands() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,7 +196,7 @@ public async Task GetIfExists_GetVirtualMachineScaleSetVMRunCommands() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRunCommandsInVmssInstance() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandResource.cs b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandResource.cs index 0e2901d2bae3..9fb4a1149477 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/samples/Generated/Samples/Sample_VirtualMachineScaleSetVmRunCommandResource.cs @@ -20,7 +20,7 @@ public partial class Sample_VirtualMachineScaleSetVmRunCommandResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateVirtualMachineScaleSetVMRunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -65,7 +65,7 @@ public async Task Update_UpdateVirtualMachineScaleSetVMRunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteVirtualMachineScaleSetVMRunCommand() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +94,7 @@ public async Task Delete_DeleteVirtualMachineScaleSetVMRunCommand() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetVirtualMachineScaleSetVMRunCommands() { - // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-03-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json + // Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json // this example is just showing the usage of "VirtualMachineScaleSetVMRunCommands_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj b/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj index 375047c4cf34..a3e572f2526f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Azure.ResourceManager.Compute.csproj @@ -1,8 +1,8 @@ - 1.6.0-beta.1 + 1.7.0-beta.1 - 1.5.0 + 1.6.0 Azure.ResourceManager.Compute Microsoft Azure management client SDK for Azure resource provider Microsoft.Compute. azure;management;compute diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/ComputeSecurityPostureReference.cs.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/ComputeSecurityPostureReference.cs.cs new file mode 100644 index 000000000000..1bf4603a282e --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/ComputeSecurityPostureReference.cs.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Azure.Core; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. + public partial class ComputeSecurityPostureReference + { + /// Initializes a new instance of . + [EditorBrowsable(EditorBrowsableState.Never)] + public ComputeSecurityPostureReference() + { + ExcludeExtensions = new ChangeTrackingList(); + ExcludeExtensionNames = new ChangeTrackingList(); + } + + /// List of virtual machine extensions to exclude when applying the Security Posture. This property is deprecated. Instead, use ExcludeExtensionNames that takes in list of strings. + [EditorBrowsable(EditorBrowsableState.Never)] + public IList ExcludeExtensions { get; } + } +} + + diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/WindowsConfiguration.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/WindowsConfiguration.cs index c1bb5464aeb1..898840ababc6 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/WindowsConfiguration.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Customize/Models/WindowsConfiguration.cs @@ -12,5 +12,8 @@ public partial class WindowsConfiguration /// Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. <br><br> For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. [EditorBrowsable(EditorBrowsableState.Never)] public bool? EnableAutomaticUpdates { get => IsAutomaticUpdatesEnabled; set => IsAutomaticUpdatesEnabled = value; } + + /// Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. + public bool? IsVmAgentPlatformUpdatesEnabled { get; [EditorBrowsable(EditorBrowsableState.Never)] set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs index fabe19ebcbb5..195d2f33d442 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ArmComputeModelFactory.cs @@ -107,7 +107,7 @@ public static VirtualMachineSize VirtualMachineSize(string name = null, int? num /// The virtual machine scale set sku. /// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. /// The identity of the virtual machine scale set, if configured. - /// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. + /// The virtual machine scale set zones. /// The extended location of the Virtual Machine Scale Set. /// Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates. /// The upgrade policy. @@ -131,8 +131,10 @@ public static VirtualMachineSize VirtualMachineSize(string name = null, int? num /// Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. /// Optional property which must either be set to True or omitted. /// Policy for Resiliency. + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + /// Specifies the sku profile for the virtual machine scale set. /// A new instance for mocking. - public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ComputeSku sku = null, ComputePlan plan = null, ManagedServiceIdentity identity = null, IEnumerable zones = null, ExtendedLocation extendedLocation = null, string etag = null, VirtualMachineScaleSetUpgradePolicy upgradePolicy = null, ScheduledEventsPolicy scheduledEventsPolicy = null, AutomaticRepairsPolicy automaticRepairsPolicy = null, VirtualMachineScaleSetVmProfile virtualMachineProfile = null, string provisioningState = null, bool? overprovision = null, bool? doNotRunExtensionsOnOverprovisionedVms = null, string uniqueId = null, bool? singlePlacementGroup = null, bool? zoneBalance = null, int? platformFaultDomainCount = null, ResourceIdentifier proximityPlacementGroupId = null, ResourceIdentifier hostGroupId = null, AdditionalCapabilities additionalCapabilities = null, ScaleInPolicy scaleInPolicy = null, OrchestrationMode? orchestrationMode = null, SpotRestorePolicy spotRestorePolicy = null, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy = null, DateTimeOffset? timeCreated = null, bool? isMaximumCapacityConstrained = null, ResiliencyPolicy resiliencyPolicy = null) + public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ComputeSku sku = null, ComputePlan plan = null, ManagedServiceIdentity identity = null, IEnumerable zones = null, ExtendedLocation extendedLocation = null, string etag = null, VirtualMachineScaleSetUpgradePolicy upgradePolicy = null, ScheduledEventsPolicy scheduledEventsPolicy = null, AutomaticRepairsPolicy automaticRepairsPolicy = null, VirtualMachineScaleSetVmProfile virtualMachineProfile = null, string provisioningState = null, bool? overprovision = null, bool? doNotRunExtensionsOnOverprovisionedVms = null, string uniqueId = null, bool? singlePlacementGroup = null, bool? zoneBalance = null, int? platformFaultDomainCount = null, ResourceIdentifier proximityPlacementGroupId = null, ResourceIdentifier hostGroupId = null, AdditionalCapabilities additionalCapabilities = null, ScaleInPolicy scaleInPolicy = null, OrchestrationMode? orchestrationMode = null, SpotRestorePolicy spotRestorePolicy = null, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy = null, DateTimeOffset? timeCreated = null, bool? isMaximumCapacityConstrained = null, ResiliencyPolicy resiliencyPolicy = null, ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode = null, ComputeSkuProfile skuProfile = null) { tags ??= new Dictionary(); zones ??= new List(); @@ -171,6 +173,8 @@ public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIden timeCreated, isMaximumCapacityConstrained, resiliencyPolicy, + zonalPlatformFaultDomainAlignMode, + skuProfile, serializedAdditionalRawData: null); } @@ -191,8 +195,8 @@ public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIden /// Specifies the gallery applications that should be made available to the VM/VMSS. /// Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. /// Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01. - /// Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01. - /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. Minimum API version for this property is 2024-03-01. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile with minimum api-version 2024-03-01. + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile. Minimum API version for this property is 2023-09-01. /// A new instance for mocking. public static VirtualMachineScaleSetVmProfile VirtualMachineScaleSetVmProfile(VirtualMachineScaleSetOSProfile osProfile = null, VirtualMachineScaleSetStorageProfile storageProfile = null, VirtualMachineScaleSetNetworkProfile networkProfile = null, SecurityProfile securityProfile = null, BootDiagnostics bootDiagnostics = null, VirtualMachineScaleSetExtensionProfile extensionProfile = null, string licenseType = null, VirtualMachinePriorityType? priority = null, VirtualMachineEvictionPolicyType? evictionPolicy = null, double? billingMaxPrice = null, ComputeScheduledEventsProfile scheduledEventsProfile = null, string userData = null, ResourceIdentifier capacityReservationGroupId = null, IEnumerable galleryApplications = null, VirtualMachineSizeProperties hardwareVmSizeProperties = null, ResourceIdentifier serviceArtifactReferenceId = null, ComputeSecurityPostureReference securityPostureReference = null, DateTimeOffset? timeCreated = null) { @@ -220,6 +224,31 @@ public static VirtualMachineScaleSetVmProfile VirtualMachineScaleSetVmProfile(Vi serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Indicates whether virtual machine agent should be provisioned on the virtual machine. When this property is not specified in the request body, it is set to true by default. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. + /// Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. + /// Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + /// Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. + /// [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + /// Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. + /// Indicates whether VMAgent Platform Updates are enabled for the Windows Virtual Machine. + /// A new instance for mocking. + public static WindowsConfiguration WindowsConfiguration(bool? provisionVmAgent = null, bool? isAutomaticUpdatesEnabled = null, string timeZone = null, IEnumerable additionalUnattendContent = null, PatchSettings patchSettings = null, IEnumerable winRMListeners = null, bool? isVmAgentPlatformUpdatesEnabled = null) + { + additionalUnattendContent ??= new List(); + winRMListeners ??= new List(); + + return new WindowsConfiguration( + provisionVmAgent, + isAutomaticUpdatesEnabled, + timeZone, + additionalUnattendContent?.ToList(), + patchSettings, + winRMListeners != null ? new WinRMConfiguration(winRMListeners?.ToList(), serializedAdditionalRawData: null) : null, + isVmAgentPlatformUpdatesEnabled, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Resource Id. /// The image publisher. @@ -294,55 +323,6 @@ public static ComputeSubResourceData ComputeSubResourceData(ResourceIdentifier i return new ComputeSubResourceData(id, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// How the extension handler should be forced to update even if the extension configuration has not changed. - /// The name of the extension handler publisher. - /// Specifies the type of the extension; an example is "CustomScriptExtension". - /// Specifies the version of the script handler. - /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. - /// Json formatted public settings for the extension. - /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - /// The provisioning state, which only appears in the response. - /// The virtual machine extension instance view. - /// Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. - /// The extensions protected settings that are passed by reference, and consumed from key vault. - /// Collection of extension names after which this extension needs to be provisioned. - /// A new instance for mocking. - public static VirtualMachineExtensionData VirtualMachineExtensionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? autoUpgradeMinorVersion = null, bool? enableAutomaticUpgrade = null, BinaryData settings = null, BinaryData protectedSettings = null, string provisioningState = null, VirtualMachineExtensionInstanceView instanceView = null, bool? suppressFailures = null, KeyVaultSecretReference keyVaultProtectedSettings = null, IEnumerable provisionAfterExtensions = null) - { - tags ??= new Dictionary(); - provisionAfterExtensions ??= new List(); - - return new VirtualMachineExtensionData( - id, - name, - resourceType, - systemData, - tags, - location, - forceUpdateTag, - publisher, - extensionType, - typeHandlerVersion, - autoUpgradeMinorVersion, - enableAutomaticUpgrade, - settings, - protectedSettings, - provisioningState, - instanceView, - suppressFailures, - keyVaultProtectedSettings, - provisionAfterExtensions?.ToList(), - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The instance view status summary for the virtual machine scale set. /// The extensions information. @@ -674,8 +654,8 @@ public static VirtualMachineScaleSetVmExtensionPatch VirtualMachineScaleSetVmExt /// Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. /// Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. /// Specifies the protection policy of the virtual machine. - /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. - /// Specifies the time at which the Virtual Machine resource was created.<br><br>Minimum api-version: 2021-11-01. + /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. + /// Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. /// A new instance for mocking. public static VirtualMachineScaleSetVmData VirtualMachineScaleSetVmData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string instanceId = null, ComputeSku sku = null, ComputePlan plan = null, IEnumerable resources = null, IEnumerable zones = null, ManagedServiceIdentity identity = null, string etag = null, bool? latestModelApplied = null, string vmId = null, VirtualMachineScaleSetVmInstanceView instanceView = null, VirtualMachineHardwareProfile hardwareProfile = null, VirtualMachineStorageProfile storageProfile = null, AdditionalCapabilities additionalCapabilities = null, VirtualMachineOSProfile osProfile = null, SecurityProfile securityProfile = null, VirtualMachineNetworkProfile networkProfile = null, IEnumerable networkInterfaceConfigurations = null, BootDiagnostics bootDiagnostics = null, ResourceIdentifier availabilitySetId = null, string provisioningState = null, string licenseType = null, string modelDefinitionApplied = null, VirtualMachineScaleSetVmProtectionPolicy protectionPolicy = null, string userData = null, DateTimeOffset? timeCreated = null) { @@ -869,6 +849,55 @@ public static VirtualMachineDataDisk VirtualMachineDataDisk(int lun = default, s serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// How the extension handler should be forced to update even if the extension configuration has not changed. + /// The name of the extension handler publisher. + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the version of the script handler. + /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. + /// Json formatted public settings for the extension. + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + /// The provisioning state, which only appears in the response. + /// The virtual machine extension instance view. + /// Indicates whether failures stemming from the extension will be suppressed (Operational failures such as not connecting to the VM will not be suppressed regardless of this value). The default is false. + /// The extensions protected settings that are passed by reference, and consumed from key vault. + /// Collection of extension names after which this extension needs to be provisioned. + /// A new instance for mocking. + public static VirtualMachineExtensionData VirtualMachineExtensionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? autoUpgradeMinorVersion = null, bool? enableAutomaticUpgrade = null, BinaryData settings = null, BinaryData protectedSettings = null, string provisioningState = null, VirtualMachineExtensionInstanceView instanceView = null, bool? suppressFailures = null, KeyVaultSecretReference keyVaultProtectedSettings = null, IEnumerable provisionAfterExtensions = null) + { + tags ??= new Dictionary(); + provisionAfterExtensions ??= new List(); + + return new VirtualMachineExtensionData( + id, + name, + resourceType, + systemData, + tags, + location, + forceUpdateTag, + publisher, + extensionType, + typeHandlerVersion, + autoUpgradeMinorVersion, + enableAutomaticUpgrade, + settings, + protectedSettings, + provisioningState, + instanceView, + suppressFailures, + keyVaultProtectedSettings, + provisionAfterExtensions?.ToList(), + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The console screenshot blob URI. /// The serial console log blob URI. @@ -1382,8 +1411,9 @@ public static VirtualMachineExtensionImageData VirtualMachineExtensionImageData( /// A list of references to all virtual machines in the availability set. /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. /// The resource status information. + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. /// A new instance for mocking. - public static AvailabilitySetData AvailabilitySetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ComputeSku sku = null, int? platformUpdateDomainCount = null, int? platformFaultDomainCount = null, IEnumerable virtualMachines = null, ResourceIdentifier proximityPlacementGroupId = null, IEnumerable statuses = null) + public static AvailabilitySetData AvailabilitySetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ComputeSku sku = null, int? platformUpdateDomainCount = null, int? platformFaultDomainCount = null, IEnumerable virtualMachines = null, ResourceIdentifier proximityPlacementGroupId = null, IEnumerable statuses = null, ScheduledEventsPolicy scheduledEventsPolicy = null) { tags ??= new Dictionary(); virtualMachines ??= new List(); @@ -1402,6 +1432,7 @@ public static AvailabilitySetData AvailabilitySetData(ResourceIdentifier id = nu virtualMachines?.ToList(), proximityPlacementGroupId != null ? ResourceManagerModelFactory.WritableSubResource(proximityPlacementGroupId) : null, statuses?.ToList(), + scheduledEventsPolicy, serializedAdditionalRawData: null); } @@ -1413,8 +1444,9 @@ public static AvailabilitySetData AvailabilitySetData(ResourceIdentifier id = nu /// A list of references to all virtual machines in the availability set. /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. /// The resource status information. + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. /// A new instance for mocking. - public static AvailabilitySetPatch AvailabilitySetPatch(IDictionary tags = null, ComputeSku sku = null, int? platformUpdateDomainCount = null, int? platformFaultDomainCount = null, IEnumerable virtualMachines = null, ResourceIdentifier proximityPlacementGroupId = null, IEnumerable statuses = null) + public static AvailabilitySetPatch AvailabilitySetPatch(IDictionary tags = null, ComputeSku sku = null, int? platformUpdateDomainCount = null, int? platformFaultDomainCount = null, IEnumerable virtualMachines = null, ResourceIdentifier proximityPlacementGroupId = null, IEnumerable statuses = null, ScheduledEventsPolicy scheduledEventsPolicy = null) { tags ??= new Dictionary(); virtualMachines ??= new List(); @@ -1428,7 +1460,8 @@ public static AvailabilitySetPatch AvailabilitySetPatch(IDictionary Initializes a new instance of . @@ -1964,7 +1997,7 @@ public static RestorePointGroupPatch RestorePointGroupPatch(IDictionary A list of all capacity reservation resource ids that belong to capacity reservation group. /// A list of references to all virtual machines associated to the capacity reservation group. /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// A new instance for mocking. public static CapacityReservationGroupData CapacityReservationGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable zones = null, IEnumerable capacityReservations = null, IEnumerable virtualMachinesAssociated = null, CapacityReservationGroupInstanceView instanceView = null, IEnumerable sharingSubscriptionIds = null) { @@ -1991,7 +2024,7 @@ public static CapacityReservationGroupData CapacityReservationGroupData(Resource /// Initializes a new instance of . /// List of instance view of the capacity reservations under the capacity reservation group. - /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// A new instance for mocking. public static CapacityReservationGroupInstanceView CapacityReservationGroupInstanceView(IEnumerable capacityReservations = null, IEnumerable sharedSubscriptionIds = null) { @@ -2040,7 +2073,7 @@ public static CapacityReservationUtilization CapacityReservationUtilization(int? /// A list of all capacity reservation resource ids that belong to capacity reservation group. /// A list of references to all virtual machines associated to the capacity reservation group. /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// A new instance for mocking. public static CapacityReservationGroupPatch CapacityReservationGroupPatch(IDictionary tags = null, IEnumerable capacityReservations = null, IEnumerable virtualMachinesAssociated = null, CapacityReservationGroupInstanceView instanceView = null, IEnumerable sharingSubscriptionIds = null) { @@ -2773,8 +2806,9 @@ public static DiskEncryptionSetData DiskEncryptionSetData(ResourceIdentifier id /// Replication state of disk restore point when source resource is from a different region. /// Location of source disk or source disk restore point when source resource is from a different region. /// Contains the security related information for the resource. + /// Logical sector size in bytes for disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the default. /// A new instance for mocking. - public static DiskRestorePointData DiskRestorePointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? timeCreated = null, ResourceIdentifier sourceResourceId = null, SupportedOperatingSystemType? osType = null, HyperVGeneration? hyperVGeneration = null, DiskPurchasePlan purchasePlan = null, SupportedCapabilities supportedCapabilities = null, string familyId = null, string sourceUniqueId = null, DiskEncryption encryption = null, bool? supportsHibernation = null, NetworkAccessPolicy? networkAccessPolicy = null, DiskPublicNetworkAccess? publicNetworkAccess = null, ResourceIdentifier diskAccessId = null, float? completionPercent = null, string replicationState = null, AzureLocation? sourceResourceLocation = null, DiskSecurityProfile securityProfile = null) + public static DiskRestorePointData DiskRestorePointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DateTimeOffset? timeCreated = null, ResourceIdentifier sourceResourceId = null, SupportedOperatingSystemType? osType = null, HyperVGeneration? hyperVGeneration = null, DiskPurchasePlan purchasePlan = null, SupportedCapabilities supportedCapabilities = null, string familyId = null, string sourceUniqueId = null, DiskEncryption encryption = null, bool? supportsHibernation = null, NetworkAccessPolicy? networkAccessPolicy = null, DiskPublicNetworkAccess? publicNetworkAccess = null, ResourceIdentifier diskAccessId = null, float? completionPercent = null, string replicationState = null, AzureLocation? sourceResourceLocation = null, DiskSecurityProfile securityProfile = null, int? logicalSectorSize = null) { return new DiskRestorePointData( id, @@ -2798,6 +2832,7 @@ public static DiskRestorePointData DiskRestorePointData(ResourceIdentifier id = replicationState, sourceResourceLocation, securityProfile, + logicalSectorSize, serializedAdditionalRawData: null); } @@ -4189,6 +4224,111 @@ public static OSVersionPropertiesBase OSVersionPropertiesBase(string version = n return new OSVersionPropertiesBase(version, label, isDefault, isActive, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The virtual machine scale set sku. + /// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. + /// The identity of the virtual machine scale set, if configured. + /// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. + /// The extended location of the Virtual Machine Scale Set. + /// Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates. + /// The upgrade policy. + /// The ScheduledEventsPolicy. + /// Policy for automatic repairs. + /// The virtual machine profile. + /// The provisioning state, which only appears in the response. + /// Specifies whether the Virtual Machine Scale Set should be overprovisioned. + /// When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. + /// Specifies the ID which uniquely identifies a Virtual Machine Scale Set. + /// When true this limits the scale set to a single placement group, of max size 100 virtual machines. NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. + /// Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. zoneBalance property can only be set if the zones property of the scale set contains more than one zone. If there are no zones or only one zone specified, then zoneBalance property should not be set. + /// Fault Domain count for each placement group. + /// Specifies information about the proximity placement group that the virtual machine scale set should be assigned to. Minimum api-version: 2018-04-01. + /// Specifies information about the dedicated host group that the virtual machine scale set resides in. Minimum api-version: 2020-06-01. + /// Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. + /// Specifies the policies applied when scaling in Virtual Machines in the Virtual Machine Scale Set. + /// Specifies the orchestration mode for the virtual machine scale set. + /// Specifies the Spot Restore properties for the virtual machine scale set. + /// Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. + /// Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. + /// Optional property which must either be set to True or omitted. + /// Policy for Resiliency. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IEnumerable zones, ExtendedLocation extendedLocation, string etag, VirtualMachineScaleSetUpgradePolicy upgradePolicy, ScheduledEventsPolicy scheduledEventsPolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, ResourceIdentifier proximityPlacementGroupId, ResourceIdentifier hostGroupId, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, OrchestrationMode? orchestrationMode, SpotRestorePolicy spotRestorePolicy, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, ResiliencyPolicy resiliencyPolicy) + { + return VirtualMachineScaleSetData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, plan: plan, identity: identity, zones: zones, extendedLocation: extendedLocation, etag: etag, upgradePolicy: upgradePolicy, scheduledEventsPolicy: scheduledEventsPolicy, automaticRepairsPolicy: automaticRepairsPolicy, virtualMachineProfile: virtualMachineProfile, provisioningState: provisioningState, overprovision: overprovision, doNotRunExtensionsOnOverprovisionedVms: doNotRunExtensionsOnOverprovisionedVms, uniqueId: uniqueId, singlePlacementGroup: singlePlacementGroup, zoneBalance: zoneBalance, platformFaultDomainCount: platformFaultDomainCount, proximityPlacementGroupId: proximityPlacementGroupId, hostGroupId: hostGroupId, additionalCapabilities: additionalCapabilities, scaleInPolicy: scaleInPolicy, orchestrationMode: orchestrationMode, spotRestorePolicy: spotRestorePolicy, priorityMixPolicy: priorityMixPolicy, timeCreated: timeCreated, isMaximumCapacityConstrained: isMaximumCapacityConstrained, resiliencyPolicy: resiliencyPolicy, zonalPlatformFaultDomainAlignMode: default, skuProfile: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. + /// Update Domain count. + /// Fault Domain count. + /// A list of references to all virtual machines in the availability set. + /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. + /// The resource status information. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AvailabilitySetData AvailabilitySetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IEnumerable virtualMachines, ResourceIdentifier proximityPlacementGroupId, IEnumerable statuses) + { + return AvailabilitySetData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, platformUpdateDomainCount: platformUpdateDomainCount, platformFaultDomainCount: platformFaultDomainCount, virtualMachines: virtualMachines, proximityPlacementGroupId: proximityPlacementGroupId, statuses: statuses, scheduledEventsPolicy: default); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Sku of the availability set. + /// Update Domain count. + /// Fault Domain count. + /// A list of references to all virtual machines in the availability set. + /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. + /// The resource status information. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AvailabilitySetPatch AvailabilitySetPatch(IDictionary tags, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IEnumerable virtualMachines, ResourceIdentifier proximityPlacementGroupId, IEnumerable statuses) + { + return AvailabilitySetPatch(tags: tags, sku: sku, platformUpdateDomainCount: platformUpdateDomainCount, platformFaultDomainCount: platformFaultDomainCount, virtualMachines: virtualMachines, proximityPlacementGroupId: proximityPlacementGroupId, statuses: statuses, scheduledEventsPolicy: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The timestamp of restorePoint creation. + /// arm id of source disk or source disk restore point. + /// The Operating System type. + /// The hypervisor generation of the Virtual Machine. Applicable to OS disks only. + /// Purchase plan information for the the image from which the OS disk was created. + /// List of supported capabilities for the image from which the OS disk was created. + /// id of the backing snapshot's MIS family. + /// unique incarnation id of the source disk. + /// Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. + /// Indicates the OS on a disk supports hibernation. + /// Policy for accessing the disk via network. + /// Policy for controlling export on the disk. + /// ARM id of the DiskAccess resource for using private endpoints on disks. + /// Percentage complete for the background copy of disk restore point when source resource is from a different region. + /// Replication state of disk restore point when source resource is from a different region. + /// Location of source disk or source disk restore point when source resource is from a different region. + /// Contains the security related information for the resource. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static DiskRestorePointData DiskRestorePointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? timeCreated, ResourceIdentifier sourceResourceId, SupportedOperatingSystemType? osType, HyperVGeneration? hyperVGeneration, DiskPurchasePlan purchasePlan, SupportedCapabilities supportedCapabilities, string familyId, string sourceUniqueId, DiskEncryption encryption, bool? supportsHibernation, NetworkAccessPolicy? networkAccessPolicy, DiskPublicNetworkAccess? publicNetworkAccess, ResourceIdentifier diskAccessId, float? completionPercent, string replicationState, AzureLocation? sourceResourceLocation, DiskSecurityProfile securityProfile) + { + return DiskRestorePointData(id: id, name: name, resourceType: resourceType, systemData: systemData, timeCreated: timeCreated, sourceResourceId: sourceResourceId, osType: osType, hyperVGeneration: hyperVGeneration, purchasePlan: purchasePlan, supportedCapabilities: supportedCapabilities, familyId: familyId, sourceUniqueId: sourceUniqueId, encryption: encryption, supportsHibernation: supportsHibernation, networkAccessPolicy: networkAccessPolicy, publicNetworkAccess: publicNetworkAccess, diskAccessId: diskAccessId, completionPercent: completionPercent, replicationState: replicationState, sourceResourceLocation: sourceResourceLocation, securityProfile: securityProfile, logicalSectorSize: default); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -4226,7 +4366,7 @@ public static OSVersionPropertiesBase OSVersionPropertiesBase(string version = n [EditorBrowsable(EditorBrowsableState.Never)] public static VirtualMachineScaleSetData VirtualMachineScaleSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IEnumerable zones, ExtendedLocation extendedLocation, string etag, VirtualMachineScaleSetUpgradePolicy upgradePolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, ResourceIdentifier proximityPlacementGroupId, ResourceIdentifier hostGroupId, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, OrchestrationMode? orchestrationMode, SpotRestorePolicy spotRestorePolicy, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, ResiliencyPolicy resiliencyPolicy) { - return VirtualMachineScaleSetData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, plan: plan, identity: identity, zones: zones, extendedLocation: extendedLocation, etag: etag, upgradePolicy: upgradePolicy, scheduledEventsPolicy: default, automaticRepairsPolicy: automaticRepairsPolicy, virtualMachineProfile: virtualMachineProfile, provisioningState: provisioningState, overprovision: overprovision, doNotRunExtensionsOnOverprovisionedVms: doNotRunExtensionsOnOverprovisionedVms, uniqueId: uniqueId, singlePlacementGroup: singlePlacementGroup, zoneBalance: zoneBalance, platformFaultDomainCount: platformFaultDomainCount, proximityPlacementGroupId: proximityPlacementGroupId, hostGroupId: hostGroupId, additionalCapabilities: additionalCapabilities, scaleInPolicy: scaleInPolicy, orchestrationMode: orchestrationMode, spotRestorePolicy: spotRestorePolicy, priorityMixPolicy: priorityMixPolicy, timeCreated: timeCreated, isMaximumCapacityConstrained: isMaximumCapacityConstrained, resiliencyPolicy: resiliencyPolicy); + return VirtualMachineScaleSetData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, sku: sku, plan: plan, identity: identity, zones: zones, extendedLocation: extendedLocation, etag: etag, upgradePolicy: upgradePolicy, scheduledEventsPolicy: default, automaticRepairsPolicy: automaticRepairsPolicy, virtualMachineProfile: virtualMachineProfile, provisioningState: provisioningState, overprovision: overprovision, doNotRunExtensionsOnOverprovisionedVms: doNotRunExtensionsOnOverprovisionedVms, uniqueId: uniqueId, singlePlacementGroup: singlePlacementGroup, zoneBalance: zoneBalance, platformFaultDomainCount: platformFaultDomainCount, proximityPlacementGroupId: proximityPlacementGroupId, hostGroupId: hostGroupId, additionalCapabilities: additionalCapabilities, scaleInPolicy: scaleInPolicy, orchestrationMode: orchestrationMode, spotRestorePolicy: spotRestorePolicy, priorityMixPolicy: priorityMixPolicy, timeCreated: timeCreated, isMaximumCapacityConstrained: isMaximumCapacityConstrained, resiliencyPolicy: resiliencyPolicy, zonalPlatformFaultDomainAlignMode: default, skuProfile: default); } /// Initializes a new instance of . diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetCollection.cs index 2462ee686f1a..89c78df17278 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string ava /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string availabilitySetName, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(CancellationTo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string availabilitySetName /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string availabilitySetName, CancellationTok /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> GetIfExists /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.Serialization.cs index 939e4f5bd2a2..662a6b81f216 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.Serialization.cs @@ -104,6 +104,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsDefined(ScheduledEventsPolicy)) + { + writer.WritePropertyName("scheduledEventsPolicy"u8); + writer.WriteObjectValue(ScheduledEventsPolicy, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -155,6 +160,7 @@ internal static AvailabilitySetData DeserializeAvailabilitySetData(JsonElement e IList virtualMachines = default; WritableSubResource proximityPlacementGroup = default; IReadOnlyList statuses = default; + ScheduledEventsPolicy scheduledEventsPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -275,6 +281,15 @@ internal static AvailabilitySetData DeserializeAvailabilitySetData(JsonElement e statuses = array; continue; } + if (property0.NameEquals("scheduledEventsPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledEventsPolicy = ScheduledEventsPolicy.DeserializeScheduledEventsPolicy(property0.Value, options); + continue; + } } continue; } @@ -297,6 +312,7 @@ internal static AvailabilitySetData DeserializeAvailabilitySetData(JsonElement e virtualMachines ?? new ChangeTrackingList(), proximityPlacementGroup, statuses ?? new ChangeTrackingList(), + scheduledEventsPolicy, serializedAdditionalRawData); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.cs index 04171c68292f..48925e2a00c2 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetData.cs @@ -73,8 +73,9 @@ public AvailabilitySetData(AzureLocation location) : base(location) /// A list of references to all virtual machines in the availability set. /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. /// The resource status information. + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. /// Keeps track of any properties unknown to the library. - internal AvailabilitySetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IList virtualMachines, WritableSubResource proximityPlacementGroup, IReadOnlyList statuses, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal AvailabilitySetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IList virtualMachines, WritableSubResource proximityPlacementGroup, IReadOnlyList statuses, ScheduledEventsPolicy scheduledEventsPolicy, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; PlatformUpdateDomainCount = platformUpdateDomainCount; @@ -82,6 +83,7 @@ internal AvailabilitySetData(ResourceIdentifier id, string name, ResourceType re VirtualMachines = virtualMachines; ProximityPlacementGroup = proximityPlacementGroup; Statuses = statuses; + ScheduledEventsPolicy = scheduledEventsPolicy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -114,5 +116,7 @@ public ResourceIdentifier ProximityPlacementGroupId /// The resource status information. public IReadOnlyList Statuses { get; } + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. + public ScheduledEventsPolicy ScheduledEventsPolicy { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetResource.cs index 4791546e5d45..bbf00466bad0 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/AvailabilitySetResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -228,7 +228,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -272,7 +272,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> UpdateAsync(Availab /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual Response Update(AvailabilitySetPatch pat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -385,7 +385,7 @@ public virtual AsyncPageable GetAvailableSizesAsync(Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -414,7 +414,7 @@ public virtual Pageable GetAvailableSizes(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -476,7 +476,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -538,7 +538,7 @@ public virtual Response AddTag(string key, string value /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -595,7 +595,7 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -652,7 +652,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -712,7 +712,7 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationCollection.cs index fc5afd6032c1..0cb915667f7d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual Response Get(string capacityReservat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string capacityReservation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string capacityReservationName, CapacityRes /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupCollection.cs index 2d070f89721f..36afef369c68 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(string capacityRes /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -291,7 +291,7 @@ public virtual AsyncPageable GetAllAsync(Capac /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -322,7 +322,7 @@ public virtual Pageable GetAll(CapacityReserva /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -366,7 +366,7 @@ public virtual async Task> ExistsAsync(string capacityReservation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -410,7 +410,7 @@ public virtual Response Exists(string capacityReservationGroupName, Capaci /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -456,7 +456,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupData.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupData.cs index 0e1a0bef2bd9..15e57212848d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupData.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupData.cs @@ -72,7 +72,7 @@ public CapacityReservationGroupData(AzureLocation location) : base(location) /// A list of all capacity reservation resource ids that belong to capacity reservation group. /// A list of references to all virtual machines associated to the capacity reservation group. /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// Keeps track of any properties unknown to the library. internal CapacityReservationGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IList zones, IReadOnlyList capacityReservations, IReadOnlyList virtualMachinesAssociated, CapacityReservationGroupInstanceView instanceView, ResourceSharingProfile sharingProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { @@ -97,9 +97,9 @@ internal CapacityReservationGroupData() public IReadOnlyList VirtualMachinesAssociated { get; } /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. public CapacityReservationGroupInstanceView InstanceView { get; } - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. internal ResourceSharingProfile SharingProfile { get; set; } - /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. public IList SharingSubscriptionIds { get diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs index 963ebe6e465d..50235e7b4642 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationGroupResource.cs @@ -110,7 +110,7 @@ public virtual CapacityReservationCollection GetCapacityReservations() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetCapacityRese /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -174,7 +174,7 @@ public virtual Response GetCapacityReservation(stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(CapacityReservatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -344,7 +344,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -428,7 +428,7 @@ public virtual Response Update(CapacityReserva /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -490,7 +490,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -552,7 +552,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -609,7 +609,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -666,7 +666,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -726,7 +726,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationResource.cs index 06cf25ecb72c..8917e9f15684 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/CapacityReservationResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(Capaci /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(CapacityReservationInst /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync(str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, string v /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionCollection.cs index d681485f8a01..510c4c1ce19f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string pri /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionResource.cs index 565fa22c5463..53cf26e920d6 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ComputePrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostCollection.cs index d67e6e143e35..4d267f3ea62a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string hostN /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual Response Get(string hostName, InstanceView /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToke /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(CancellationToken cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string hostName, InstanceV /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string hostName, InstanceViewType? expand = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupCollection.cs index 59d4c67710a2..a666f8eb9b82 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(string hostGroupName, In /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(Cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual Pageable GetAll(CancellationToken can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string hostGroupName, Inst /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string hostGroupName, InstanceViewType? exp /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs index f5f7140698eb..06fa03a182cd 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostGroupResource.cs @@ -110,7 +110,7 @@ public virtual DedicatedHostCollection GetDedicatedHosts() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetDedicatedHostAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -174,7 +174,7 @@ public virtual Response GetDedicatedHost(string hostName, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetAsync(Instanc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(InstanceViewType? expand /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -344,7 +344,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> UpdateAsync(Dedi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -428,7 +428,7 @@ public virtual Response Update(DedicatedHostGroupPat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -490,7 +490,7 @@ public virtual async Task> AddTagAsync(stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -552,7 +552,7 @@ public virtual Response AddTag(string key, string va /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -609,7 +609,7 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -666,7 +666,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -726,7 +726,7 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostResource.cs index a70fc2b27ad4..00af9fdf262c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DedicatedHostResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> GetAsync(InstanceView /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -186,7 +186,7 @@ public virtual Response Get(InstanceViewType? expand = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -228,7 +228,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, D /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -404,7 +404,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -446,7 +446,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -488,7 +488,7 @@ public virtual async Task RedeployAsync(WaitUntil waitUntil, Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -530,7 +530,7 @@ public virtual ArmOperation Redeploy(WaitUntil waitUntil, CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -559,7 +559,7 @@ public virtual AsyncPageable GetAvailableSizesAsync(CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -588,7 +588,7 @@ public virtual Pageable GetAvailableSizes(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -650,7 +650,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -712,7 +712,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -769,7 +769,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -826,7 +826,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -886,7 +886,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessCollection.cs index bc7fa1d5c8c2..40f892605805 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string diskAcce /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string diskAccessName, Cancellat /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken c /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellatio /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string diskAccessName, Can /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string diskAccessName, CancellationToken ca /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsync /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs index 41d946c1a5e3..cb33df01bd17 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskAccessResource.cs @@ -111,7 +111,7 @@ public virtual ComputePrivateEndpointConnectionCollection GetComputePrivateEndpo /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -173,7 +173,7 @@ public virtual Response GetComputePriv /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> GetAsync(CancellationTok /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(CancellationToken cancellationTo /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -295,7 +295,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -337,7 +337,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -383,7 +383,7 @@ public virtual async Task> UpdateAsync(WaitUnti /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -429,7 +429,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Disk /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual AsyncPageable GetPrivateLinkResou /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -487,7 +487,7 @@ public virtual Pageable GetPrivateLinkResources( /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -549,7 +549,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -611,7 +611,7 @@ public virtual Response AddTag(string key, string value, Can /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -668,7 +668,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -725,7 +725,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -785,7 +785,7 @@ public virtual async Task> RemoveTagAsync(string ke /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetCollection.cs index 26605fc70958..e138cf39db21 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string d /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string diskEncryptionSetN /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string diskEncryptionSetNa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string diskEncryptionSetName, CancellationT /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetResource.cs index 30548b9067d3..3e1a58da13bd 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskEncryptionSetResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -390,7 +390,7 @@ public virtual AsyncPageable GetAssociatedResourcesAsync(CancellationTok /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -420,7 +420,7 @@ public virtual Pageable GetAssociatedResources(CancellationToken cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -482,7 +482,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -544,7 +544,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -601,7 +601,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -658,7 +658,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -718,7 +718,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageCollection.cs index 2af931371dc0..2dbfc75fb098 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync(W /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -209,7 +209,7 @@ public virtual async Task> GetAsync(string imageName /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual Response Get(string imageName, string expand = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual Pageable GetAll(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string imageName, string e /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string imageName, string expand = null, Can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -449,7 +449,7 @@ public virtual async Task> GetIfExistsAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageResource.cs index 0a455a9f0eb5..edfb2abea396 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskImageResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(string expand = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(string expand = null, Cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, DiskI /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync(string key, s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, string value, Canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsync(IDictionary< /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary t /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAsync(string key /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointCollection.cs index 14d269aa8ea2..c0379fb51893 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(string di /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string diskRestorePointNam /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string diskRestorePointNam /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string diskRestorePointName, CancellationTo /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.Serialization.cs index 66c27f346cdc..433fe6767b1a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.Serialization.cs @@ -135,6 +135,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("securityProfile"u8); writer.WriteObjectValue(SecurityProfile, options); } + if (options.Format != "W" && Optional.IsDefined(LogicalSectorSize)) + { + writer.WritePropertyName("logicalSectorSize"u8); + writer.WriteNumberValue(LogicalSectorSize.Value); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -195,6 +200,7 @@ internal static DiskRestorePointData DeserializeDiskRestorePointData(JsonElement string replicationState = default; AzureLocation? sourceResourceLocation = default; DiskSecurityProfile securityProfile = default; + int? logicalSectorSize = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -373,6 +379,15 @@ internal static DiskRestorePointData DeserializeDiskRestorePointData(JsonElement securityProfile = DiskSecurityProfile.DeserializeDiskSecurityProfile(property0.Value, options); continue; } + if (property0.NameEquals("logicalSectorSize"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + logicalSectorSize = property0.Value.GetInt32(); + continue; + } } continue; } @@ -404,6 +419,7 @@ internal static DiskRestorePointData DeserializeDiskRestorePointData(JsonElement replicationState, sourceResourceLocation, securityProfile, + logicalSectorSize, serializedAdditionalRawData); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.cs index b260b0ca485d..a5320d4b6e84 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointData.cs @@ -78,8 +78,9 @@ internal DiskRestorePointData() /// Replication state of disk restore point when source resource is from a different region. /// Location of source disk or source disk restore point when source resource is from a different region. /// Contains the security related information for the resource. + /// Logical sector size in bytes for disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the default. /// Keeps track of any properties unknown to the library. - internal DiskRestorePointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? timeCreated, ResourceIdentifier sourceResourceId, SupportedOperatingSystemType? osType, HyperVGeneration? hyperVGeneration, DiskPurchasePlan purchasePlan, SupportedCapabilities supportedCapabilities, string familyId, string sourceUniqueId, DiskEncryption encryption, bool? supportsHibernation, NetworkAccessPolicy? networkAccessPolicy, DiskPublicNetworkAccess? publicNetworkAccess, ResourceIdentifier diskAccessId, float? completionPercent, string replicationState, AzureLocation? sourceResourceLocation, DiskSecurityProfile securityProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal DiskRestorePointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? timeCreated, ResourceIdentifier sourceResourceId, SupportedOperatingSystemType? osType, HyperVGeneration? hyperVGeneration, DiskPurchasePlan purchasePlan, SupportedCapabilities supportedCapabilities, string familyId, string sourceUniqueId, DiskEncryption encryption, bool? supportsHibernation, NetworkAccessPolicy? networkAccessPolicy, DiskPublicNetworkAccess? publicNetworkAccess, ResourceIdentifier diskAccessId, float? completionPercent, string replicationState, AzureLocation? sourceResourceLocation, DiskSecurityProfile securityProfile, int? logicalSectorSize, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { TimeCreated = timeCreated; SourceResourceId = sourceResourceId; @@ -98,6 +99,7 @@ internal DiskRestorePointData(ResourceIdentifier id, string name, ResourceType r ReplicationState = replicationState; SourceResourceLocation = sourceResourceLocation; SecurityProfile = securityProfile; + LogicalSectorSize = logicalSectorSize; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -135,5 +137,7 @@ internal DiskRestorePointData(ResourceIdentifier id, string name, ResourceType r public AzureLocation? SourceResourceLocation { get; } /// Contains the security related information for the resource. public DiskSecurityProfile SecurityProfile { get; } + /// Logical sector size in bytes for disk restore points of UltraSSD_LRS and PremiumV2_LRS disks. Supported values are 512 and 4096. 4096 is the default. + public int? LogicalSectorSize { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointResource.cs index 59c71a69c366..25d712036bab 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/DiskRestorePointResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> GrantAccessAsync(WaitUntil wa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation GrantAccess(WaitUntil waitUntil, GrantAcc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task RevokeAccessAsync(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs index b4136177c8f0..a33aaacea59e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/ComputeExtensions.cs @@ -861,7 +861,7 @@ public static VirtualMachineScaleSetCollection GetVirtualMachineScaleSets(this R /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -900,7 +900,7 @@ public static async Task> GetVirtualMac /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -956,7 +956,7 @@ public static VirtualMachineCollection GetVirtualMachines(this ResourceGroupReso /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -995,7 +995,7 @@ public static async Task> GetVirtualMachineAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1051,7 +1051,7 @@ public static AvailabilitySetCollection GetAvailabilitySets(this ResourceGroupRe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1089,7 +1089,7 @@ public static async Task> GetAvailabilitySetAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1144,7 +1144,7 @@ public static ProximityPlacementGroupCollection GetProximityPlacementGroups(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1183,7 +1183,7 @@ public static async Task> GetProximity /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1239,7 +1239,7 @@ public static DedicatedHostGroupCollection GetDedicatedHostGroups(this ResourceG /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1278,7 +1278,7 @@ public static async Task> GetDedicatedHostG /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1334,7 +1334,7 @@ public static SshPublicKeyCollection GetSshPublicKeys(this ResourceGroupResource /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1372,7 +1372,7 @@ public static async Task> GetSshPublicKeyAsync(th /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1427,7 +1427,7 @@ public static DiskImageCollection GetDiskImages(this ResourceGroupResource resou /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1466,7 +1466,7 @@ public static async Task> GetDiskImageAsync(this Res /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1522,7 +1522,7 @@ public static RestorePointGroupCollection GetRestorePointGroups(this ResourceGro /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1561,7 +1561,7 @@ public static async Task> GetRestorePointGro /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1617,7 +1617,7 @@ public static CapacityReservationGroupCollection GetCapacityReservationGroups(th /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1656,7 +1656,7 @@ public static async Task> GetCapacity /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1712,7 +1712,7 @@ public static ManagedDiskCollection GetManagedDisks(this ResourceGroupResource r /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1750,7 +1750,7 @@ public static async Task> GetManagedDiskAsync(this /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1805,7 +1805,7 @@ public static DiskAccessCollection GetDiskAccesses(this ResourceGroupResource re /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1843,7 +1843,7 @@ public static async Task> GetDiskAccessAsync(this R /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1898,7 +1898,7 @@ public static DiskEncryptionSetCollection GetDiskEncryptionSets(this ResourceGro /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1936,7 +1936,7 @@ public static async Task> GetDiskEncryptionS /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -1991,7 +1991,7 @@ public static SnapshotCollection GetSnapshots(this ResourceGroupResource resourc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2029,7 +2029,7 @@ public static async Task> GetSnapshotAsync(this Resou /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2277,7 +2277,7 @@ public static VirtualMachineExtensionImageCollection GetVirtualMachineExtensionI /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2318,7 +2318,7 @@ public static async Task> GetVirt /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2742,7 +2742,7 @@ public static Response GetCloudServiceOSFamily(thi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2775,7 +2775,7 @@ public static AsyncPageable GetUsagesAsync(this SubscriptionResour /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2808,7 +2808,7 @@ public static Pageable GetUsages(this SubscriptionResource subscri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2841,7 +2841,7 @@ public static AsyncPageable GetVirtualMachineSizesAsync(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2874,7 +2874,7 @@ public static Pageable GetVirtualMachineSizes(this Subscript /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2911,7 +2911,7 @@ public static AsyncPageable GetVirtualMachineSca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2948,7 +2948,7 @@ public static Pageable GetVirtualMachineScaleSet /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2984,7 +2984,7 @@ public static AsyncPageable GetVirtualMachineSca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3020,7 +3020,7 @@ public static Pageable GetVirtualMachineScaleSet /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3057,7 +3057,7 @@ public static AsyncPageable GetVirtualMachinesByLocation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3094,7 +3094,7 @@ public static Pageable GetVirtualMachinesByLocation(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3133,7 +3133,7 @@ public static AsyncPageable GetVirtualMachinesAsync(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3172,7 +3172,7 @@ public static Pageable GetVirtualMachines(this Subscript /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3209,7 +3209,7 @@ public static async Task> GetVirtualMachineImageAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3246,7 +3246,7 @@ public static Response GetVirtualMachineImage(this Subscrip /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3279,7 +3279,7 @@ public static AsyncPageable GetVirtualMachineImagesAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3312,7 +3312,7 @@ public static Pageable GetVirtualMachineImages(this Sub /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3347,7 +3347,7 @@ public static AsyncPageable GetVirtualMachineImageOffer /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3382,7 +3382,7 @@ public static Pageable GetVirtualMachineImageOffers(thi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3415,7 +3415,7 @@ public static AsyncPageable GetVirtualMachineImagePubli /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3448,7 +3448,7 @@ public static Pageable GetVirtualMachineImagePublishers /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3484,7 +3484,7 @@ public static AsyncPageable GetVirtualMachineImageSkusA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3520,7 +3520,7 @@ public static Pageable GetVirtualMachineImageSkus(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3555,7 +3555,7 @@ public static AsyncPageable GetVirtualMachineImagesByEd /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3590,7 +3590,7 @@ public static Pageable GetVirtualMachineImagesByEdgeZon /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3622,7 +3622,7 @@ public static async Task> GetVirtualMachineImagesE /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3654,7 +3654,7 @@ public static Response GetVirtualMachineImagesEdgeZone(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3687,7 +3687,7 @@ public static AsyncPageable GetVirtualMachineImagesEdge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3720,7 +3720,7 @@ public static Pageable GetVirtualMachineImagesEdgeZones /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3756,7 +3756,7 @@ public static AsyncPageable GetOffersVirtualMachineImag /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3792,7 +3792,7 @@ public static Pageable GetOffersVirtualMachineImagesEdg /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3827,7 +3827,7 @@ public static AsyncPageable GetPublishersVirtualMachine /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3862,7 +3862,7 @@ public static Pageable GetPublishersVirtualMachineImage /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3899,7 +3899,7 @@ public static AsyncPageable GetVirtualMachineImageEdgeZ /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -3936,7 +3936,7 @@ public static Pageable GetVirtualMachineImageEdgeZoneSk /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -3973,7 +3973,7 @@ public static AsyncPageable GetAvailabilitySetsAsync(th /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4010,7 +4010,7 @@ public static Pageable GetAvailabilitySets(this Subscri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4046,7 +4046,7 @@ public static AsyncPageable GetProximityPlaceme /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4082,7 +4082,7 @@ public static Pageable GetProximityPlacementGro /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4118,7 +4118,7 @@ public static AsyncPageable GetDedicatedHostGroupsAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4154,7 +4154,7 @@ public static Pageable GetDedicatedHostGroups(this S /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4190,7 +4190,7 @@ public static AsyncPageable GetSshPublicKeysAsync(this Sub /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4226,7 +4226,7 @@ public static Pageable GetSshPublicKeys(this SubscriptionR /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4262,7 +4262,7 @@ public static AsyncPageable GetDiskImagesAsync(this Subscript /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4298,7 +4298,7 @@ public static Pageable GetDiskImages(this SubscriptionResourc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4334,7 +4334,7 @@ public static AsyncPageable GetRestorePointGroupsAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4370,7 +4370,7 @@ public static Pageable GetRestorePointGroups(this Sub /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4408,7 +4408,7 @@ public static AsyncPageable GetCapacityReserva /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4446,7 +4446,7 @@ public static Pageable GetCapacityReservationG /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -4480,7 +4480,7 @@ public static async Task> ExportLogAnalyticsRequestRa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -4514,7 +4514,7 @@ public static ArmOperation ExportLogAnalyticsRequestRateByInterval /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -4548,7 +4548,7 @@ public static async Task> ExportLogAnalyticsThrottled /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -4582,7 +4582,7 @@ public static ArmOperation ExportLogAnalyticsThrottledRequests(thi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4619,7 +4619,7 @@ public static AsyncPageable GetVirtualMachineRunCommands /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4656,7 +4656,7 @@ public static Pageable GetVirtualMachineRunCommands(this /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4694,7 +4694,7 @@ public static async Task> GetVirtualMachineRunComma /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -4732,7 +4732,7 @@ public static Response GetVirtualMachineRunCommand(this Subs /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4768,7 +4768,7 @@ public static AsyncPageable GetManagedDisksAsync(this Subsc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4804,7 +4804,7 @@ public static Pageable GetManagedDisks(this SubscriptionRes /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4840,7 +4840,7 @@ public static AsyncPageable GetDiskAccessesAsync(this Subscr /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4876,7 +4876,7 @@ public static Pageable GetDiskAccesses(this SubscriptionReso /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4912,7 +4912,7 @@ public static AsyncPageable GetDiskEncryptionSetsAsyn /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4948,7 +4948,7 @@ public static Pageable GetDiskEncryptionSets(this Sub /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -4984,7 +4984,7 @@ public static AsyncPageable GetSnapshotsAsync(this Subscriptio /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeResourceGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeResourceGroupResource.cs index 49c3e7eb7b22..1fc8bce46684 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeResourceGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeResourceGroupResource.cs @@ -54,7 +54,7 @@ public virtual VirtualMachineScaleSetCollection GetVirtualMachineScaleSets() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -86,7 +86,7 @@ public virtual async Task> GetVirtualMa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -125,7 +125,7 @@ public virtual VirtualMachineCollection GetVirtualMachines() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -157,7 +157,7 @@ public virtual async Task> GetVirtualMachineAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -196,7 +196,7 @@ public virtual AvailabilitySetCollection GetAvailabilitySets() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task> GetAvailabilitySetA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ProximityPlacementGroupCollection GetProximityPlacementGroups() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -297,7 +297,7 @@ public virtual async Task> GetProximit /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -336,7 +336,7 @@ public virtual DedicatedHostGroupCollection GetDedicatedHostGroups() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -368,7 +368,7 @@ public virtual async Task> GetDedicatedHost /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -407,7 +407,7 @@ public virtual SshPublicKeyCollection GetSshPublicKeys() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -438,7 +438,7 @@ public virtual async Task> GetSshPublicKeyAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -476,7 +476,7 @@ public virtual DiskImageCollection GetDiskImages() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -508,7 +508,7 @@ public virtual async Task> GetDiskImageAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -547,7 +547,7 @@ public virtual RestorePointGroupCollection GetRestorePointGroups() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -579,7 +579,7 @@ public virtual async Task> GetRestorePointGr /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -618,7 +618,7 @@ public virtual CapacityReservationGroupCollection GetCapacityReservationGroups() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -650,7 +650,7 @@ public virtual async Task> GetCapacit /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -689,7 +689,7 @@ public virtual ManagedDiskCollection GetManagedDisks() /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -720,7 +720,7 @@ public virtual async Task> GetManagedDiskAsync(str /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -758,7 +758,7 @@ public virtual DiskAccessCollection GetDiskAccesses() /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -789,7 +789,7 @@ public virtual async Task> GetDiskAccessAsync(strin /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -827,7 +827,7 @@ public virtual DiskEncryptionSetCollection GetDiskEncryptionSets() /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -858,7 +858,7 @@ public virtual async Task> GetDiskEncryption /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -896,7 +896,7 @@ public virtual SnapshotCollection GetSnapshots() /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -927,7 +927,7 @@ public virtual async Task> GetSnapshotAsync(string sn /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs index 41a682047e1c..20cc6ff00ca7 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Extensions/MockableComputeSubscriptionResource.cs @@ -150,7 +150,7 @@ public virtual VirtualMachineExtensionImageCollection GetVirtualMachineExtension /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual async Task> GetVir /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -505,7 +505,7 @@ public virtual Response GetCloudServiceOSFamily(Az /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -532,7 +532,7 @@ public virtual AsyncPageable GetUsagesAsync(AzureLocation location /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -559,7 +559,7 @@ public virtual Pageable GetUsages(AzureLocation location, Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -585,7 +585,7 @@ public virtual AsyncPageable GetVirtualMachineSizesAsync(Azu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -611,7 +611,7 @@ public virtual Pageable GetVirtualMachineSizes(AzureLocation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -642,7 +642,7 @@ public virtual AsyncPageable GetVirtualMachineSc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -673,7 +673,7 @@ public virtual Pageable GetVirtualMachineScaleSe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -703,7 +703,7 @@ public virtual AsyncPageable GetVirtualMachineSc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -733,7 +733,7 @@ public virtual Pageable GetVirtualMachineScaleSe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -764,7 +764,7 @@ public virtual AsyncPageable GetVirtualMachinesByLocatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -795,7 +795,7 @@ public virtual Pageable GetVirtualMachinesByLocation(Azu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -828,7 +828,7 @@ public virtual AsyncPageable GetVirtualMachinesAsync(str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -861,7 +861,7 @@ public virtual Pageable GetVirtualMachines(string status /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -907,7 +907,7 @@ public virtual async Task> GetVirtualMachineImageA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -953,7 +953,7 @@ public virtual Response GetVirtualMachineImage(AzureLocatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -982,7 +982,7 @@ public virtual AsyncPageable GetVirtualMachineImagesAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1011,7 +1011,7 @@ public virtual Pageable GetVirtualMachineImages(Subscri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1042,7 +1042,7 @@ public virtual AsyncPageable GetVirtualMachineImageOffe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1073,7 +1073,7 @@ public virtual Pageable GetVirtualMachineImageOffers(Az /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1099,7 +1099,7 @@ public virtual AsyncPageable GetVirtualMachineImagePubl /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1125,7 +1125,7 @@ public virtual Pageable GetVirtualMachineImagePublisher /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1158,7 +1158,7 @@ public virtual AsyncPageable GetVirtualMachineImageSkus /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1191,7 +1191,7 @@ public virtual Pageable GetVirtualMachineImageSkus(Azur /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1222,7 +1222,7 @@ public virtual AsyncPageable GetVirtualMachineImagesByE /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1253,7 +1253,7 @@ public virtual Pageable GetVirtualMachineImagesByEdgeZo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1291,7 +1291,7 @@ public virtual async Task> GetVirtualMachineImages /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1329,7 +1329,7 @@ public virtual Response GetVirtualMachineImagesEdgeZone(Sub /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1358,7 +1358,7 @@ public virtual AsyncPageable GetVirtualMachineImagesEdg /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1387,7 +1387,7 @@ public virtual Pageable GetVirtualMachineImagesEdgeZone /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1420,7 +1420,7 @@ public virtual AsyncPageable GetOffersVirtualMachineIma /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1453,7 +1453,7 @@ public virtual Pageable GetOffersVirtualMachineImagesEd /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1484,7 +1484,7 @@ public virtual AsyncPageable GetPublishersVirtualMachin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1515,7 +1515,7 @@ public virtual Pageable GetPublishersVirtualMachineImag /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1550,7 +1550,7 @@ public virtual AsyncPageable GetVirtualMachineImageEdge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -1585,7 +1585,7 @@ public virtual Pageable GetVirtualMachineImageEdgeZoneS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1616,7 +1616,7 @@ public virtual AsyncPageable GetAvailabilitySetsAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1647,7 +1647,7 @@ public virtual Pageable GetAvailabilitySets(string expa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1677,7 +1677,7 @@ public virtual AsyncPageable GetProximityPlacem /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1707,7 +1707,7 @@ public virtual Pageable GetProximityPlacementGr /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1737,7 +1737,7 @@ public virtual AsyncPageable GetDedicatedHostGroupsA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1767,7 +1767,7 @@ public virtual Pageable GetDedicatedHostGroups(Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1797,7 +1797,7 @@ public virtual AsyncPageable GetSshPublicKeysAsync(Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1827,7 +1827,7 @@ public virtual Pageable GetSshPublicKeys(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1857,7 +1857,7 @@ public virtual AsyncPageable GetDiskImagesAsync(CancellationT /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1887,7 +1887,7 @@ public virtual Pageable GetDiskImages(CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1917,7 +1917,7 @@ public virtual AsyncPageable GetRestorePointGroupsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1947,7 +1947,7 @@ public virtual Pageable GetRestorePointGroups(Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1979,7 +1979,7 @@ public virtual AsyncPageable GetCapacityReserv /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2011,7 +2011,7 @@ public virtual Pageable GetCapacityReservation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2054,7 +2054,7 @@ public virtual async Task> ExportLogAnalyticsRequestR /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2097,7 +2097,7 @@ public virtual ArmOperation ExportLogAnalyticsRequestRateByInterva /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2140,7 +2140,7 @@ public virtual async Task> ExportLogAnalyticsThrottle /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// @@ -2183,7 +2183,7 @@ public virtual ArmOperation ExportLogAnalyticsThrottledRequests(Wa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2214,7 +2214,7 @@ public virtual AsyncPageable GetVirtualMachineRunCommand /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2245,7 +2245,7 @@ public virtual Pageable GetVirtualMachineRunCommands(Azu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2289,7 +2289,7 @@ public virtual async Task> GetVirtualMachineRunComm /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2333,7 +2333,7 @@ public virtual Response GetVirtualMachineRunCommand(AzureLoc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2363,7 +2363,7 @@ public virtual AsyncPageable GetManagedDisksAsync(Cancellat /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2393,7 +2393,7 @@ public virtual Pageable GetManagedDisks(CancellationToken c /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2423,7 +2423,7 @@ public virtual AsyncPageable GetDiskAccessesAsync(Cancellati /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2453,7 +2453,7 @@ public virtual Pageable GetDiskAccesses(CancellationToken ca /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2483,7 +2483,7 @@ public virtual AsyncPageable GetDiskEncryptionSetsAsy /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2513,7 +2513,7 @@ public virtual Pageable GetDiskEncryptionSets(Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -2543,7 +2543,7 @@ public virtual AsyncPageable GetSnapshotsAsync(CancellationTok /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskCollection.cs index 31ccb43c569f..61f175844d9a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string diskNam /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string diskName, CancellationTo /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellati /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string diskName, Cancellat /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string diskName, CancellationToken cancella /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskResource.cs index f02326a42478..27ff9b604e1f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ManagedDiskResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(WaitUnt /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Man /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -405,7 +405,7 @@ public virtual async Task> GrantAccessAsync(WaitUntil wa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -451,7 +451,7 @@ public virtual ArmOperation GrantAccess(WaitUntil waitUntil, GrantAcc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -493,7 +493,7 @@ public virtual async Task RevokeAccessAsync(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -535,7 +535,7 @@ public virtual ArmOperation RevokeAccess(WaitUntil waitUntil, CancellationToken /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -597,7 +597,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual Response AddTag(string key, string value, Ca /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -716,7 +716,7 @@ public virtual async Task> SetTagsAsync(IDictionar /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -773,7 +773,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -833,7 +833,7 @@ public virtual async Task> RemoveTagAsync(string k /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.Serialization.cs index 8d04d2330c3d..ad7a06ff2402 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.Serialization.cs @@ -80,6 +80,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteEndArray(); } + if (Optional.IsDefined(ScheduledEventsPolicy)) + { + writer.WritePropertyName("scheduledEventsPolicy"u8); + writer.WriteObjectValue(ScheduledEventsPolicy, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -126,6 +131,7 @@ internal static AvailabilitySetPatch DeserializeAvailabilitySetPatch(JsonElement IList virtualMachines = default; WritableSubResource proximityPlacementGroup = default; IReadOnlyList statuses = default; + ScheduledEventsPolicy scheduledEventsPolicy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -217,6 +223,15 @@ internal static AvailabilitySetPatch DeserializeAvailabilitySetPatch(JsonElement statuses = array; continue; } + if (property0.NameEquals("scheduledEventsPolicy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledEventsPolicy = ScheduledEventsPolicy.DeserializeScheduledEventsPolicy(property0.Value, options); + continue; + } } continue; } @@ -234,7 +249,8 @@ internal static AvailabilitySetPatch DeserializeAvailabilitySetPatch(JsonElement platformFaultDomainCount, virtualMachines ?? new ChangeTrackingList(), proximityPlacementGroup, - statuses ?? new ChangeTrackingList()); + statuses ?? new ChangeTrackingList(), + scheduledEventsPolicy); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.cs index 9edd5dde05bd..68d10c002520 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/AvailabilitySetPatch.cs @@ -31,7 +31,8 @@ public AvailabilitySetPatch() /// A list of references to all virtual machines in the availability set. /// Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. /// The resource status information. - internal AvailabilitySetPatch(IDictionary tags, IDictionary serializedAdditionalRawData, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IList virtualMachines, WritableSubResource proximityPlacementGroup, IReadOnlyList statuses) : base(tags, serializedAdditionalRawData) + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. + internal AvailabilitySetPatch(IDictionary tags, IDictionary serializedAdditionalRawData, ComputeSku sku, int? platformUpdateDomainCount, int? platformFaultDomainCount, IList virtualMachines, WritableSubResource proximityPlacementGroup, IReadOnlyList statuses, ScheduledEventsPolicy scheduledEventsPolicy) : base(tags, serializedAdditionalRawData) { Sku = sku; PlatformUpdateDomainCount = platformUpdateDomainCount; @@ -39,6 +40,7 @@ internal AvailabilitySetPatch(IDictionary tags, IDictionary Sku of the availability set. @@ -65,5 +67,7 @@ public ResourceIdentifier ProximityPlacementGroupId /// The resource status information. public IReadOnlyList Statuses { get; } + /// Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the availability set. + public ScheduledEventsPolicy ScheduledEventsPolicy { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupInstanceView.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupInstanceView.cs index dff375d412c1..4d6eaa4fb56d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupInstanceView.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupInstanceView.cs @@ -55,7 +55,7 @@ internal CapacityReservationGroupInstanceView() /// Initializes a new instance of . /// List of instance view of the capacity reservations under the capacity reservation group. - /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// Keeps track of any properties unknown to the library. internal CapacityReservationGroupInstanceView(IReadOnlyList capacityReservations, IReadOnlyList sharedSubscriptionIds, IDictionary serializedAdditionalRawData) { @@ -66,7 +66,7 @@ internal CapacityReservationGroupInstanceView(IReadOnlyList List of instance view of the capacity reservations under the capacity reservation group. public IReadOnlyList CapacityReservations { get; } - /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// List of the subscriptions that the capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. public IReadOnlyList SharedSubscriptionIds { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupPatch.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupPatch.cs index 8287f77a873b..f1946b36a19c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupPatch.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/CapacityReservationGroupPatch.cs @@ -27,7 +27,7 @@ public CapacityReservationGroupPatch() /// A list of all capacity reservation resource ids that belong to capacity reservation group. /// A list of references to all virtual machines associated to the capacity reservation group. /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. internal CapacityReservationGroupPatch(IDictionary tags, IDictionary serializedAdditionalRawData, IReadOnlyList capacityReservations, IReadOnlyList virtualMachinesAssociated, CapacityReservationGroupInstanceView instanceView, ResourceSharingProfile sharingProfile) : base(tags, serializedAdditionalRawData) { CapacityReservations = capacityReservations; @@ -42,9 +42,9 @@ internal CapacityReservationGroupPatch(IDictionary tags, IDictio public IReadOnlyList VirtualMachinesAssociated { get; } /// The capacity reservation group instance view which has the list of instance views for all the capacity reservations that belong to the capacity reservation group. public CapacityReservationGroupInstanceView InstanceView { get; } - /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies the settings to enable sharing across subscriptions for the capacity reservation group resource. Pls. keep in mind the capacity reservation group resource generally can be shared across subscriptions belonging to a single azure AAD tenant or cross AAD tenant if there is a trust relationship established between the AAD tenants. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. internal ResourceSharingProfile SharingProfile { get; set; } - /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. public IList SharingSubscriptionIds { get diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeAllocationStrategy.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeAllocationStrategy.cs new file mode 100644 index 000000000000..bc4e5a2a9fc1 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeAllocationStrategy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the allocation strategy for the virtual machine scale set based on which the VMs will be allocated. + public readonly partial struct ComputeAllocationStrategy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeAllocationStrategy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LowestPriceValue = "LowestPrice"; + private const string CapacityOptimizedValue = "CapacityOptimized"; + + /// LowestPrice. + public static ComputeAllocationStrategy LowestPrice { get; } = new ComputeAllocationStrategy(LowestPriceValue); + /// CapacityOptimized. + public static ComputeAllocationStrategy CapacityOptimized { get; } = new ComputeAllocationStrategy(CapacityOptimizedValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeAllocationStrategy left, ComputeAllocationStrategy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeAllocationStrategy left, ComputeAllocationStrategy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeAllocationStrategy(string value) => new ComputeAllocationStrategy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeAllocationStrategy other && Equals(other); + /// + public bool Equals(ComputeAllocationStrategy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.Serialization.cs index 3fa687b1f362..b0f5bae5c273 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.Serialization.cs @@ -26,21 +26,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsCollectionDefined(ExcludeExtensions)) + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsCollectionDefined(ExcludeExtensionNames)) { writer.WritePropertyName("excludeExtensions"u8); writer.WriteStartArray(); - foreach (var item in ExcludeExtensions) + foreach (var item in ExcludeExtensionNames) { - writer.WriteObjectValue(item, options); + writer.WriteStringValue(item); } writer.WriteEndArray(); } + if (Optional.IsDefined(IsOverridable)) + { + writer.WritePropertyName("isOverridable"u8); + writer.WriteBooleanValue(IsOverridable.Value); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -80,17 +82,14 @@ internal static ComputeSecurityPostureReference DeserializeComputeSecurityPostur return null; } ResourceIdentifier id = default; - IList excludeExtensions = default; + IList excludeExtensions = default; + bool? isOverridable = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } id = new ResourceIdentifier(property.Value.GetString()); continue; } @@ -100,21 +99,30 @@ internal static ComputeSecurityPostureReference DeserializeComputeSecurityPostur { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(VirtualMachineExtensionData.DeserializeVirtualMachineExtensionData(item, options)); + array.Add(item.GetString()); } excludeExtensions = array; continue; } + if (property.NameEquals("isOverridable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOverridable = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ComputeSecurityPostureReference(id, excludeExtensions ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new ComputeSecurityPostureReference(id, excludeExtensions ?? new ChangeTrackingList(), isOverridable, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.cs index f47588301e28..6148d0bbe3aa 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSecurityPostureReference.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Compute.Models { - /// Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01. + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. public partial class ComputeSecurityPostureReference { /// @@ -47,25 +47,34 @@ public partial class ComputeSecurityPostureReference private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public ComputeSecurityPostureReference() + /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest. + /// is null. + public ComputeSecurityPostureReference(ResourceIdentifier id) { - ExcludeExtensions = new ChangeTrackingList(); + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + ExcludeExtensionNames = new ChangeTrackingList(); } /// Initializes a new instance of . - /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. - /// List of virtual machine extensions to exclude when applying the Security Posture. + /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest. + /// The list of virtual machine extension names to exclude when applying the security posture. + /// Whether the security posture can be overridden by the user. /// Keeps track of any properties unknown to the library. - internal ComputeSecurityPostureReference(ResourceIdentifier id, IList excludeExtensions, IDictionary serializedAdditionalRawData) + internal ComputeSecurityPostureReference(ResourceIdentifier id, IList excludeExtensionNames, bool? isOverridable, IDictionary serializedAdditionalRawData) { Id = id; - ExcludeExtensions = excludeExtensions; + ExcludeExtensionNames = excludeExtensionNames; + IsOverridable = isOverridable; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest. + /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest. public ResourceIdentifier Id { get; set; } - /// List of virtual machine extensions to exclude when applying the Security Posture. - public IList ExcludeExtensions { get; } + /// The list of virtual machine extension names to exclude when applying the security posture. + public IList ExcludeExtensionNames { get; } + /// Whether the security posture can be overridden by the user. + public bool? IsOverridable { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.cs new file mode 100644 index 000000000000..fb9cbb4cf502 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the sku profile for the virtual machine scale set. With this property the customer is able to specify a list of VM sizes and an allocation strategy. + public partial class ComputeSkuProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeSkuProfile() + { + VmSizes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Specifies the VM sizes for the virtual machine scale set. + /// Specifies the allocation strategy for the virtual machine scale set based on which the VMs will be allocated. + /// Keeps track of any properties unknown to the library. + internal ComputeSkuProfile(IList vmSizes, ComputeAllocationStrategy? allocationStrategy, IDictionary serializedAdditionalRawData) + { + VmSizes = vmSizes; + AllocationStrategy = allocationStrategy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the VM sizes for the virtual machine scale set. + public IList VmSizes { get; } + /// Specifies the allocation strategy for the virtual machine scale set based on which the VMs will be allocated. + public ComputeAllocationStrategy? AllocationStrategy { get; set; } + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.cs new file mode 100644 index 000000000000..e168e7ba2a44 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the VM Size. + public partial class ComputeSkuProfileVmSize + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeSkuProfileVmSize() + { + } + + /// Initializes a new instance of . + /// Specifies the name of the VM Size. + /// Keeps track of any properties unknown to the library. + internal ComputeSkuProfileVmSize(string name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the name of the VM Size. + public string Name { get; set; } + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/DiskDetachOptionType.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/DiskDetachOptionType.cs index 283917f83b44..2c4acc4d1409 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/DiskDetachOptionType.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/DiskDetachOptionType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Compute.Models { - /// Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values are: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. + /// Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values are: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. public readonly partial struct DiskDetachOptionType : IEquatable { private readonly string _value; diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ProxyAgentSettings.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ProxyAgentSettings.cs index 843352697efc..466c74c47907 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ProxyAgentSettings.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ProxyAgentSettings.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Compute.Models { - /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2023-09-01. public partial class ProxyAgentSettings { /// diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ResourceSharingProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ResourceSharingProfile.cs index 1df1780fe5be..b745ae06b96b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ResourceSharingProfile.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ResourceSharingProfile.cs @@ -53,7 +53,7 @@ public ResourceSharingProfile() } /// Initializes a new instance of . - /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. /// Keeps track of any properties unknown to the library. internal ResourceSharingProfile(IList subscriptionIds, IDictionary serializedAdditionalRawData) { @@ -61,7 +61,7 @@ internal ResourceSharingProfile(IList subscriptionIds, IDic _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2024-03-01. Please refer to https://aka.ms/computereservationsharing for more details. + /// Specifies an array of subscription resource IDs that capacity reservation group is shared with. **Note:** Minimum api-version: 2023-09-01. Please refer to https://aka.ms/computereservationsharing for more details. public IList SubscriptionIds { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.Serialization.cs new file mode 100644 index 000000000000..c51262ccaf2e --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Compute.Models +{ + public partial class SecurityPostureReferenceUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityPostureReferenceUpdate)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(ExcludeExtensions)) + { + writer.WritePropertyName("excludeExtensions"u8); + writer.WriteStartArray(); + foreach (var item in ExcludeExtensions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsOverridable)) + { + writer.WritePropertyName("isOverridable"u8); + writer.WriteBooleanValue(IsOverridable.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SecurityPostureReferenceUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecurityPostureReferenceUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecurityPostureReferenceUpdate(document.RootElement, options); + } + + internal static SecurityPostureReferenceUpdate DeserializeSecurityPostureReferenceUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IList excludeExtensions = default; + bool? isOverridable = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("excludeExtensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + excludeExtensions = array; + continue; + } + if (property.NameEquals("isOverridable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOverridable = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecurityPostureReferenceUpdate(id, excludeExtensions ?? new ChangeTrackingList(), isOverridable, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SecurityPostureReferenceUpdate)} does not support writing '{options.Format}' format."); + } + } + + SecurityPostureReferenceUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecurityPostureReferenceUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecurityPostureReferenceUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.cs new file mode 100644 index 000000000000..d47cb1dbfa55 --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityPostureReferenceUpdate.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. + public partial class SecurityPostureReferenceUpdate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SecurityPostureReferenceUpdate() + { + ExcludeExtensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest. + /// The list of virtual machine extension names to exclude when applying the security posture. + /// Whether the security posture can be overridden by the user. + /// Keeps track of any properties unknown to the library. + internal SecurityPostureReferenceUpdate(string id, IList excludeExtensions, bool? isOverridable, IDictionary serializedAdditionalRawData) + { + Id = id; + ExcludeExtensions = excludeExtensions; + IsOverridable = isOverridable; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The security posture reference id in the form of /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|latest. + public string Id { get; set; } + /// The list of virtual machine extension names to exclude when applying the security posture. + public IList ExcludeExtensions { get; } + /// Whether the security posture can be overridden by the user. + public bool? IsOverridable { get; set; } + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityProfile.cs index f0b45a15b153..7967290893ca 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityProfile.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/SecurityProfile.cs @@ -55,7 +55,7 @@ public SecurityProfile() /// This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself. The default behavior is: The Encryption at host will be disabled unless this property is set to true for the resource. /// Specifies the SecurityType of the virtual machine. It has to be set to any specified value to enable UefiSettings. The default behavior is: UefiSettings will not be enabled unless this property is set. /// Specifies the Managed Identity used by ADE to get access token for keyvault operations. - /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2023-09-01. /// Keeps track of any properties unknown to the library. internal SecurityProfile(UefiSettings uefiSettings, bool? encryptionAtHost, SecurityType? securityType, EncryptionIdentity encryptionIdentity, ProxyAgentSettings proxyAgentSettings, IDictionary serializedAdditionalRawData) { @@ -87,7 +87,7 @@ public string UserAssignedIdentityResourceId } } - /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2024-03-01. + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum api-version: 2023-09-01. public ProxyAgentSettings ProxyAgentSettings { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.Serialization.cs index 19cbebc2346f..5cd28542f03a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.Serialization.cs @@ -43,6 +43,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("identity"u8); JsonSerializer.Serialize(writer, Identity); } + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -116,6 +126,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("resiliencyPolicy"u8); writer.WriteObjectValue(ResiliencyPolicy, options); } + if (Optional.IsDefined(ZonalPlatformFaultDomainAlignMode)) + { + writer.WritePropertyName("zonalPlatformFaultDomainAlignMode"u8); + writer.WriteStringValue(ZonalPlatformFaultDomainAlignMode.Value.ToString()); + } + if (Optional.IsDefined(SkuProfile)) + { + writer.WritePropertyName("skuProfile"u8); + writer.WriteObjectValue(SkuProfile, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -158,6 +178,7 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat ComputeSku sku = default; ComputePlan plan = default; ManagedServiceIdentity identity = default; + IList zones = default; IDictionary tags = default; VirtualMachineScaleSetUpgradePolicy upgradePolicy = default; AutomaticRepairsPolicy automaticRepairsPolicy = default; @@ -171,6 +192,8 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy = default; SpotRestorePolicy spotRestorePolicy = default; ResiliencyPolicy resiliencyPolicy = default; + ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode = default; + ComputeSkuProfile skuProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -202,6 +225,20 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat identity = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -333,6 +370,24 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat resiliencyPolicy = ResiliencyPolicy.DeserializeResiliencyPolicy(property0.Value, options); continue; } + if (property0.NameEquals("zonalPlatformFaultDomainAlignMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zonalPlatformFaultDomainAlignMode = new ZonalPlatformFaultDomainAlignMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("skuProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skuProfile = ComputeSkuProfile.DeserializeComputeSkuProfile(property0.Value, options); + continue; + } } continue; } @@ -348,6 +403,7 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat sku, plan, identity, + zones ?? new ChangeTrackingList(), upgradePolicy, automaticRepairsPolicy, virtualMachineProfile, @@ -359,7 +415,9 @@ internal static VirtualMachineScaleSetPatch DeserializeVirtualMachineScaleSetPat proximityPlacementGroup, priorityMixPolicy, spotRestorePolicy, - resiliencyPolicy); + resiliencyPolicy, + zonalPlatformFaultDomainAlignMode, + skuProfile); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.cs index adb2a217df60..b68cbbcdb156 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetPatch.cs @@ -19,6 +19,7 @@ public partial class VirtualMachineScaleSetPatch : ComputeResourcePatch /// Initializes a new instance of . public VirtualMachineScaleSetPatch() { + Zones = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -27,6 +28,7 @@ public VirtualMachineScaleSetPatch() /// The virtual machine scale set sku. /// The purchase plan when deploying a virtual machine scale set from VM Marketplace images. /// The identity of the virtual machine scale set, if configured. + /// The virtual machine scale set zones. /// The upgrade policy. /// Policy for automatic repairs. /// The virtual machine profile. @@ -39,11 +41,14 @@ public VirtualMachineScaleSetPatch() /// Specifies the desired targets for mixing Spot and Regular priority VMs within the same VMSS Flex instance. /// Specifies the Spot Restore properties for the virtual machine scale set. /// Policy for Resiliency. - internal VirtualMachineScaleSetPatch(IDictionary tags, IDictionary serializedAdditionalRawData, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, VirtualMachineScaleSetUpgradePolicy upgradePolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetUpdateVmProfile virtualMachineProfile, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, bool? singlePlacementGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, WritableSubResource proximityPlacementGroup, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, SpotRestorePolicy spotRestorePolicy, ResiliencyPolicy resiliencyPolicy) : base(tags, serializedAdditionalRawData) + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + /// Specifies the sku profile for the virtual machine scale set. + internal VirtualMachineScaleSetPatch(IDictionary tags, IDictionary serializedAdditionalRawData, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IList zones, VirtualMachineScaleSetUpgradePolicy upgradePolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetUpdateVmProfile virtualMachineProfile, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, bool? singlePlacementGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, WritableSubResource proximityPlacementGroup, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, SpotRestorePolicy spotRestorePolicy, ResiliencyPolicy resiliencyPolicy, ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode, ComputeSkuProfile skuProfile) : base(tags, serializedAdditionalRawData) { Sku = sku; Plan = plan; Identity = identity; + Zones = zones; UpgradePolicy = upgradePolicy; AutomaticRepairsPolicy = automaticRepairsPolicy; VirtualMachineProfile = virtualMachineProfile; @@ -56,6 +61,8 @@ internal VirtualMachineScaleSetPatch(IDictionary tags, IDictiona PriorityMixPolicy = priorityMixPolicy; SpotRestorePolicy = spotRestorePolicy; ResiliencyPolicy = resiliencyPolicy; + ZonalPlatformFaultDomainAlignMode = zonalPlatformFaultDomainAlignMode; + SkuProfile = skuProfile; } /// The virtual machine scale set sku. @@ -64,6 +71,8 @@ internal VirtualMachineScaleSetPatch(IDictionary tags, IDictiona public ComputePlan Plan { get; set; } /// The identity of the virtual machine scale set, if configured. public ManagedServiceIdentity Identity { get; set; } + /// The virtual machine scale set zones. + public IList Zones { get; } /// The upgrade policy. public VirtualMachineScaleSetUpgradePolicy UpgradePolicy { get; set; } /// Policy for automatic repairs. @@ -100,5 +109,9 @@ public ResourceIdentifier ProximityPlacementGroupId public SpotRestorePolicy SpotRestorePolicy { get; set; } /// Policy for Resiliency. public ResiliencyPolicy ResiliencyPolicy { get; set; } + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + public ZonalPlatformFaultDomainAlignMode? ZonalPlatformFaultDomainAlignMode { get; set; } + /// Specifies the sku profile for the virtual machine scale set. + public ComputeSkuProfile SkuProfile { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.Serialization.cs index 550b33eee820..edd5928a0d20 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.Serialization.cs @@ -41,6 +41,11 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WritePropertyName("networkProfile"u8); writer.WriteObjectValue(NetworkProfile, options); } + if (Optional.IsDefined(SecurityPostureReference)) + { + writer.WritePropertyName("securityPostureReference"u8); + writer.WriteObjectValue(SecurityPostureReference, options); + } if (Optional.IsDefined(SecurityProfile)) { writer.WritePropertyName("securityProfile"u8); @@ -122,6 +127,7 @@ internal static VirtualMachineScaleSetUpdateVmProfile DeserializeVirtualMachineS VirtualMachineScaleSetUpdateOSProfile osProfile = default; VirtualMachineScaleSetUpdateStorageProfile storageProfile = default; VirtualMachineScaleSetUpdateNetworkProfile networkProfile = default; + SecurityPostureReferenceUpdate securityPostureReference = default; SecurityProfile securityProfile = default; DiagnosticsProfile diagnosticsProfile = default; VirtualMachineScaleSetExtensionProfile extensionProfile = default; @@ -161,6 +167,15 @@ internal static VirtualMachineScaleSetUpdateVmProfile DeserializeVirtualMachineS networkProfile = VirtualMachineScaleSetUpdateNetworkProfile.DeserializeVirtualMachineScaleSetUpdateNetworkProfile(property.Value, options); continue; } + if (property.NameEquals("securityPostureReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityPostureReference = SecurityPostureReferenceUpdate.DeserializeSecurityPostureReferenceUpdate(property.Value, options); + continue; + } if (property.NameEquals("securityProfile"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -235,6 +250,7 @@ internal static VirtualMachineScaleSetUpdateVmProfile DeserializeVirtualMachineS osProfile, storageProfile, networkProfile, + securityPostureReference, securityProfile, diagnosticsProfile, extensionProfile, diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.cs index f5c7d33a5f37..2077a6e9ebca 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetUpdateVmProfile.cs @@ -54,6 +54,7 @@ public VirtualMachineScaleSetUpdateVmProfile() /// The virtual machine scale set OS profile. /// The virtual machine scale set storage profile. /// The virtual machine scale set network profile. + /// The virtual machine scale set security posture reference. /// The virtual machine scale set Security profile. /// The virtual machine scale set diagnostics profile. /// The virtual machine scale set extension profile. @@ -63,11 +64,12 @@ public VirtualMachineScaleSetUpdateVmProfile() /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. /// Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. /// Keeps track of any properties unknown to the library. - internal VirtualMachineScaleSetUpdateVmProfile(VirtualMachineScaleSetUpdateOSProfile osProfile, VirtualMachineScaleSetUpdateStorageProfile storageProfile, VirtualMachineScaleSetUpdateNetworkProfile networkProfile, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, VirtualMachineScaleSetExtensionProfile extensionProfile, string licenseType, BillingProfile billingProfile, ComputeScheduledEventsProfile scheduledEventsProfile, string userData, VirtualMachineScaleSetHardwareProfile hardwareProfile, IDictionary serializedAdditionalRawData) + internal VirtualMachineScaleSetUpdateVmProfile(VirtualMachineScaleSetUpdateOSProfile osProfile, VirtualMachineScaleSetUpdateStorageProfile storageProfile, VirtualMachineScaleSetUpdateNetworkProfile networkProfile, SecurityPostureReferenceUpdate securityPostureReference, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, VirtualMachineScaleSetExtensionProfile extensionProfile, string licenseType, BillingProfile billingProfile, ComputeScheduledEventsProfile scheduledEventsProfile, string userData, VirtualMachineScaleSetHardwareProfile hardwareProfile, IDictionary serializedAdditionalRawData) { OSProfile = osProfile; StorageProfile = storageProfile; NetworkProfile = networkProfile; + SecurityPostureReference = securityPostureReference; SecurityProfile = securityProfile; DiagnosticsProfile = diagnosticsProfile; ExtensionProfile = extensionProfile; @@ -85,6 +87,8 @@ internal VirtualMachineScaleSetUpdateVmProfile(VirtualMachineScaleSetUpdateOSPro public VirtualMachineScaleSetUpdateStorageProfile StorageProfile { get; set; } /// The virtual machine scale set network profile. public VirtualMachineScaleSetUpdateNetworkProfile NetworkProfile { get; set; } + /// The virtual machine scale set security posture reference. + public SecurityPostureReferenceUpdate SecurityPostureReference { get; set; } /// The virtual machine scale set Security profile. public SecurityProfile SecurityProfile { get; set; } /// The virtual machine scale set diagnostics profile. diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmProfile.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmProfile.cs index 732c9ab548fd..16ad90ac6f29 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmProfile.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/VirtualMachineScaleSetVmProfile.cs @@ -69,8 +69,8 @@ public VirtualMachineScaleSetVmProfile() /// Specifies the gallery applications that should be made available to the VM/VMSS. /// Specifies the hardware profile related details of a scale set. Minimum api-version: 2021-11-01. /// Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. Minimum api-version: 2022-11-01. - /// Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01. - /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. Minimum API version for this property is 2024-03-01. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile with minimum api-version 2024-03-01. + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile. Minimum API version for this property is 2023-09-01. /// Keeps track of any properties unknown to the library. internal VirtualMachineScaleSetVmProfile(VirtualMachineScaleSetOSProfile osProfile, VirtualMachineScaleSetStorageProfile storageProfile, VirtualMachineScaleSetNetworkProfile networkProfile, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, VirtualMachineScaleSetExtensionProfile extensionProfile, string licenseType, VirtualMachinePriorityType? priority, VirtualMachineEvictionPolicyType? evictionPolicy, BillingProfile billingProfile, ComputeScheduledEventsProfile scheduledEventsProfile, string userData, CapacityReservationProfile capacityReservation, ApplicationProfile applicationProfile, VirtualMachineScaleSetHardwareProfile hardwareProfile, WritableSubResource serviceArtifactReference, ComputeSecurityPostureReference securityPostureReference, DateTimeOffset? timeCreated, IDictionary serializedAdditionalRawData) { @@ -198,9 +198,9 @@ public ResourceIdentifier ServiceArtifactReferenceId } } - /// Specifies the security posture to be used for all virtual machines in the scale set. Minimum api-version: 2023-03-01. + /// Specifies the security posture to be used in the scale set. Minimum api-version: 2023-03-01. public ComputeSecurityPostureReference SecurityPostureReference { get; set; } - /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. Minimum API version for this property is 2024-03-01. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile with minimum api-version 2024-03-01. + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set was created. This value will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile. Minimum API version for this property is 2023-09-01. public DateTimeOffset? TimeCreated { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.Serialization.cs index 75b32d96ef02..0ad893191495 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.Serialization.cs @@ -61,7 +61,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("winRM"u8); writer.WriteObjectValue(WinRM, options); } - if (Optional.IsDefined(IsVmAgentPlatformUpdatesEnabled)) + if (options.Format != "W" && Optional.IsDefined(IsVmAgentPlatformUpdatesEnabled)) { writer.WritePropertyName("enableVMAgentPlatformUpdates"u8); writer.WriteBooleanValue(IsVmAgentPlatformUpdatesEnabled.Value); diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.cs index 92a91f084f9b..cfe33b82150d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/WindowsConfiguration.cs @@ -58,7 +58,7 @@ public WindowsConfiguration() /// Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. /// [Preview Feature] Specifies settings related to VM Guest Patching on Windows. /// Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. - /// Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. + /// Indicates whether VMAgent Platform Updates are enabled for the Windows Virtual Machine. /// Keeps track of any properties unknown to the library. internal WindowsConfiguration(bool? provisionVmAgent, bool? isAutomaticUpdatesEnabled, string timeZone, IList additionalUnattendContent, PatchSettings patchSettings, WinRMConfiguration winRM, bool? isVmAgentPlatformUpdatesEnabled, IDictionary serializedAdditionalRawData) { @@ -94,8 +94,5 @@ public IList WinRMListeners return WinRM.Listeners; } } - - /// Indicates whether VMAgent Platform Updates is enabled for the Windows virtual machine. Default value is false. - public bool? IsVmAgentPlatformUpdatesEnabled { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs new file mode 100644 index 000000000000..d1f59a70f8fb --- /dev/null +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ZonalPlatformFaultDomainAlignMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Compute.Models +{ + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + public readonly partial struct ZonalPlatformFaultDomainAlignMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ZonalPlatformFaultDomainAlignMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AlignedValue = "Aligned"; + private const string UnalignedValue = "Unaligned"; + + /// Aligned. + public static ZonalPlatformFaultDomainAlignMode Aligned { get; } = new ZonalPlatformFaultDomainAlignMode(AlignedValue); + /// Unaligned. + public static ZonalPlatformFaultDomainAlignMode Unaligned { get; } = new ZonalPlatformFaultDomainAlignMode(UnalignedValue); + /// Determines if two values are the same. + public static bool operator ==(ZonalPlatformFaultDomainAlignMode left, ZonalPlatformFaultDomainAlignMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ZonalPlatformFaultDomainAlignMode left, ZonalPlatformFaultDomainAlignMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ZonalPlatformFaultDomainAlignMode(string value) => new ZonalPlatformFaultDomainAlignMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ZonalPlatformFaultDomainAlignMode other && Equals(other); + /// + public bool Equals(ZonalPlatformFaultDomainAlignMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupCollection.cs index a3b7e8229c9b..4752c0c434ec 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(string proximityPla /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(CancellationToke /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -363,7 +363,7 @@ public virtual async Task> ExistsAsync(string proximityPlacementG /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response Exists(string proximityPlacementGroupName, string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -453,7 +453,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupResource.cs index 6ec7f061d3f4..785fe0b0d9ab 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/ProximityPlacementGroupResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(string includeColoc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -273,7 +273,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -357,7 +357,7 @@ public virtual Response Update(ProximityPlaceme /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -419,7 +419,7 @@ public virtual async Task> AddTagAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -481,7 +481,7 @@ public virtual Response AddTag(string key, stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -538,7 +538,7 @@ public virtual async Task> SetTagsAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -595,7 +595,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -655,7 +655,7 @@ public virtual async Task> RemoveTagAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/AvailabilitySetsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/AvailabilitySetsRestOperations.cs index 1b586890c4c9..b38415e8e3a3 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/AvailabilitySetsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/AvailabilitySetsRestOperations.cs @@ -32,7 +32,7 @@ public AvailabilitySetsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationGroupsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationGroupsRestOperations.cs index dfa363041b77..0a19b9fcfb31 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationGroupsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationGroupsRestOperations.cs @@ -32,7 +32,7 @@ public CapacityReservationGroupsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationsRestOperations.cs index ea5afd4d3a72..2d8185a69f0b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/CapacityReservationsRestOperations.cs @@ -32,7 +32,7 @@ public CapacityReservationsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostGroupsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostGroupsRestOperations.cs index 6ad5e32ba5cc..767261bf2c32 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostGroupsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostGroupsRestOperations.cs @@ -32,7 +32,7 @@ public DedicatedHostGroupsRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostsRestOperations.cs index ffe6ac8342fa..245098e6b363 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DedicatedHostsRestOperations.cs @@ -32,7 +32,7 @@ public DedicatedHostsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskAccessesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskAccessesRestOperations.cs index f247b82c397b..623d76107872 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskAccessesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskAccessesRestOperations.cs @@ -32,7 +32,7 @@ public DiskAccessesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-02"; + _apiVersion = apiVersion ?? "2024-03-02"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskEncryptionSetsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskEncryptionSetsRestOperations.cs index 87602226244a..44f6701786f4 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskEncryptionSetsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskEncryptionSetsRestOperations.cs @@ -32,7 +32,7 @@ public DiskEncryptionSetsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-02"; + _apiVersion = apiVersion ?? "2024-03-02"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskRestorePointRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskRestorePointRestOperations.cs index 10e294f74669..fdf3f9733b70 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskRestorePointRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DiskRestorePointRestOperations.cs @@ -32,7 +32,7 @@ public DiskRestorePointRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-02"; + _apiVersion = apiVersion ?? "2024-03-02"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DisksRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DisksRestOperations.cs index 2c3b4e2485ba..dc0b3d627e7f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DisksRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/DisksRestOperations.cs @@ -32,7 +32,7 @@ public DisksRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-02"; + _apiVersion = apiVersion ?? "2024-03-02"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ImagesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ImagesRestOperations.cs index 95128bc8f0af..cd2b9b649e68 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ImagesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ImagesRestOperations.cs @@ -32,7 +32,7 @@ public ImagesRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/LogAnalyticsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/LogAnalyticsRestOperations.cs index 5b0735600c03..50ecd872d28e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/LogAnalyticsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/LogAnalyticsRestOperations.cs @@ -31,7 +31,7 @@ public LogAnalyticsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ProximityPlacementGroupsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ProximityPlacementGroupsRestOperations.cs index 0d610f627ed9..4983d25e5003 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ProximityPlacementGroupsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/ProximityPlacementGroupsRestOperations.cs @@ -32,7 +32,7 @@ public ProximityPlacementGroupsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointCollectionsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointCollectionsRestOperations.cs index 3b2175fd2cb3..4bcb21becb3b 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointCollectionsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointCollectionsRestOperations.cs @@ -32,7 +32,7 @@ public RestorePointCollectionsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointsRestOperations.cs index 64bdec25596b..7d6a929e4709 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/RestorePointsRestOperations.cs @@ -32,7 +32,7 @@ public RestorePointsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SnapshotsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SnapshotsRestOperations.cs index 23de2a0699df..5399c3b06534 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SnapshotsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SnapshotsRestOperations.cs @@ -32,7 +32,7 @@ public SnapshotsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-02"; + _apiVersion = apiVersion ?? "2024-03-02"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SshPublicKeysRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SshPublicKeysRestOperations.cs index b24a2f6ba32e..4b71337e703a 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SshPublicKeysRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/SshPublicKeysRestOperations.cs @@ -32,7 +32,7 @@ public SshPublicKeysRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/UsageRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/UsageRestOperations.cs index 96f0cbabe61b..f4250b8b29de 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/UsageRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/UsageRestOperations.cs @@ -32,7 +32,7 @@ public UsageRestOperations(HttpPipeline pipeline, string applicationId, Uri endp { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionImagesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionImagesRestOperations.cs index 6223780f8c17..141d39fa96ac 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionImagesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionImagesRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineExtensionImagesRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionsRestOperations.cs index 785f349eeb1f..04cbbe0fdfe9 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineExtensionsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineExtensionsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesEdgeZoneRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesEdgeZoneRestOperations.cs index e4f069044c7b..6195fc3e8b38 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesEdgeZoneRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesEdgeZoneRestOperations.cs @@ -33,7 +33,7 @@ public VirtualMachineImagesEdgeZoneRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs index a8d18646504b..c277e671b4bc 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineImagesRestOperations.cs @@ -33,7 +33,7 @@ public VirtualMachineImagesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineRunCommandsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineRunCommandsRestOperations.cs index dfeb827f71e0..9126e918b47e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineRunCommandsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineRunCommandsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineRunCommandsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetExtensionsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetExtensionsRestOperations.cs index 6a46adc62e3a..ff18fda3756f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetExtensionsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetExtensionsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineScaleSetExtensionsRestOperations(HttpPipeline pipeline, str { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetRollingUpgradesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetRollingUpgradesRestOperations.cs index e2eb19c32a0b..050e9a94fbd0 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetRollingUpgradesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetRollingUpgradesRestOperations.cs @@ -31,7 +31,7 @@ public VirtualMachineScaleSetRollingUpgradesRestOperations(HttpPipeline pipeline { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMExtensionsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMExtensionsRestOperations.cs index 246270f7ee8f..811577aae8a0 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMExtensionsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMExtensionsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineScaleSetVMExtensionsRestOperations(HttpPipeline pipeline, s { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMRunCommandsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMRunCommandsRestOperations.cs index 56a0a3d416b4..a0503c642765 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMRunCommandsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMRunCommandsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineScaleSetVMRunCommandsRestOperations(HttpPipeline pipeline, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMsRestOperations.cs index 8b5289841d25..11830c19b588 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetVMsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineScaleSetVMsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetsRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetsRestOperations.cs index 9784bf894a61..aad3198cf2d5 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetsRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineScaleSetsRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineScaleSetsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs index f86d207e5715..065bdec13f2c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachineSizesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachinesRestOperations.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachinesRestOperations.cs index 7498b0c682a2..b73fbaea9e2f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachinesRestOperations.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestOperations/VirtualMachinesRestOperations.cs @@ -32,7 +32,7 @@ public VirtualMachinesRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-01"; + _apiVersion = apiVersion ?? "2024-07-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -850,7 +850,7 @@ internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resou /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// The name of the resource group. /// The name of the virtual machine. - /// Optional parameter to hibernate a virtual machine. (Feature in Preview). + /// Optional parameter to hibernate a virtual machine. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -876,7 +876,7 @@ public async Task DeallocateAsync(string subscriptionId, string resour /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. /// The name of the resource group. /// The name of the virtual machine. - /// Optional parameter to hibernate a virtual machine. (Feature in Preview). + /// Optional parameter to hibernate a virtual machine. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointCollection.cs index a1409486aec9..57f90a98b43d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointCollection.cs @@ -62,7 +62,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -111,7 +111,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -160,7 +160,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -206,7 +206,7 @@ public virtual async Task> GetAsync(string restor /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string restorePointName, Resto /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -296,7 +296,7 @@ public virtual async Task> ExistsAsync(string restorePointName, R /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -340,7 +340,7 @@ public virtual Response Exists(string restorePointName, RestorePointExpand /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -386,7 +386,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupCollection.cs index 846b6473f2a1..285fb9ca8b33 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(string r /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(string restorePointGroupN /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(Cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual Pageable GetAll(CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string restorePointGroupNa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string restorePointGroupName, RestorePointG /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs index ade5535b3ace..0722cec7d663 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointGroupResource.cs @@ -110,7 +110,7 @@ public virtual RestorePointCollection GetRestorePoints() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetRestorePointAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -174,7 +174,7 @@ public virtual Response GetRestorePoint(string restorePoin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> GetAsync(RestoreP /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(RestorePointGroupExpand? /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -298,7 +298,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -340,7 +340,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> UpdateAsync(Resto /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -424,7 +424,7 @@ public virtual Response Update(RestorePointGroupPatch /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -486,7 +486,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -548,7 +548,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -605,7 +605,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -662,7 +662,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -722,7 +722,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs index a0dfe79c5edd..96d839766abb 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/RestorePointResource.cs @@ -109,7 +109,7 @@ public virtual DiskRestorePointCollection GetDiskRestorePoints() /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task> GetDiskRestorePoin /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -171,7 +171,7 @@ public virtual Response GetDiskRestorePoint(string dis /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(RestorePointE /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(RestorePointExpand? expand = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -295,7 +295,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -337,7 +337,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -383,7 +383,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotCollection.cs index 4c826c0fbb67..bf4629501942 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsync(Wa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string snapshotNa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string snapshotName, CancellationT /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken can /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellationT /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string snapshotName, Cance /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string snapshotName, CancellationToken canc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsync(s /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotResource.cs index d2ea6fc743cb..0cf569fa8f56 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SnapshotResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationToke /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(WaitUntil /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Snapsh /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -405,7 +405,7 @@ public virtual async Task> GrantAccessAsync(WaitUntil wa /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -451,7 +451,7 @@ public virtual ArmOperation GrantAccess(WaitUntil waitUntil, GrantAcc /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -493,7 +493,7 @@ public virtual async Task RevokeAccessAsync(WaitUntil waitUntil, C /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -535,7 +535,7 @@ public virtual ArmOperation RevokeAccess(WaitUntil waitUntil, CancellationToken /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -597,7 +597,7 @@ public virtual async Task> AddTagAsync(string key, st /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual Response AddTag(string key, string value, Cance /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -716,7 +716,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -773,7 +773,7 @@ public virtual Response SetTags(IDictionary ta /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource @@ -833,7 +833,7 @@ public virtual async Task> RemoveTagAsync(string key, /// /// /// Default Api Version - /// 2023-10-02 + /// 2024-03-02 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyCollection.cs index 4489400b18f2..c7f1c3b56399 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string sshPub /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string sshPublicKeyName, Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string sshPublicKeyName, C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string sshPublicKeyName, CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyResource.cs index 3971c1fe43c2..53666c45338c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/SshPublicKeyResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(SshPublicK /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual Response Update(SshPublicKeyPatch patch, Ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -394,7 +394,7 @@ public virtual async Task> GenerateK /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -433,7 +433,7 @@ public virtual Response GenerateKeyPair(SshGe /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -495,7 +495,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -557,7 +557,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -614,7 +614,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -671,7 +671,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -731,7 +731,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineCollection.cs index 565eb3cec043..e0d03bff20a7 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(string vmNa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(string vmName, InstanceViewT /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -292,7 +292,7 @@ public virtual AsyncPageable GetAllAsync(string filter = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -324,7 +324,7 @@ public virtual Pageable GetAll(string filter = null, Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -368,7 +368,7 @@ public virtual async Task> ExistsAsync(string vmName, InstanceVie /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -412,7 +412,7 @@ public virtual Response Exists(string vmName, InstanceViewType? expand = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -458,7 +458,7 @@ public virtual async Task> GetIfExistsA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionCollection.cs index 1f731e7f0ebd..3a4a8801e8de 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateO /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string vmExtensionN /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string expand = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string vmExtensionName, st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string vmExtensionName, string expand = nul /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageCollection.cs index fd7bf6bdb16a..d4bd17aaf952 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageCollection.cs @@ -73,7 +73,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -120,7 +120,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual Response Get(string type, s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -196,7 +196,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -262,7 +262,7 @@ public virtual AsyncPageable GetAllAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -299,7 +299,7 @@ public virtual Pageable GetAll(string type /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -344,7 +344,7 @@ public virtual async Task> ExistsAsync(string type, string versio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -389,7 +389,7 @@ public virtual Response Exists(string type, string version, CancellationTo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -436,7 +436,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageResource.cs index 0a0254d169dd..45c4be707486 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionImageResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionResource.cs index e2786223dd66..166e3281a371 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineExtensionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(string expand = nul /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> UpdateA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil wa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, stri /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs index 4efc50bb46b0..11582832989d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineResource.cs @@ -111,7 +111,7 @@ public virtual VirtualMachineExtensionCollection GetVirtualMachineExtensions() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetVirtualM /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual VirtualMachineRunCommandCollection GetVirtualMachineRunCommands() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetVirtual /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -246,7 +246,7 @@ public virtual Response GetVirtualMachineRunCo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual async Task> GetAsync(InstanceVie /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -328,7 +328,7 @@ public virtual Response Get(InstanceViewType? expand = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -371,7 +371,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -414,7 +414,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceDeletion = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -462,7 +462,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -510,7 +510,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -556,7 +556,7 @@ public virtual async Task> CaptureAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -602,7 +602,7 @@ public virtual ArmOperation Capture(WaitUntil waitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -640,7 +640,7 @@ public virtual async Task> InstanceViewAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -678,7 +678,7 @@ public virtual Response InstanceView(CancellationTok /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -720,7 +720,7 @@ public virtual async Task ConvertToManagedDisksAsync(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -762,7 +762,7 @@ public virtual ArmOperation ConvertToManagedDisks(WaitUntil waitUntil, Cancellat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -771,7 +771,7 @@ public virtual ArmOperation ConvertToManagedDisks(WaitUntil waitUntil, Cancellat /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Optional parameter to hibernate a virtual machine. (Feature in Preview). + /// Optional parameter to hibernate a virtual machine. /// The cancellation token to use. public virtual async Task DeallocateAsync(WaitUntil waitUntil, bool? hibernate = null, CancellationToken cancellationToken = default) { @@ -805,7 +805,7 @@ public virtual async Task DeallocateAsync(WaitUntil waitUntil, boo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -814,7 +814,7 @@ public virtual async Task DeallocateAsync(WaitUntil waitUntil, boo /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Optional parameter to hibernate a virtual machine. (Feature in Preview). + /// Optional parameter to hibernate a virtual machine. /// The cancellation token to use. public virtual ArmOperation Deallocate(WaitUntil waitUntil, bool? hibernate = null, CancellationToken cancellationToken = default) { @@ -848,7 +848,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, bool? hibernate = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -886,7 +886,7 @@ public virtual async Task GeneralizeAsync(CancellationToken cancellati /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -924,7 +924,7 @@ public virtual Response Generalize(CancellationToken cancellationToken = default /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -953,7 +953,7 @@ public virtual AsyncPageable GetAvailableSizesAsync(Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -982,7 +982,7 @@ public virtual Pageable GetAvailableSizes(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1025,7 +1025,7 @@ public virtual async Task PowerOffAsync(WaitUntil waitUntil, bool? /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1068,7 +1068,7 @@ public virtual ArmOperation PowerOff(WaitUntil waitUntil, bool? skipShutdown = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1110,7 +1110,7 @@ public virtual async Task ReapplyAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1152,7 +1152,7 @@ public virtual ArmOperation Reapply(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1194,7 +1194,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1236,7 +1236,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1278,7 +1278,7 @@ public virtual async Task PowerOnAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1320,7 +1320,7 @@ public virtual ArmOperation PowerOn(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1362,7 +1362,7 @@ public virtual async Task RedeployAsync(WaitUntil waitUntil, Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1404,7 +1404,7 @@ public virtual ArmOperation Redeploy(WaitUntil waitUntil, CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1447,7 +1447,7 @@ public virtual async Task ReimageAsync(WaitUntil waitUntil, Virtua /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1490,7 +1490,7 @@ public virtual ArmOperation Reimage(WaitUntil waitUntil, VirtualMachineReimageCo /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1529,7 +1529,7 @@ public virtual async Task> RetrieveB /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1568,7 +1568,7 @@ public virtual Response RetrieveBootDiagnosti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1610,7 +1610,7 @@ public virtual async Task PerformMaintenanceAsync(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1652,7 +1652,7 @@ public virtual ArmOperation PerformMaintenance(WaitUntil waitUntil, Cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1690,7 +1690,7 @@ public virtual async Task SimulateEvictionAsync(CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1728,7 +1728,7 @@ public virtual Response SimulateEviction(CancellationToken cancellationToken = d /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1770,7 +1770,7 @@ public virtual async Task> Asses /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1812,7 +1812,7 @@ public virtual ArmOperation AssessPatches(Wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1858,7 +1858,7 @@ public virtual async Task> Inst /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1904,7 +1904,7 @@ public virtual ArmOperation InstallPatches(W /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1950,7 +1950,7 @@ public virtual async Task> AttachDeta /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1996,7 +1996,7 @@ public virtual ArmOperation AttachDetachDataDisks( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2042,7 +2042,7 @@ public virtual async Task> RunComma /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2088,7 +2088,7 @@ public virtual ArmOperation RunCommand(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2150,7 +2150,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2212,7 +2212,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2269,7 +2269,7 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2326,7 +2326,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2386,7 +2386,7 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandCollection.cs index 4bf6938237df..25e2de739a5d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string runCommandN /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(string expand = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string runCommandName, str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string runCommandName, string expand = null /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandResource.cs index 65adfa830f12..7713faaa9abf 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineRunCommandResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(string expand = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -361,7 +361,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -423,7 +423,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -485,7 +485,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -542,7 +542,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -599,7 +599,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -659,7 +659,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetCollection.cs index 6b7cf36b8fa4..edd769bb5d4f 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> CreateOr /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -260,7 +260,7 @@ public virtual Response Get(string virtualMachin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -290,7 +290,7 @@ public virtual AsyncPageable GetAllAsync(Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string virtualMachineScale /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string virtualMachineScaleSetName, VirtualM /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetI /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.Serialization.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.Serialization.cs index d77795306647..920f6436ca2c 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.Serialization.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.Serialization.cs @@ -204,6 +204,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("resiliencyPolicy"u8); writer.WriteObjectValue(ResiliencyPolicy, options); } + if (Optional.IsDefined(ZonalPlatformFaultDomainAlignMode)) + { + writer.WritePropertyName("zonalPlatformFaultDomainAlignMode"u8); + writer.WriteStringValue(ZonalPlatformFaultDomainAlignMode.Value.ToString()); + } + if (Optional.IsDefined(SkuProfile)) + { + writer.WritePropertyName("skuProfile"u8); + writer.WriteObjectValue(SkuProfile, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -276,6 +286,8 @@ internal static VirtualMachineScaleSetData DeserializeVirtualMachineScaleSetData DateTimeOffset? timeCreated = default; bool? constrainedMaximumCapacity = default; ResiliencyPolicy resiliencyPolicy = default; + ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode = default; + ComputeSkuProfile skuProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -568,6 +580,24 @@ internal static VirtualMachineScaleSetData DeserializeVirtualMachineScaleSetData resiliencyPolicy = ResiliencyPolicy.DeserializeResiliencyPolicy(property0.Value, options); continue; } + if (property0.NameEquals("zonalPlatformFaultDomainAlignMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zonalPlatformFaultDomainAlignMode = new ZonalPlatformFaultDomainAlignMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("skuProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skuProfile = ComputeSkuProfile.DeserializeComputeSkuProfile(property0.Value, options); + continue; + } } continue; } @@ -611,6 +641,8 @@ internal static VirtualMachineScaleSetData DeserializeVirtualMachineScaleSetData timeCreated, constrainedMaximumCapacity, resiliencyPolicy, + zonalPlatformFaultDomainAlignMode, + skuProfile, serializedAdditionalRawData); } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.cs index be377c04905e..a718cc43b443 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetData.cs @@ -69,7 +69,7 @@ public VirtualMachineScaleSetData(AzureLocation location) : base(location) /// The virtual machine scale set sku. /// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. /// The identity of the virtual machine scale set, if configured. - /// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. + /// The virtual machine scale set zones. /// The extended location of the Virtual Machine Scale Set. /// Etag is property returned in Create/Update/Get response of the VMSS, so that customer can supply it in the header to ensure optimistic updates. /// The upgrade policy. @@ -93,8 +93,10 @@ public VirtualMachineScaleSetData(AzureLocation location) : base(location) /// Specifies the time at which the Virtual Machine Scale Set resource was created. Minimum api-version: 2021-11-01. /// Optional property which must either be set to True or omitted. /// Policy for Resiliency. + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + /// Specifies the sku profile for the virtual machine scale set. /// Keeps track of any properties unknown to the library. - internal VirtualMachineScaleSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IList zones, ExtendedLocation extendedLocation, string etag, VirtualMachineScaleSetUpgradePolicy upgradePolicy, ScheduledEventsPolicy scheduledEventsPolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, WritableSubResource proximityPlacementGroup, WritableSubResource hostGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, OrchestrationMode? orchestrationMode, SpotRestorePolicy spotRestorePolicy, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, ResiliencyPolicy resiliencyPolicy, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal VirtualMachineScaleSetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeSku sku, ComputePlan plan, ManagedServiceIdentity identity, IList zones, ExtendedLocation extendedLocation, string etag, VirtualMachineScaleSetUpgradePolicy upgradePolicy, ScheduledEventsPolicy scheduledEventsPolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVmProfile virtualMachineProfile, string provisioningState, bool? overprovision, bool? doNotRunExtensionsOnOverprovisionedVms, string uniqueId, bool? singlePlacementGroup, bool? zoneBalance, int? platformFaultDomainCount, WritableSubResource proximityPlacementGroup, WritableSubResource hostGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, OrchestrationMode? orchestrationMode, SpotRestorePolicy spotRestorePolicy, VirtualMachineScaleSetPriorityMixPolicy priorityMixPolicy, DateTimeOffset? timeCreated, bool? isMaximumCapacityConstrained, ResiliencyPolicy resiliencyPolicy, ZonalPlatformFaultDomainAlignMode? zonalPlatformFaultDomainAlignMode, ComputeSkuProfile skuProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; Plan = plan; @@ -123,6 +125,8 @@ internal VirtualMachineScaleSetData(ResourceIdentifier id, string name, Resource TimeCreated = timeCreated; IsMaximumCapacityConstrained = isMaximumCapacityConstrained; ResiliencyPolicy = resiliencyPolicy; + ZonalPlatformFaultDomainAlignMode = zonalPlatformFaultDomainAlignMode; + SkuProfile = skuProfile; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -137,7 +141,7 @@ internal VirtualMachineScaleSetData() public ComputePlan Plan { get; set; } /// The identity of the virtual machine scale set, if configured. public ManagedServiceIdentity Identity { get; set; } - /// The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. + /// The virtual machine scale set zones. public IList Zones { get; } /// The extended location of the Virtual Machine Scale Set. public ExtendedLocation ExtendedLocation { get; set; } @@ -209,5 +213,9 @@ public ResourceIdentifier HostGroupId public bool? IsMaximumCapacityConstrained { get; set; } /// Policy for Resiliency. public ResiliencyPolicy ResiliencyPolicy { get; set; } + /// Specifies the align mode between Virtual Machine Scale Set compute and storage Fault Domain count. + public ZonalPlatformFaultDomainAlignMode? ZonalPlatformFaultDomainAlignMode { get; set; } + /// Specifies the sku profile for the virtual machine scale set. + public ComputeSkuProfile SkuProfile { get; set; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionCollection.cs index 6765f5b4444b..dbb48d66abd3 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string vmss /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(Cancella /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string vmssExtensionName, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string vmssExtensionName, string expand = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionResource.cs index 280324ab3e9a..c817a93af965 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetExtensionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(string expa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs index 944e014e6c10..d242f8dfbbaa 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetResource.cs @@ -116,7 +116,7 @@ public virtual VirtualMachineScaleSetExtensionCollection GetVirtualMachineScaleS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -148,7 +148,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -194,7 +194,7 @@ public virtual VirtualMachineScaleSetVmCollection GetVirtualMachineScaleSetVms() /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task> GetVirtual /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -258,7 +258,7 @@ public virtual Response GetVirtualMachineScale /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -299,7 +299,7 @@ public virtual async Task> GetAsync(Vir /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -340,7 +340,7 @@ public virtual Response Get(VirtualMachineScaleS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -383,7 +383,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -426,7 +426,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceDeletion = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -474,7 +474,7 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -522,7 +522,7 @@ public virtual ArmOperation Update(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -566,7 +566,7 @@ public virtual async Task DeallocateAsync(WaitUntil waitUntil, Vir /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -610,7 +610,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, VirtualMachineScaleS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task DeleteInstancesAsync(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -704,7 +704,7 @@ public virtual ArmOperation DeleteInstances(WaitUntil waitUntil, VirtualMachineS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -742,7 +742,7 @@ public virtual async Task> GetInsta /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -780,7 +780,7 @@ public virtual Response GetInstanceView(Canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -810,7 +810,7 @@ public virtual AsyncPageable GetSkusAsync(Cancellatio /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -840,7 +840,7 @@ public virtual Pageable GetSkus(CancellationToken can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -870,7 +870,7 @@ public virtual AsyncPageable GetOSUpgradeH /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -900,7 +900,7 @@ public virtual Pageable GetOSUpgradeHistor /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -944,7 +944,7 @@ public virtual async Task PowerOffAsync(WaitUntil waitUntil, Virtu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -988,7 +988,7 @@ public virtual ArmOperation PowerOff(WaitUntil waitUntil, VirtualMachineScaleSet /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1031,7 +1031,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Virtua /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1074,7 +1074,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, VirtualMachineScaleSetV /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1117,7 +1117,7 @@ public virtual async Task PowerOnAsync(WaitUntil waitUntil, Virtua /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1160,7 +1160,7 @@ public virtual ArmOperation PowerOn(WaitUntil waitUntil, VirtualMachineScaleSetV /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1202,7 +1202,7 @@ public virtual async Task ReapplyAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1244,7 +1244,7 @@ public virtual ArmOperation Reapply(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1287,7 +1287,7 @@ public virtual async Task RedeployAsync(WaitUntil waitUntil, Virtu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1330,7 +1330,7 @@ public virtual ArmOperation Redeploy(WaitUntil waitUntil, VirtualMachineScaleSet /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1373,7 +1373,7 @@ public virtual async Task PerformMaintenanceAsync(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1416,7 +1416,7 @@ public virtual ArmOperation PerformMaintenance(WaitUntil waitUntil, VirtualMachi /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1462,7 +1462,7 @@ public virtual async Task UpdateInstancesAsync(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1508,7 +1508,7 @@ public virtual ArmOperation UpdateInstances(WaitUntil waitUntil, VirtualMachineS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1551,7 +1551,7 @@ public virtual async Task ReimageAsync(WaitUntil waitUntil, Virtua /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1594,7 +1594,7 @@ public virtual ArmOperation Reimage(WaitUntil waitUntil, VirtualMachineScaleSetR /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1637,7 +1637,7 @@ public virtual async Task ReimageAllAsync(WaitUntil waitUntil, Vir /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1680,7 +1680,7 @@ public virtual ArmOperation ReimageAll(WaitUntil waitUntil, VirtualMachineScaleS /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1723,7 +1723,7 @@ public virtual async Task ApproveRollingUpgradeAsync(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1766,7 +1766,7 @@ public virtual ArmOperation ApproveRollingUpgrade(WaitUntil waitUntil, VirtualMa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1807,7 +1807,7 @@ public virtual async Task> ForceRecoveryServiceFa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1848,7 +1848,7 @@ public virtual Response ForceRecoveryServiceFabricPlatform /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1890,7 +1890,7 @@ public virtual async Task ConvertToSinglePlacementGroupAsync(VirtualMa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1932,7 +1932,7 @@ public virtual Response ConvertToSinglePlacementGroup(VirtualMachineScaleSetConv /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1978,7 +1978,7 @@ public virtual async Task SetOrchestrationServiceStateAsync(WaitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2024,7 +2024,7 @@ public virtual ArmOperation SetOrchestrationServiceState(WaitUntil waitUntil, Or /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2066,7 +2066,7 @@ public virtual async Task CancelVirtualMachineScaleSetRollingUpgra /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2108,7 +2108,7 @@ public virtual ArmOperation CancelVirtualMachineScaleSetRollingUpgrade(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2150,7 +2150,7 @@ public virtual async Task StartOSUpgradeAsync(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2192,7 +2192,7 @@ public virtual ArmOperation StartOSUpgrade(WaitUntil waitUntil, CancellationToke /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2234,7 +2234,7 @@ public virtual async Task StartExtensionUpgradeVirtualMachineScale /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2276,7 +2276,7 @@ public virtual ArmOperation StartExtensionUpgradeVirtualMachineScaleSetRollingUp /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2338,7 +2338,7 @@ public virtual async Task> AddTagAsync( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2400,7 +2400,7 @@ public virtual Response AddTag(string key, strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2457,7 +2457,7 @@ public virtual async Task> SetTagsAsync /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2514,7 +2514,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -2574,7 +2574,7 @@ public virtual async Task> RemoveTagAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradeResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradeResource.cs index 97c4ed094976..5cbfe6b8a941 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradeResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetRollingUpgradeResource.cs @@ -100,7 +100,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -140,7 +140,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmCollection.cs index 51e6b4628a68..070f900f0c1d 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> Create /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -259,7 +259,7 @@ public virtual Response Get(string instanceId, /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -292,7 +292,7 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -325,7 +325,7 @@ public virtual Pageable GetAll(string filter = /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -369,7 +369,7 @@ public virtual async Task> ExistsAsync(string instanceId, Instanc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual Response Exists(string instanceId, InstanceViewType? expand /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -459,7 +459,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmData.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmData.cs index cab2e26d9ea3..433eb36304db 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmData.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmData.cs @@ -90,8 +90,8 @@ public VirtualMachineScaleSetVmData(AzureLocation location) : base(location) /// Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15. /// Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. /// Specifies the protection policy of the virtual machine. - /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. - /// Specifies the time at which the Virtual Machine resource was created.<br><br>Minimum api-version: 2021-11-01. + /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. + /// Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. /// Keeps track of any properties unknown to the library. internal VirtualMachineScaleSetVmData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string instanceId, ComputeSku sku, ComputePlan plan, IReadOnlyList resources, IReadOnlyList zones, ManagedServiceIdentity identity, string etag, bool? latestModelApplied, string vmId, VirtualMachineScaleSetVmInstanceView instanceView, VirtualMachineHardwareProfile hardwareProfile, VirtualMachineStorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, VirtualMachineOSProfile osProfile, SecurityProfile securityProfile, VirtualMachineNetworkProfile networkProfile, VirtualMachineScaleSetVmNetworkProfileConfiguration networkProfileConfiguration, DiagnosticsProfile diagnosticsProfile, WritableSubResource availabilitySet, string provisioningState, string licenseType, string modelDefinitionApplied, VirtualMachineScaleSetVmProtectionPolicy protectionPolicy, string userData, DateTimeOffset? timeCreated, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { @@ -209,9 +209,9 @@ public ResourceIdentifier AvailabilitySetId public string ModelDefinitionApplied { get; } /// Specifies the protection policy of the virtual machine. public VirtualMachineScaleSetVmProtectionPolicy ProtectionPolicy { get; set; } - /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. <br><br>Minimum api-version: 2021-03-01. + /// UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01. public string UserData { get; set; } - /// Specifies the time at which the Virtual Machine resource was created.<br><br>Minimum api-version: 2021-11-01. + /// Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01. public DateTimeOffset? TimeCreated { get; } } } diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionCollection.cs index 86a7e9e99c90..4d49e30808cb 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string vm /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string vmExtensionName, st /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string vmExtensionName, string expand = nul /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionResource.cs index 7f43a04d5285..0f1fbe1ca699 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmExtensionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -185,7 +185,7 @@ public virtual Response Get(string ex /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -269,7 +269,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -315,7 +315,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs index de547cf1916c..58ab3d17dd77 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmResource.cs @@ -110,7 +110,7 @@ public virtual VirtualMachineScaleSetVmExtensionCollection GetVirtualMachineScal /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual VirtualMachineScaleSetVmRunCommandCollection GetVirtualMachineSca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -213,7 +213,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -245,7 +245,7 @@ public virtual Response GetVirtualMa /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual async Task> GetAsync(I /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -327,7 +327,7 @@ public virtual Response Get(InstanceViewType? /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -370,7 +370,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -413,7 +413,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceDeletion = nu /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -461,7 +461,7 @@ public virtual async Task> Update /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -509,7 +509,7 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -552,7 +552,7 @@ public virtual async Task ReimageAsync(WaitUntil waitUntil, Virtua /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -595,7 +595,7 @@ public virtual ArmOperation Reimage(WaitUntil waitUntil, VirtualMachineScaleSetV /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -637,7 +637,7 @@ public virtual async Task ReimageAllAsync(WaitUntil waitUntil, Can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -679,7 +679,7 @@ public virtual ArmOperation ReimageAll(WaitUntil waitUntil, CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -721,7 +721,7 @@ public virtual async Task ApproveRollingUpgradeAsync(WaitUntil wai /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -763,7 +763,7 @@ public virtual ArmOperation ApproveRollingUpgrade(WaitUntil waitUntil, Cancellat /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -805,7 +805,7 @@ public virtual async Task DeallocateAsync(WaitUntil waitUntil, Can /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -847,7 +847,7 @@ public virtual ArmOperation Deallocate(WaitUntil waitUntil, CancellationToken ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -885,7 +885,7 @@ public virtual async Task> GetIns /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -923,7 +923,7 @@ public virtual Response GetInstanceView(Ca /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -966,7 +966,7 @@ public virtual async Task PowerOffAsync(WaitUntil waitUntil, bool? /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1009,7 +1009,7 @@ public virtual ArmOperation PowerOff(WaitUntil waitUntil, bool? skipShutdown = n /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1051,7 +1051,7 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1093,7 +1093,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1135,7 +1135,7 @@ public virtual async Task PowerOnAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1177,7 +1177,7 @@ public virtual ArmOperation PowerOn(WaitUntil waitUntil, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1219,7 +1219,7 @@ public virtual async Task RedeployAsync(WaitUntil waitUntil, Cance /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1261,7 +1261,7 @@ public virtual ArmOperation Redeploy(WaitUntil waitUntil, CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1300,7 +1300,7 @@ public virtual async Task> RetrieveB /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1339,7 +1339,7 @@ public virtual Response RetrieveBootDiagnosti /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1381,7 +1381,7 @@ public virtual async Task PerformMaintenanceAsync(WaitUntil waitUn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1423,7 +1423,7 @@ public virtual ArmOperation PerformMaintenance(WaitUntil waitUntil, Cancellation /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1461,7 +1461,7 @@ public virtual async Task SimulateEvictionAsync(CancellationToken canc /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1499,7 +1499,7 @@ public virtual Response SimulateEviction(CancellationToken cancellationToken = d /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1545,7 +1545,7 @@ public virtual async Task> AttachDeta /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1591,7 +1591,7 @@ public virtual ArmOperation AttachDetachDataDisks( /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1637,7 +1637,7 @@ public virtual async Task> RunComma /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1683,7 +1683,7 @@ public virtual ArmOperation RunCommand(WaitUntil /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1740,7 +1740,7 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1797,7 +1797,7 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1853,7 +1853,7 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1909,7 +1909,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -1964,7 +1964,7 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandCollection.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandCollection.cs index b8cd173f63b8..11454781e3b1 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandCollection.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response Get(string r /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -285,7 +285,7 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string runCommandName, str /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -404,7 +404,7 @@ public virtual Response Exists(string runCommandName, string expand = null /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -450,7 +450,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandResource.cs b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandResource.cs index 35a0d64c8a94..ac49ad5d03c2 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandResource.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/src/Generated/VirtualMachineScaleSetVmRunCommandResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -145,7 +145,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -186,7 +186,7 @@ public virtual Response Get(string e /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -228,7 +228,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -362,7 +362,7 @@ public virtual ArmOperation Update(W /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -424,7 +424,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -486,7 +486,7 @@ public virtual Response AddTag(strin /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -543,7 +543,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -600,7 +600,7 @@ public virtual Response SetTags(IDic /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource @@ -660,7 +660,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-01 + /// 2024-07-01 /// /// /// Resource diff --git a/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md b/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md index 8da64715947c..f4a13219b07e 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md +++ b/sdk/compute/Azure.ResourceManager.Compute/src/autorest.md @@ -10,7 +10,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: Compute namespace: Azure.ResourceManager.Compute -require: https://github.com/Azure/azure-rest-api-specs/blob/4e44971c375e4dbb03b75f8c6b91d0bd225f247d/specification/compute/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/4f68529971f845e8757c2b2a746d78ceb91854cd/specification/compute/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -266,7 +266,6 @@ rename-mapping: ScheduledEventsProfile: ComputeScheduledEventsProfile ExpandTypeForListVMs: GetVirtualMachineExpandType ExpandTypesForListVm: GetVirtualMachineExpandType - SecurityPostureReference: ComputeSecurityPostureReference RestorePointSourceVmStorageProfile.dataDisks: DataDiskList SecurityPostureReference.id: -|arm-id CommunityGalleryImage.properties.identifier: ImageIdentifier @@ -277,6 +276,11 @@ rename-mapping: NetworkInterfaceAuxiliaryMode: ComputeNetworkInterfaceAuxiliaryMode CommunityGalleryInfo.publisherUri: PublisherUriString GalleryArtifactVersionFullSource.virtualMachineId: -|arm-id + SecurityPostureReference: ComputeSecurityPostureReference + SecurityPostureReference.excludeExtensions: ExcludeExtensionNames + SkuProfile : ComputeSkuProfile + SkuProfileVMSize : ComputeSkuProfileVMSize + AllocationStrategy : ComputeAllocationStrategy directive: # copy the systemData from common-types here so that it will be automatically replaced diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskCollectionTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskCollectionTests.cs index 529ad3e1be9e..2c176383b654 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskCollectionTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskCollectionTests.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Compute.Tests { - [ClientTestFixture(true, "2022-07-02", "2021-04-01", "2019-07-01")] + [ClientTestFixture(true, "2024-03-02", "2022-07-02", "2021-04-01", "2019-07-01")] public class ManagedDiskCollectionTests : ComputeTestBase { public ManagedDiskCollectionTests(bool isAsync, string apiVersion) diff --git a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs index 95ad9d63c5c6..03ad6425f101 100644 --- a/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs +++ b/sdk/compute/Azure.ResourceManager.Compute/tests/Scenario/ManagedDiskOperationsTests.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Compute.Tests { - [ClientTestFixture(true, "2022-07-02", "2021-04-01", "2019-07-01")] + [ClientTestFixture(true, "2024-03-02", "2022-07-02", "2021-04-01", "2019-07-01")] public class ManagedDiskOperationsTests : ComputeTestBase { public ManagedDiskOperationsTests(bool isAsync, string apiVersion) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Azure.ResourceManager.ComputeFleet.sln b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Azure.ResourceManager.ComputeFleet.sln new file mode 100644 index 000000000000..7a24cf7855ce --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Azure.ResourceManager.ComputeFleet.sln @@ -0,0 +1,65 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30309.148 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{4C116B47-8025-4661-8132-7285E6F6A0E6}") = "Azure.ResourceManager.ComputeFleet", "src\Azure.ResourceManager.ComputeFleet.csproj", "{2C45D581-85D6-4CBF-A13E-AD042A797542}" +EndProject +Project("{4C116B47-8025-4661-8132-7285E6F6A0E6}") = "Azure.ResourceManager.ComputeFleet.Tests", "tests\Azure.ResourceManager.ComputeFleet.Tests.csproj", "{9F3B80CD-FF80-44EC-97AB-E85DC75172E4}" +EndProject +Project("{4C116B47-8025-4661-8132-7285E6F6A0E6}") = "Azure.ResourceManager.ComputeFleet.Samples", "samples\Azure.ResourceManager.ComputeFleet.Samples.csproj", "{0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}" +EndProject +Global + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {679CD23D-054A-44B1-BA43-4ECD5D4DC0D4} + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|x64.ActiveCfg = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|x64.Build.0 = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|x86.ActiveCfg = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Debug|x86.Build.0 = Debug|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|Any CPU.Build.0 = Release|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|x64.ActiveCfg = Release|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|x64.Build.0 = Release|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|x86.ActiveCfg = Release|Any CPU + {2C45D581-85D6-4CBF-A13E-AD042A797542}.Release|x86.Build.0 = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|x64.ActiveCfg = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|x64.Build.0 = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|x86.ActiveCfg = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Debug|x86.Build.0 = Debug|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|Any CPU.Build.0 = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|x64.ActiveCfg = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|x64.Build.0 = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|x86.ActiveCfg = Release|Any CPU + {9F3B80CD-FF80-44EC-97AB-E85DC75172E4}.Release|x86.Build.0 = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|x64.ActiveCfg = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|x64.Build.0 = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|x86.ActiveCfg = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Debug|x86.Build.0 = Debug|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|Any CPU.Build.0 = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|x64.ActiveCfg = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|x64.Build.0 = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|x86.ActiveCfg = Release|Any CPU + {0E6B34B3-AD10-444F-99D5-EC5ADA5E84E0}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md new file mode 100644 index 000000000000..89ec9680b317 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md @@ -0,0 +1,29 @@ +# Release History + +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 1.0.0-beta.1 (2024-08-28) + +- Initial beta version + +### Features Added + +This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). + +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Directory.Build.props b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md new file mode 100644 index 000000000000..222548919800 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure Compute Fleet management client library for .NET + +Azure Compute Fleet is a building block that gives you accelerated access to Azure's capacity in a given region. Compute Fleet launches a combination of virtual machines (VMs) at the lowest price and highest capacity. There are many ways you can use this product, whether by running a stateless web service, a big data cluster, or a Continuous Integration pipeline. Workloads such as financial risk analysis, log processing, or image rendering can benefit from the ability to run hundreds of concurrent core instances. + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure Compute Fleet management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.ComputeFleet --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://docs.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs new file mode 100644 index 000000000000..df5f5a8b381b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs @@ -0,0 +1,1438 @@ +namespace Azure.ResourceManager.ComputeFleet +{ + public partial class ComputeFleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ComputeFleetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.ComputeFleet.ComputeFleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.ComputeFleet.ComputeFleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ComputeFleetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.Models.ArmPlan Plan { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IList Zones { get { throw null; } } + Azure.ResourceManager.ComputeFleet.ComputeFleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.ComputeFleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class ComputeFleetExtensions + { + public static Azure.Response GetComputeFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetComputeFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ComputeFleet.ComputeFleetResource GetComputeFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.ComputeFleet.ComputeFleetCollection GetComputeFleets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetComputeFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetComputeFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ComputeFleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ComputeFleetResource() { } + public virtual Azure.ResourceManager.ComputeFleet.ComputeFleetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetVirtualMachineScaleSets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetVirtualMachineScaleSetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ComputeFleet.ComputeFleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.ComputeFleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ComputeFleet.Mocking +{ + public partial class MockableComputeFleetArmClient : Azure.ResourceManager.ArmResource + { + protected MockableComputeFleetArmClient() { } + public virtual Azure.ResourceManager.ComputeFleet.ComputeFleetResource GetComputeFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableComputeFleetResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableComputeFleetResourceGroupResource() { } + public virtual Azure.Response GetComputeFleet(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetComputeFleetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ComputeFleet.ComputeFleetCollection GetComputeFleets() { throw null; } + } + public partial class MockableComputeFleetSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableComputeFleetSubscriptionResource() { } + public virtual Azure.Pageable GetComputeFleets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetComputeFleetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.ComputeFleet.Models +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AdditionalInformationSettingName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AdditionalInformationSettingName(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName AutoLogon { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName FirstLogonCommands { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName left, Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName left, Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName right) { throw null; } + public override string ToString() { throw null; } + } + public static partial class ArmComputeFleetModelFactory + { + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError ComputeFleetApiError(string code = null, string target = null, string message = null, System.Collections.Generic.IEnumerable details = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError innererror = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiErrorInfo ComputeFleetApiErrorInfo(string code = null, string target = null, string message = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.ComputeFleetData ComputeFleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties properties = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Models.ArmPlan plan = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference ComputeFleetImageReference(Azure.Core.ResourceIdentifier id = null, string publisher = null, string offer = null, string sku = null, string version = null, string exactVersion = null, string sharedGalleryImageId = null, string communityGalleryImageId = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError ComputeFleetInnerError(string exceptionType = null, string errorDetail = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties ComputeFleetProperties(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState?), Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile spotPriorityProfile = null, Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile regularPriorityProfile = null, System.Collections.Generic.IEnumerable vmSizesProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile computeProfile = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string uniqueId = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile ComputeFleetVmProfile(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile osProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile storageProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile networkProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile securityProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics bootDiagnostics = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile extensionProfile = null, string licenseType = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile scheduledEventsProfile = null, string userData = null, Azure.Core.ResourceIdentifier capacityReservationGroupId = null, System.Collections.Generic.IEnumerable galleryApplications = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties hardwareVmSizeProperties = null, Azure.Core.ResourceIdentifier serviceArtifactReferenceId = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference securityPostureReference = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmss ComputeFleetVmss(string id = null, string type = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState operationStatus = default(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState), Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError error = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtension ComputeFleetVmssExtension(Azure.Core.ResourceIdentifier id = null, string name = null, string extensionType = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties properties = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties ComputeFleetVmssExtensionProperties(string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? shouldAutoUpgradeMinorVersion = default(bool?), bool? isAutomaticUpgradeEnabled = default(bool?), System.Collections.Generic.IDictionary settings = null, System.Collections.Generic.IDictionary protectedSettings = null, string provisioningState = null, System.Collections.Generic.IEnumerable provisionAfterExtensions = null, bool? isSuppressFailuresEnabled = default(bool?), Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference protectedSettingsFromKeyVault = null) { throw null; } + } + public partial class ComputeFleetApiError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ComputeFleetApiError() { } + public string Code { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Details { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError Innererror { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetApiErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ComputeFleetApiErrorInfo() { } + public string Code { get { throw null; } } + public string Message { get { throw null; } } + public string Target { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetBootDiagnostics : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetBootDiagnostics() { } + public bool? IsEnabled { get { throw null; } set { } } + public System.Uri StorageUri { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetCachingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetCachingType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType None { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType ReadOnly { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType ReadWrite { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetComputeProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetComputeProfile(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile baseVirtualMachineProfile) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile BaseVirtualMachineProfile { get { throw null; } set { } } + public string ComputeApiVersion { get { throw null; } set { } } + public int? PlatformFaultDomainCount { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDiffDiskOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDiffDiskOption(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption Local { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDiffDiskPlacement : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDiffDiskPlacement(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement CacheDisk { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement NvmeDisk { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement ResourceDisk { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetDiffDiskSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetDiffDiskSettings() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskOption? Option { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskPlacement? Placement { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDiskControllerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDiskControllerType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType Nvme { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType Scsi { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDiskCreateOptionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDiskCreateOptionType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType Attach { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType Copy { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType Empty { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType FromImage { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType Restore { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDiskDeleteOptionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDiskDeleteOptionType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType Delete { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType Detach { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetDomainNameLabelScopeType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetDomainNameLabelScopeType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType NoReuse { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType ResourceGroupReuse { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType SubscriptionReuse { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType TenantReuse { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetEvictionPolicy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetEvictionPolicy(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy Deallocate { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy Delete { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetImageReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetImageReference() { } + public string CommunityGalleryImageId { get { throw null; } set { } } + public string ExactVersion { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } + public string Offer { get { throw null; } set { } } + public string Publisher { get { throw null; } set { } } + public string SharedGalleryImageId { get { throw null; } set { } } + public string Sku { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetInnerError : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ComputeFleetInnerError() { } + public string ErrorDetail { get { throw null; } } + public string ExceptionType { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetIPVersion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetIPVersion(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion IPv4 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion IPv6 { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetKeyVaultSecretReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetKeyVaultSecretReference(System.Uri secretUri, Azure.ResourceManager.Resources.Models.WritableSubResource sourceVault) { } + public System.Uri SecretUri { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SourceVaultId { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetLinuxConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetLinuxConfiguration() { } + public bool? IsPasswordAuthenticationDisabled { get { throw null; } set { } } + public bool? IsVmAgentPlatformUpdatesEnabled { get { throw null; } set { } } + public bool? IsVmAgentProvisioned { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchSettings PatchSettings { get { throw null; } set { } } + public System.Collections.Generic.IList SshPublicKeys { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetLinuxPatchAssessmentMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetLinuxPatchAssessmentMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode AutomaticByPlatform { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode ImageDefault { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetLinuxPatchSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetLinuxPatchSettings() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchAssessmentMode? AssessmentMode { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode? PatchMode { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxPatchSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Always { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting IfRequired { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Never { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings() { } + public bool? IsBypassPlatformSafetyChecksOnUserScheduleEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting? RebootSetting { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetLinuxVmGuestPatchMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetLinuxVmGuestPatchMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode AutomaticByPlatform { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode ImageDefault { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxVmGuestPatchMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetNetworkApiVersion : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetNetworkApiVersion(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion V20201101 { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetNetworkInterfaceAuxiliaryMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetNetworkInterfaceAuxiliaryMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode AcceleratedConnections { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode Floating { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode None { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetNetworkInterfaceAuxiliarySku : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetNetworkInterfaceAuxiliarySku(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku A1 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku A2 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku A4 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku A8 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku None { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetOperatingSystemType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetOperatingSystemType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType Linux { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType Windows { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetOSImageNotificationProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetOSImageNotificationProfile() { } + public bool? IsEnabled { get { throw null; } set { } } + public string NotBeforeTimeout { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOSImageNotificationProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOSImageNotificationProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.Models.ArmPlan Plan { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetProperties(System.Collections.Generic.IEnumerable vmSizesProfile, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile computeProfile) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile ComputeProfile { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile RegularPriorityProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile SpotPriorityProfile { get { throw null; } set { } } + public string UniqueId { get { throw null; } } + public System.Collections.Generic.IList VmSizesProfile { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetProtocolType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetProtocolType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType Http { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType Https { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Migrating { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetProxyAgentSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetProxyAgentSettings() { } + public bool? IsEnabled { get { throw null; } set { } } + public int? KeyIncarnationId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode? Mode { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProxyAgentSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProxyAgentSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetPublicIPAddressSku : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetPublicIPAddressSku() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName? Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier? Tier { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetPublicIPAddressSkuName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetPublicIPAddressSkuName(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName Basic { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName Standard { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuName right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetPublicIPAddressSkuTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetPublicIPAddressSkuTier(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier Global { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier Regional { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSkuTier right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetScheduledEventsProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetScheduledEventsProfile() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOSImageNotificationProfile OSImageNotificationProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetTerminateNotificationProfile TerminateNotificationProfile { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetSecurityEncryptionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetSecurityEncryptionType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType DiskWithVmGuestState { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType NonPersistedTpm { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType VmGuestStateOnly { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetSecurityPostureReference : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetSecurityPostureReference() { } + public System.Collections.Generic.IList ExcludeExtensions { get { throw null; } } + public string Id { get { throw null; } set { } } + public bool? IsOverridable { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetSecurityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetSecurityProfile() { } + public bool? IsEncryptionAtHostEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProxyAgentSettings ProxyAgentSettings { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType? SecurityType { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetUefiSettings UefiSettings { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UserAssignedIdentityResourceId { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetSecurityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetSecurityType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType ConfidentialVm { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType TrustedLaunch { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetSshPublicKey : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetSshPublicKey() { } + public string KeyData { get { throw null; } set { } } + public string Path { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSshPublicKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSshPublicKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetStorageAccountType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetStorageAccountType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType PremiumLrs { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType PremiumV2LRS { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType PremiumZrs { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType StandardLrs { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType StandardSsdLrd { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType StandardSsdZrs { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType UltraSsdLrs { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetTerminateNotificationProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetTerminateNotificationProfile() { } + public bool? IsEnabled { get { throw null; } set { } } + public string NotBeforeTimeout { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetTerminateNotificationProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetTerminateNotificationProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetUefiSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetUefiSettings() { } + public bool? IsSecureBootEnabled { get { throw null; } set { } } + public bool? IsVTpmEnabled { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetUefiSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetUefiSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVaultCertificate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVaultCertificate() { } + public string CertificateStore { get { throw null; } set { } } + public System.Uri CertificateUri { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultCertificate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultCertificate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVaultSecretGroup : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVaultSecretGroup() { } + public Azure.Core.ResourceIdentifier SourceVaultId { get { throw null; } set { } } + public System.Collections.Generic.IList VaultCertificates { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultSecretGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVaultSecretGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetVmDeleteOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetVmDeleteOption(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption Delete { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption Detach { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetVmDiskSecurityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmDiskSecurityProfile() { } + public Azure.Core.ResourceIdentifier DiskEncryptionSetId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityEncryptionType? SecurityEncryptionType { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDiskSecurityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDiskSecurityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmGalleryApplication : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmGalleryApplication(Azure.Core.ResourceIdentifier packageReferenceId) { } + public string ConfigurationReference { get { throw null; } set { } } + public bool? IsAutomaticUpgradeEnabled { get { throw null; } set { } } + public bool? IsTreatFailureAsDeploymentFailureEnabled { get { throw null; } set { } } + public int? Order { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PackageReferenceId { get { throw null; } set { } } + public string Tags { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGalleryApplication System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGalleryApplication System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmGuestPatchSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmGuestPatchSettings() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode? AssessmentMode { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get { throw null; } set { } } + public bool? IsHotPatchingEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode? PatchMode { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGuestPatchSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGuestPatchSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmProfile() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics BootDiagnostics { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier CapacityReservationGroupId { get { throw null; } set { } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile ExtensionProfile { get { throw null; } set { } } + public System.Collections.Generic.IList GalleryApplications { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties HardwareVmSizeProperties { get { throw null; } set { } } + public string LicenseType { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile NetworkProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile OSProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile ScheduledEventsProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference SecurityPostureReference { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile SecurityProfile { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ServiceArtifactReferenceId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile StorageProfile { get { throw null; } set { } } + public string UserData { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmSizeProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmSizeProfile(string name) { } + public string Name { get { throw null; } set { } } + public int? Rank { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmSizeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmSizeProperties() { } + public int? VCPUsAvailable { get { throw null; } set { } } + public int? VCPUsPerCore { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmss : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ComputeFleetVmss() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError Error { get { throw null; } } + public string Id { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState OperationStatus { get { throw null; } } + public string Type { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmss System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmss System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssDataDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssDataDisk(int lun, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType createOption) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType? Caching { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType CreateOption { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType? DeleteOption { get { throw null; } set { } } + public long? DiskIopsReadWrite { get { throw null; } set { } } + public long? DiskMbpsReadWrite { get { throw null; } set { } } + public int? DiskSizeGB { get { throw null; } set { } } + public bool? IsWriteAcceleratorEnabled { get { throw null; } set { } } + public int Lun { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk ManagedDisk { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssDataDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssDataDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssExtension : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssExtension() { } + public string ExtensionType { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtension System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtension System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssExtensionProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssExtensionProfile() { } + public System.Collections.Generic.IList Extensions { get { throw null; } } + public string ExtensionsTimeBudget { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssExtensionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssExtensionProperties() { } + public string ExtensionType { get { throw null; } set { } } + public string ForceUpdateTag { get { throw null; } set { } } + public bool? IsAutomaticUpgradeEnabled { get { throw null; } set { } } + public bool? IsSuppressFailuresEnabled { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference ProtectedSettingsFromKeyVault { get { throw null; } set { } } + public System.Collections.Generic.IList ProvisionAfterExtensions { get { throw null; } } + public string ProvisioningState { get { throw null; } } + public string Publisher { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Settings { get { throw null; } } + public bool? ShouldAutoUpgradeMinorVersion { get { throw null; } set { } } + public string TypeHandlerVersion { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssIPConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssIPConfiguration(string name) { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfigurationProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssIPConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssIPConfigurationProperties() { } + public System.Collections.Generic.IList ApplicationGatewayBackendAddressPools { get { throw null; } } + public System.Collections.Generic.IList ApplicationSecurityGroups { get { throw null; } } + public bool? IsPrimary { get { throw null; } set { } } + public System.Collections.Generic.IList LoadBalancerBackendAddressPools { get { throw null; } } + public System.Collections.Generic.IList LoadBalancerInboundNatPools { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion? PrivateIPAddressVersion { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfiguration PublicIPAddressConfiguration { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssIPTag : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssIPTag() { } + public string IPTagType { get { throw null; } set { } } + public string Tag { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPTag System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssIPTag System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssManagedDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssManagedDisk() { } + public Azure.Core.ResourceIdentifier DiskEncryptionSetId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDiskSecurityProfile SecurityProfile { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetStorageAccountType? StorageAccountType { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssNetworkConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssNetworkConfiguration(string name) { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfigurationProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssNetworkConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssNetworkConfigurationProperties(System.Collections.Generic.IEnumerable ipConfigurations) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliaryMode? AuxiliaryMode { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkInterfaceAuxiliarySku? AuxiliarySku { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption? DeleteOption { get { throw null; } set { } } + public System.Collections.Generic.IList DnsServers { get { throw null; } } + public System.Collections.Generic.IList IPConfigurations { get { throw null; } } + public bool? IsAcceleratedNetworkingEnabled { get { throw null; } set { } } + public bool? IsFpgaEnabled { get { throw null; } set { } } + public bool? IsIPForwardingEnabled { get { throw null; } set { } } + public bool? IsPrimary { get { throw null; } set { } } + public bool? IsTcpStateTrackingDisabled { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier NetworkSecurityGroupId { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssNetworkProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssNetworkProfile() { } + public Azure.Core.ResourceIdentifier HealthProbeId { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetNetworkApiVersion? NetworkApiVersion { get { throw null; } set { } } + public System.Collections.Generic.IList NetworkInterfaceConfigurations { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssOSDisk : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssOSDisk(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType createOption) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetCachingType? Caching { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskCreateOptionType CreateOption { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskDeleteOptionType? DeleteOption { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiffDiskSettings DiffDiskSettings { get { throw null; } set { } } + public int? DiskSizeGB { get { throw null; } set { } } + public System.Uri ImageUri { get { throw null; } set { } } + public bool? IsWriteAcceleratorEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssManagedDisk ManagedDisk { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetOperatingSystemType? OSType { get { throw null; } set { } } + public System.Collections.Generic.IList VhdContainers { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSDisk System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSDisk System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssOSProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssOSProfile() { } + public string AdminPassword { get { throw null; } set { } } + public string AdminUsername { get { throw null; } set { } } + public bool? AreExtensionOperationsAllowed { get { throw null; } set { } } + public string ComputerNamePrefix { get { throw null; } set { } } + public string CustomData { get { throw null; } set { } } + public bool? IsGuestProvisionSignalRequired { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetLinuxConfiguration LinuxConfiguration { get { throw null; } set { } } + public System.Collections.Generic.IList Secrets { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsConfiguration WindowsConfiguration { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssPublicIPAddressConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssPublicIPAddressConfiguration(string name) { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfigurationProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetPublicIPAddressSku Sku { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssPublicIPAddressConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssPublicIPAddressConfigurationProperties() { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmDeleteOption? DeleteOption { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressDnsSettings DnsSettings { get { throw null; } set { } } + public int? IdleTimeoutInMinutes { get { throw null; } set { } } + public System.Collections.Generic.IList IPTags { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetIPVersion? PublicIPAddressVersion { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PublicIPPrefixId { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssPublicIPAddressDnsSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssPublicIPAddressDnsSettings(string domainNameLabel) { } + public string DomainNameLabel { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDomainNameLabelScopeType? DomainNameLabelScope { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressDnsSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssPublicIPAddressDnsSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetVmssStorageProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmssStorageProfile() { } + public System.Collections.Generic.IList DataDisks { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetDiskControllerType? DiskControllerType { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference ImageReference { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSDisk OSDisk { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeFleetWindowsConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetWindowsConfiguration() { } + public System.Collections.Generic.IList AdditionalUnattendContent { get { throw null; } } + public bool? IsAutomaticUpdatesEnabled { get { throw null; } set { } } + public bool? IsVmAgentPlatformUpdatesEnabled { get { throw null; } set { } } + public bool? IsVmAgentProvisioned { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmGuestPatchSettings PatchSettings { get { throw null; } set { } } + public string TimeZone { get { throw null; } set { } } + public System.Collections.Generic.IList WinRMListeners { get { throw null; } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetWindowsPatchAssessmentMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetWindowsPatchAssessmentMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode AutomaticByPlatform { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode ImageDefault { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsPatchAssessmentMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Always { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting IfRequired { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Never { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings() { } + public bool? IsBypassPlatformSafetyChecksOnUserScheduleEnabled { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting? RebootSetting { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetWindowsVmGuestPatchMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetWindowsVmGuestPatchMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode AutomaticByOS { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode AutomaticByPlatform { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode Manual { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWindowsVmGuestPatchMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ComputeFleetWinRMListener : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetWinRMListener() { } + public System.Uri CertificateUri { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProtocolType? Protocol { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWinRMListener System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetWinRMListener System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProxyAgentExecuteMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProxyAgentExecuteMode(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode Audit { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode Enforce { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode left, Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode left, Azure.ResourceManager.ComputeFleet.Models.ProxyAgentExecuteMode right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RegularPriorityAllocationStrategy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RegularPriorityAllocationStrategy(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy LowestPrice { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy Prioritized { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy left, Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy left, Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RegularPriorityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RegularPriorityProfile() { } + public Azure.ResourceManager.ComputeFleet.Models.RegularPriorityAllocationStrategy? AllocationStrategy { get { throw null; } set { } } + public int? Capacity { get { throw null; } set { } } + public int? MinCapacity { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SpotAllocationStrategy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SpotAllocationStrategy(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy CapacityOptimized { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy LowestPrice { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy PriceCapacityOptimized { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy left, Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy left, Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SpotPriorityProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SpotPriorityProfile() { } + public Azure.ResourceManager.ComputeFleet.Models.SpotAllocationStrategy? AllocationStrategy { get { throw null; } set { } } + public int? Capacity { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetEvictionPolicy? EvictionPolicy { get { throw null; } set { } } + public bool? IsMaintainEnabled { get { throw null; } set { } } + public float? MaxPricePerVm { get { throw null; } set { } } + public int? MinCapacity { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WindowsSetupAdditionalInformation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WindowsSetupAdditionalInformation() { } + public Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName? ComponentName { get { throw null; } set { } } + public string Content { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName? PassName { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName? SettingName { get { throw null; } set { } } + Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WindowsSetupAdditionalInformationComponentName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WindowsSetupAdditionalInformationComponentName(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName MicrosoftWindowsShellSetup { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName left, Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName left, Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationComponentName right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WindowsSetupAdditionalInformationPassName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WindowsSetupAdditionalInformationPassName(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName OobeSystem { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName left, Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName left, Azure.ResourceManager.ComputeFleet.Models.WindowsSetupAdditionalInformationPassName right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json new file mode 100644 index 000000000000..ebe690ab171b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/computefleet/Azure.ResourceManager.ComputeFleet", + "Tag": "" +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Azure.ResourceManager.ComputeFleet.Samples.csproj b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Azure.ResourceManager.ComputeFleet.Samples.csproj new file mode 100644 index 000000000000..b29a80f89a43 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Azure.ResourceManager.ComputeFleet.Samples.csproj @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs new file mode 100644 index 000000000000..4ca6c0427871 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ComputeFleet.Samples +{ + public partial class Sample_ComputeFleetCollection + { + // Fleets_ListByResourceGroup + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_FleetsListByResourceGroup() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_ListByResourceGroup.json + // this example is just showing the usage of "Fleets_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ComputeFleetResource + ComputeFleetCollection collection = resourceGroupResource.GetComputeFleets(); + + // invoke the operation and iterate over the result + await foreach (ComputeFleetResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ComputeFleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Fleets_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_FleetsGet() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ComputeFleetResource + ComputeFleetCollection collection = resourceGroupResource.GetComputeFleets(); + + // invoke the operation + string fleetName = "testFleet"; + ComputeFleetResource result = await collection.GetAsync(fleetName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ComputeFleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Fleets_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_FleetsGet() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ComputeFleetResource + ComputeFleetCollection collection = resourceGroupResource.GetComputeFleets(); + + // invoke the operation + string fleetName = "testFleet"; + bool result = await collection.ExistsAsync(fleetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Fleets_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_FleetsGet() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this ComputeFleetResource + ComputeFleetCollection collection = resourceGroupResource.GetComputeFleets(); + + // invoke the operation + string fleetName = "testFleet"; + NullableResponse response = await collection.GetIfExistsAsync(fleetName); + ComputeFleetResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ComputeFleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs new file mode 100644 index 000000000000..db5269c3aa36 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ComputeFleet.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ComputeFleet.Samples +{ + public partial class Sample_ComputeFleetResource + { + // Fleets_ListBySubscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetComputeFleets_FleetsListBySubscription() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_ListBySubscription.json + // this example is just showing the usage of "Fleets_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (ComputeFleetResource item in subscriptionResource.GetComputeFleetsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ComputeFleetData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Fleets_Get + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_FleetsGet() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Get.json + // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ComputeFleetResource created on azure + // for more information of creating ComputeFleetResource, please refer to the document of ComputeFleetResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + string fleetName = "testFleet"; + ResourceIdentifier computeFleetResourceId = ComputeFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ComputeFleetResource computeFleet = client.GetComputeFleetResource(computeFleetResourceId); + + // invoke the operation + ComputeFleetResource result = await computeFleet.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ComputeFleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Fleets_Delete + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_FleetsDelete() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_Delete.json + // this example is just showing the usage of "Fleets_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ComputeFleetResource created on azure + // for more information of creating ComputeFleetResource, please refer to the document of ComputeFleetResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + string fleetName = "testFleet"; + ResourceIdentifier computeFleetResourceId = ComputeFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ComputeFleetResource computeFleet = client.GetComputeFleetResource(computeFleetResourceId); + + // invoke the operation + await computeFleet.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Fleets_ListVirtualMachineScaleSets + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetVirtualMachineScaleSets_FleetsListVirtualMachineScaleSets() + { + // Generated from example definition: specification/azurefleet/resource-manager/Microsoft.AzureFleet/preview/2024-05-01-preview/examples/Fleets_ListVirtualMachineScaleSets.json + // this example is just showing the usage of "Fleets_ListVirtualMachineScaleSets" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ComputeFleetResource created on azure + // for more information of creating ComputeFleetResource, please refer to the document of ComputeFleetResource + string subscriptionId = "1DC2F28C-A625-4B0E-9748-9885A3C9E9EB"; + string resourceGroupName = "rgazurefleet"; + string name = "myFleet"; + ResourceIdentifier computeFleetResourceId = ComputeFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + ComputeFleetResource computeFleet = client.GetComputeFleetResource(computeFleetResourceId); + + // invoke the operation and iterate over the result + await foreach (ComputeFleetVmss item in computeFleet.GetVirtualMachineScaleSetsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj new file mode 100644 index 000000000000..e09d0f669209 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj @@ -0,0 +1,8 @@ + + + 1.0.0-beta.2 + Azure.ResourceManager.ComputeFleet + Azure Resource Manager client SDK for Azure resource provider ComputeFleet. + azure;management;arm;resource manager;computefleet + + diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Custom/Models/ComputeFleetPatch.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Custom/Models/ComputeFleetPatch.cs new file mode 100644 index 000000000000..81dd74da4660 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Custom/Models/ComputeFleetPatch.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Fleet Update Model. + public partial class ComputeFleetPatch + { + /// Updatable managed service identity. + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs new file mode 100644 index 000000000000..84ec227471d8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Model factory for models. + public static partial class ArmComputeFleetModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Zones in which the Compute Fleet is available. + /// The managed service identities assigned to this resource. + /// Details of the resource plan. + /// A new instance for mocking. + public static ComputeFleetData ComputeFleetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ComputeFleetProperties properties = null, IEnumerable zones = null, ManagedServiceIdentity identity = null, ArmPlan plan = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + + return new ComputeFleetData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + zones?.ToList(), + identity, + plan, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the last operation. + /// Configuration Options for Spot instances in Compute Fleet. + /// Configuration Options for Regular instances in Compute Fleet. + /// List of VM sizes supported for Compute Fleet. + /// Compute Profile to use for running user's workloads. + /// Specifies the time at which the Compute Fleet is created. + /// Specifies the ID which uniquely identifies a Compute Fleet. + /// A new instance for mocking. + public static ComputeFleetProperties ComputeFleetProperties(ComputeFleetProvisioningState? provisioningState = null, SpotPriorityProfile spotPriorityProfile = null, RegularPriorityProfile regularPriorityProfile = null, IEnumerable vmSizesProfile = null, ComputeFleetComputeProfile computeProfile = null, DateTimeOffset? createdOn = null, string uniqueId = null) + { + vmSizesProfile ??= new List(); + + return new ComputeFleetProperties( + provisioningState, + spotPriorityProfile, + regularPriorityProfile, + vmSizesProfile?.ToList(), + computeProfile, + createdOn, + uniqueId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Specifies the operating system settings for the virtual machines in the scale + /// set. + /// + /// Specifies the storage settings for the virtual machine disks. + /// + /// Specifies properties of the network interfaces of the virtual machines in the + /// scale set. + /// + /// + /// Specifies the Security related profile settings for the virtual machines in the + /// scale set. + /// + /// Specifies the boot diagnostic settings state. + /// + /// Specifies a collection of settings for extensions installed on virtual machines + /// in the scale set. + /// + /// + /// Specifies that the image or disk that is being used was licensed on-premises. + /// <br><br> Possible values for Windows Server operating system are: <br><br> + /// Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS + /// (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for + /// Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// + /// Specifies Scheduled Event related configurations. + /// + /// UserData for the virtual machines in the scale set, which must be base-64 + /// encoded. Customer should not pass any secrets in here. Minimum api-version: + /// 2021-03-01. + /// + /// + /// Specifies the capacity reservation related details of a scale set. Minimum + /// api-version: 2021-04-01. + /// + /// Specifies the gallery applications that should be made available to the VM/VMSS. + /// + /// Specifies the hardware profile related details of a scale set. Minimum + /// api-version: 2021-11-01. + /// + /// + /// Specifies the service artifact reference id used to set same image version for + /// all virtual machines in the scale set when using 'latest' image version. + /// Minimum api-version: 2022-11-01 + /// + /// + /// Specifies the security posture to be used for all virtual machines in the scale + /// set. Minimum api-version: 2023-03-01 + /// + /// + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set + /// was created. Minimum API version for this property is 2023-09-01. This value + /// will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile + /// with minimum api-version 2023-09-01. Examples: "2024-07-01T00:00:01.1234567+00:00" + /// + /// A new instance for mocking. + public static ComputeFleetVmProfile ComputeFleetVmProfile(ComputeFleetVmssOSProfile osProfile = null, ComputeFleetVmssStorageProfile storageProfile = null, ComputeFleetVmssNetworkProfile networkProfile = null, ComputeFleetSecurityProfile securityProfile = null, ComputeFleetBootDiagnostics bootDiagnostics = null, ComputeFleetVmssExtensionProfile extensionProfile = null, string licenseType = null, ComputeFleetScheduledEventsProfile scheduledEventsProfile = null, string userData = null, ResourceIdentifier capacityReservationGroupId = null, IEnumerable galleryApplications = null, ComputeFleetVmSizeProperties hardwareVmSizeProperties = null, ResourceIdentifier serviceArtifactReferenceId = null, ComputeFleetSecurityPostureReference securityPostureReference = null, DateTimeOffset? createdOn = null) + { + galleryApplications ??= new List(); + + return new ComputeFleetVmProfile( + osProfile, + storageProfile, + networkProfile, + securityProfile, + bootDiagnostics != null ? new ComputeFleetDiagnosticsProfile(bootDiagnostics, serializedAdditionalRawData: null) : null, + extensionProfile, + licenseType, + scheduledEventsProfile, + userData, + capacityReservationGroupId != null ? new CapacityReservationProfile(ResourceManagerModelFactory.WritableSubResource(capacityReservationGroupId), serializedAdditionalRawData: null) : null, + galleryApplications != null ? new ComputeFleetApplicationProfile(galleryApplications?.ToList(), serializedAdditionalRawData: null) : null, + hardwareVmSizeProperties != null ? new ComputeFleetVmssHardwareProfile(hardwareVmSizeProperties, serializedAdditionalRawData: null) : null, + serviceArtifactReferenceId != null ? ResourceManagerModelFactory.WritableSubResource(serviceArtifactReferenceId) : null, + securityPostureReference, + createdOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource Id. + /// The image publisher. + /// + /// Specifies the offer of the platform image or marketplace image used to create + /// the virtual machine. + /// + /// The image SKU. + /// + /// Specifies the version of the platform image or marketplace image used to create + /// the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + /// Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest + /// version of an image available at deploy time. Even if you use 'latest', the VM + /// image will not automatically update after deploy time even if a new version + /// becomes available. Please do not use field 'version' for gallery image + /// deployment, gallery image should always use 'id' field for deployment, to use 'latest' + /// version of gallery image, just set + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + /// in the 'id' field without version input. + /// + /// + /// Specifies in decimal numbers, the version of platform image or marketplace + /// image used to create the virtual machine. This readonly field differs from 'version', + /// only if the value specified in 'version' field is 'latest'. + /// + /// + /// Specified the shared gallery image unique id for vm deployment. This can be + /// fetched from shared gallery image GET call. + /// + /// + /// Specified the community gallery image unique id for vm deployment. This can be + /// fetched from community gallery image GET call. + /// + /// A new instance for mocking. + public static ComputeFleetImageReference ComputeFleetImageReference(ResourceIdentifier id = null, string publisher = null, string offer = null, string sku = null, string version = null, string exactVersion = null, string sharedGalleryImageId = null, string communityGalleryImageId = null) + { + return new ComputeFleetImageReference( + id, + publisher, + offer, + sku, + version, + exactVersion, + sharedGalleryImageId, + communityGalleryImageId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource Id. + /// The name of the extension. + /// Resource type. + /// Describes the properties of a Virtual Machine Scale Set Extension. + /// A new instance for mocking. + public static ComputeFleetVmssExtension ComputeFleetVmssExtension(ResourceIdentifier id = null, string name = null, string extensionType = null, ComputeFleetVmssExtensionProperties properties = null) + { + return new ComputeFleetVmssExtension(id, name, extensionType, properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// If a value is provided and is different from the previous value, the extension + /// handler will be forced to update even if the extension configuration has not + /// changed. + /// + /// The name of the extension handler publisher. + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the version of the script handler. + /// + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will not + /// upgrade minor versions unless redeployed, even with this property set to true. + /// + /// + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + /// Json formatted public settings for the extension. + /// + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + /// The provisioning state, which only appears in the response. + /// + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + /// + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be suppressed + /// regardless of this value). The default is false. + /// + /// + /// The extensions protected settings that are passed by reference, and consumed + /// from key vault + /// + /// A new instance for mocking. + public static ComputeFleetVmssExtensionProperties ComputeFleetVmssExtensionProperties(string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? shouldAutoUpgradeMinorVersion = null, bool? isAutomaticUpgradeEnabled = null, IDictionary settings = null, IDictionary protectedSettings = null, string provisioningState = null, IEnumerable provisionAfterExtensions = null, bool? isSuppressFailuresEnabled = null, ComputeFleetKeyVaultSecretReference protectedSettingsFromKeyVault = null) + { + settings ??= new Dictionary(); + protectedSettings ??= new Dictionary(); + provisionAfterExtensions ??= new List(); + + return new ComputeFleetVmssExtensionProperties( + forceUpdateTag, + publisher, + extensionType, + typeHandlerVersion, + shouldAutoUpgradeMinorVersion, + isAutomaticUpgradeEnabled, + settings, + protectedSettings, + provisioningState, + provisionAfterExtensions?.ToList(), + isSuppressFailuresEnabled, + protectedSettingsFromKeyVault, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// The compute RP resource id of the virtualMachineScaleSet + /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" + /// + /// Type of the virtualMachineScaleSet. + /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. + /// Error Information when `operationStatus` is `Failed`. + /// A new instance for mocking. + public static ComputeFleetVmss ComputeFleetVmss(string id = null, string type = null, ComputeFleetProvisioningState operationStatus = default, ComputeFleetApiError error = null) + { + return new ComputeFleetVmss(id, type, operationStatus, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error code. + /// The target of the particular error. + /// The error message. + /// The API error details. + /// The API inner error. + /// A new instance for mocking. + public static ComputeFleetApiError ComputeFleetApiError(string code = null, string target = null, string message = null, IEnumerable details = null, ComputeFleetInnerError innererror = null) + { + details ??= new List(); + + return new ComputeFleetApiError( + code, + target, + message, + details?.ToList(), + innererror, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The error code. + /// The target of the particular error. + /// The error message. + /// A new instance for mocking. + public static ComputeFleetApiErrorInfo ComputeFleetApiErrorInfo(string code = null, string target = null, string message = null) + { + return new ComputeFleetApiErrorInfo(code, target, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The exception type. + /// The internal error message or exception dump. + /// A new instance for mocking. + public static ComputeFleetInnerError ComputeFleetInnerError(string exceptionType = null, string errorDetail = null) + { + return new ComputeFleetInnerError(exceptionType, errorDetail, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs new file mode 100644 index 000000000000..323ce687d8fb --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ComputeFleet +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetComputeFleets method from an instance of . + /// + public partial class ComputeFleetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _computeFleetFleetsClientDiagnostics; + private readonly FleetsRestOperations _computeFleetFleetsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ComputeFleetCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ComputeFleetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _computeFleetFleetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeFleet", ComputeFleetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ComputeFleetResource.ResourceType, out string computeFleetFleetsApiVersion); + _computeFleetFleetsRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, computeFleetFleetsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Compute Fleet. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fleetName, ComputeFleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken).ConfigureAwait(false); + var operation = new ComputeFleetArmOperation(new ComputeFleetOperationSource(Client), _computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Compute Fleet. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fleetName, ComputeFleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken); + var operation = new ComputeFleetArmOperation(new ComputeFleetOperationSource(Client), _computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.Get"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.Get"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Fleet resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _computeFleetFleetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computeFleetFleetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ComputeFleetResource(Client, ComputeFleetData.DeserializeComputeFleetData(e)), _computeFleetFleetsClientDiagnostics, Pipeline, "ComputeFleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Fleet resources by resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _computeFleetFleetsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computeFleetFleetsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ComputeFleetResource(Client, ComputeFleetData.DeserializeComputeFleetData(e)), _computeFleetFleetsClientDiagnostics, Pipeline, "ComputeFleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.Exists"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.Exists"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs new file mode 100644 index 000000000000..25e0baf0c9de --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.Serialization.cs @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ComputeFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet +{ + public partial class ComputeFleetData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + if (Optional.IsDefined(Plan)) + { + writer.WritePropertyName("plan"u8); + JsonSerializer.Serialize(writer, Plan); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetData(document.RootElement, options); + } + + internal static ComputeFleetData DeserializeComputeFleetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetProperties properties = default; + IList zones = default; + ManagedServiceIdentity identity = default; + ArmPlan plan = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetProperties.DeserializeComputeFleetProperties(property.Value, options); + continue; + } + if (property.NameEquals("zones"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + zones = array; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("plan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + plan = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + zones ?? new ChangeTrackingList(), + identity, + plan, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetData)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.cs new file mode 100644 index 000000000000..21d3c256f485 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetData.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ComputeFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet +{ + /// + /// A class representing the ComputeFleet data model. + /// An Compute Fleet resource + /// + public partial class ComputeFleetData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public ComputeFleetData(AzureLocation location) : base(location) + { + Zones = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Zones in which the Compute Fleet is available. + /// The managed service identities assigned to this resource. + /// Details of the resource plan. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ComputeFleetProperties properties, IList zones, ManagedServiceIdentity identity, ArmPlan plan, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Zones = zones; + Identity = identity; + Plan = plan; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetData() + { + } + + /// The resource-specific properties for this resource. + public ComputeFleetProperties Properties { get; set; } + /// Zones in which the Compute Fleet is available. + public IList Zones { get; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + /// Details of the resource plan. + public ArmPlan Plan { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.Serialization.cs new file mode 100644 index 000000000000..7b63494c8843 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ComputeFleet +{ + public partial class ComputeFleetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ComputeFleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ComputeFleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs new file mode 100644 index 000000000000..150cc0ab22f8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs @@ -0,0 +1,768 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ComputeFleet.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ComputeFleet +{ + /// + /// A Class representing a ComputeFleet along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetComputeFleetResource method. + /// Otherwise you can get one from its parent resource using the GetComputeFleet method. + /// + public partial class ComputeFleetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _computeFleetFleetsClientDiagnostics; + private readonly FleetsRestOperations _computeFleetFleetsRestClient; + private readonly ComputeFleetData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.AzureFleet/fleets"; + + /// Initializes a new instance of the class for mocking. + protected ComputeFleetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ComputeFleetResource(ArmClient client, ComputeFleetData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ComputeFleetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _computeFleetFleetsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ComputeFleet", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string computeFleetFleetsApiVersion); + _computeFleetFleetsRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, computeFleetFleetsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ComputeFleetData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Get"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Get"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeFleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Delete + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Delete"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ComputeFleetArmOperation(_computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Delete + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Delete"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new ComputeFleetArmOperation(_computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Update + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ComputeFleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Update"); + scope.Start(); + try + { + var response = await _computeFleetFleetsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new ComputeFleetArmOperation(new ComputeFleetOperationSource(Client), _computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Update + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ComputeFleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.Update"); + scope.Start(); + try + { + var response = _computeFleetFleetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new ComputeFleetArmOperation(new ComputeFleetOperationSource(Client), _computeFleetFleetsClientDiagnostics, Pipeline, _computeFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List VirtualMachineScaleSet resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachineScaleSets + /// + /// + /// Operation Id + /// VirtualMachineScaleSet_ListVirtualMachineScaleSets + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetVirtualMachineScaleSetsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _computeFleetFleetsRestClient.CreateListVirtualMachineScaleSetsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computeFleetFleetsRestClient.CreateListVirtualMachineScaleSetsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ComputeFleetVmss.DeserializeComputeFleetVmss(e), _computeFleetFleetsClientDiagnostics, Pipeline, "ComputeFleetResource.GetVirtualMachineScaleSets", "value", "nextLink", cancellationToken); + } + + /// + /// List VirtualMachineScaleSet resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{name}/virtualMachineScaleSets + /// + /// + /// Operation Id + /// VirtualMachineScaleSet_ListVirtualMachineScaleSets + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetVirtualMachineScaleSets(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _computeFleetFleetsRestClient.CreateListVirtualMachineScaleSetsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computeFleetFleetsRestClient.CreateListVirtualMachineScaleSetsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ComputeFleetVmss.DeserializeComputeFleetVmss(e), _computeFleetFleetsClientDiagnostics, Pipeline, "ComputeFleetResource.GetVirtualMachineScaleSets", "value", "nextLink", cancellationToken); + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ComputeFleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ComputeFleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ComputeFleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ComputeFleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _computeFleetFleetsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new ComputeFleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _computeFleetFleetsClientDiagnostics.CreateScope("ComputeFleetResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _computeFleetFleetsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new ComputeFleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new ComputeFleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs new file mode 100644 index 000000000000..70ee5bc010ec --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.ComputeFleet.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.ComputeFleet +{ + /// A class to add extension methods to Azure.ResourceManager.ComputeFleet. + public static partial class ComputeFleetExtensions + { + private static MockableComputeFleetArmClient GetMockableComputeFleetArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableComputeFleetArmClient(client0)); + } + + private static MockableComputeFleetResourceGroupResource GetMockableComputeFleetResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableComputeFleetResourceGroupResource(client, resource.Id)); + } + + private static MockableComputeFleetSubscriptionResource GetMockableComputeFleetSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableComputeFleetSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static ComputeFleetResource GetComputeFleetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableComputeFleetArmClient(client).GetComputeFleetResource(id); + } + + /// + /// Gets a collection of ComputeFleetResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of ComputeFleetResources and their operations over a ComputeFleetResource. + public static ComputeFleetCollection GetComputeFleets(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableComputeFleetResourceGroupResource(resourceGroupResource).GetComputeFleets(); + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetComputeFleetAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableComputeFleetResourceGroupResource(resourceGroupResource).GetComputeFleetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetComputeFleet(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableComputeFleetResourceGroupResource(resourceGroupResource).GetComputeFleet(fleetName, cancellationToken); + } + + /// + /// List Fleet resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetComputeFleetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableComputeFleetSubscriptionResource(subscriptionResource).GetComputeFleetsAsync(cancellationToken); + } + + /// + /// List Fleet resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetComputeFleets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableComputeFleetSubscriptionResource(subscriptionResource).GetComputeFleets(cancellationToken); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetArmClient.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetArmClient.cs new file mode 100644 index 000000000000..3bbfcc756e85 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetArmClient.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableComputeFleetArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableComputeFleetArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableComputeFleetArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableComputeFleetArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ComputeFleetResource GetComputeFleetResource(ResourceIdentifier id) + { + ComputeFleetResource.ValidateResourceId(id); + return new ComputeFleetResource(Client, id); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs new file mode 100644 index 000000000000..f1d8341de4ee --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableComputeFleetResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableComputeFleetResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableComputeFleetResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of ComputeFleetResources in the ResourceGroupResource. + /// An object representing collection of ComputeFleetResources and their operations over a ComputeFleetResource. + public virtual ComputeFleetCollection GetComputeFleets() + { + return GetCachedClient(client => new ComputeFleetCollection(client, Id)); + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetComputeFleetAsync(string fleetName, CancellationToken cancellationToken = default) + { + return await GetComputeFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureFleet/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleets_Get + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetComputeFleet(string fleetName, CancellationToken cancellationToken = default) + { + return GetComputeFleets().Get(fleetName, cancellationToken); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs new file mode 100644 index 000000000000..76dd9cbeec5d --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ComputeFleet.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableComputeFleetSubscriptionResource : ArmResource + { + private ClientDiagnostics _computeFleetFleetsClientDiagnostics; + private FleetsRestOperations _computeFleetFleetsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableComputeFleetSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableComputeFleetSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics ComputeFleetFleetsClientDiagnostics => _computeFleetFleetsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ComputeFleet", ComputeFleetResource.ResourceType.Namespace, Diagnostics); + private FleetsRestOperations ComputeFleetFleetsRestClient => _computeFleetFleetsRestClient ??= new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ComputeFleetResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// List Fleet resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetComputeFleetsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ComputeFleetFleetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ComputeFleetFleetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ComputeFleetResource(Client, ComputeFleetData.DeserializeComputeFleetData(e)), ComputeFleetFleetsClientDiagnostics, Pipeline, "MockableComputeFleetSubscriptionResource.GetComputeFleets", "value", "nextLink", cancellationToken); + } + + /// + /// List Fleet resources by subscription ID + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.AzureFleet/fleets + /// + /// + /// Operation Id + /// Fleet_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetComputeFleets(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ComputeFleetFleetsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ComputeFleetFleetsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ComputeFleetResource(Client, ComputeFleetData.DeserializeComputeFleetData(e)), ComputeFleetFleetsClientDiagnostics, Pipeline, "MockableComputeFleetSubscriptionResource.GetComputeFleets", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Argument.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..a0a6cf71885f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..aa7e5ec8f7e0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingList.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..95357b568c62 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..2c90832af748 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Optional.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..857b37b3e1ce --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..34875b3d7f79 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperation.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperation.cs new file mode 100644 index 000000000000..7762c42a9062 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ComputeFleet +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ComputeFleetArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of ComputeFleetArmOperation for mocking. + protected ComputeFleetArmOperation() + { + } + + internal ComputeFleetArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ComputeFleetArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "ComputeFleetArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperationOfT.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperationOfT.cs new file mode 100644 index 000000000000..1c033561536e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ComputeFleet +{ +#pragma warning disable SA1649 // File name should match first type name + internal class ComputeFleetArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of ComputeFleetArmOperation for mocking. + protected ComputeFleetArmOperation() + { + } + + internal ComputeFleetArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal ComputeFleetArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "ComputeFleetArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetOperationSource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetOperationSource.cs new file mode 100644 index 000000000000..592ac79e55c0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/LongRunningOperation/ComputeFleetOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal class ComputeFleetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ComputeFleetOperationSource(ArmClient client) + { + _client = client; + } + + ComputeFleetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ComputeFleetData.DeserializeComputeFleetData(document.RootElement); + return new ComputeFleetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ComputeFleetData.DeserializeComputeFleetData(document.RootElement); + return new ComputeFleetResource(_client, data); + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalInformationSettingName.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalInformationSettingName.cs new file mode 100644 index 000000000000..9daa9bdce7a9 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalInformationSettingName.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the name of the setting to which the content applies. Possible values + /// are: FirstLogonCommands and AutoLogon. + /// + public readonly partial struct AdditionalInformationSettingName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AdditionalInformationSettingName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AutoLogonValue = "AutoLogon"; + private const string FirstLogonCommandsValue = "FirstLogonCommands"; + + /// AutoLogon setting. + public static AdditionalInformationSettingName AutoLogon { get; } = new AdditionalInformationSettingName(AutoLogonValue); + /// FirstLogonCommands setting. + public static AdditionalInformationSettingName FirstLogonCommands { get; } = new AdditionalInformationSettingName(FirstLogonCommandsValue); + /// Determines if two values are the same. + public static bool operator ==(AdditionalInformationSettingName left, AdditionalInformationSettingName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AdditionalInformationSettingName left, AdditionalInformationSettingName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AdditionalInformationSettingName(string value) => new AdditionalInformationSettingName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AdditionalInformationSettingName other && Equals(other); + /// + public bool Equals(AdditionalInformationSettingName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.cs new file mode 100644 index 000000000000..06dc7c1cedf4 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CapacityReservationProfile.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The parameters of a capacity reservation Profile. + internal partial class CapacityReservationProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CapacityReservationProfile() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the capacity reservation group resource id that should be used for + /// allocating the virtual machine or scaleset vm instances provided enough + /// capacity has been reserved. Please refer to https://aka.ms/CapacityReservation + /// for more details. + /// + /// Keeps track of any properties unknown to the library. + internal CapacityReservationProfile(WritableSubResource capacityReservationGroup, IDictionary serializedAdditionalRawData) + { + CapacityReservationGroup = capacityReservationGroup; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the capacity reservation group resource id that should be used for + /// allocating the virtual machine or scaleset vm instances provided enough + /// capacity has been reserved. Please refer to https://aka.ms/CapacityReservation + /// for more details. + /// + internal WritableSubResource CapacityReservationGroup { get; set; } + /// Gets or sets Id. + public ResourceIdentifier CapacityReservationGroupId + { + get => CapacityReservationGroup is null ? default : CapacityReservationGroup.Id; + set + { + if (CapacityReservationGroup is null) + CapacityReservationGroup = new WritableSubResource(); + CapacityReservationGroup.Id = value; + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs new file mode 100644 index 000000000000..d102ec8a91e4 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiError.Serialization.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetApiError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetApiError)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Innererror)) + { + writer.WritePropertyName("innererror"u8); + writer.WriteObjectValue(Innererror, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetApiError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetApiError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetApiError(document.RootElement, options); + } + + internal static ComputeFleetApiError DeserializeComputeFleetApiError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string target = default; + string message = default; + IReadOnlyList details = default; + ComputeFleetInnerError innererror = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetApiErrorInfo.DeserializeComputeFleetApiErrorInfo(item, options)); + } + details = array; + continue; + } + if (property.NameEquals("innererror"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + innererror = ComputeFleetInnerError.DeserializeComputeFleetInnerError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetApiError( + code, + target, + message, + details ?? new ChangeTrackingList(), + innererror, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetApiError)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetApiError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetApiError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetApiError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs new file mode 100644 index 000000000000..79e521e9c5ac --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetApiErrorInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetApiErrorInfo)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetApiErrorInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetApiErrorInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetApiErrorInfo(document.RootElement, options); + } + + internal static ComputeFleetApiErrorInfo DeserializeComputeFleetApiErrorInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string target = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetApiErrorInfo(code, target, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetApiErrorInfo)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetApiErrorInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetApiErrorInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetApiErrorInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.cs new file mode 100644 index 000000000000..e98709c31a71 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApiErrorInfo.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// API error base. + public partial class ComputeFleetApiErrorInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ComputeFleetApiErrorInfo() + { + } + + /// Initializes a new instance of . + /// The error code. + /// The target of the particular error. + /// The error message. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetApiErrorInfo(string code, string target, string message, IDictionary serializedAdditionalRawData) + { + Code = code; + Target = target; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The error code. + public string Code { get; } + /// The target of the particular error. + public string Target { get; } + /// The error message. + public string Message { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs new file mode 100644 index 000000000000..e9b1c78f85de --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetApplicationProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetApplicationProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(GalleryApplications)) + { + writer.WritePropertyName("galleryApplications"u8); + writer.WriteStartArray(); + foreach (var item in GalleryApplications) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetApplicationProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetApplicationProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetApplicationProfile(document.RootElement, options); + } + + internal static ComputeFleetApplicationProfile DeserializeComputeFleetApplicationProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList galleryApplications = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("galleryApplications"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmGalleryApplication.DeserializeComputeFleetVmGalleryApplication(item, options)); + } + galleryApplications = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetApplicationProfile(galleryApplications ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetApplicationProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetApplicationProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetApplicationProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetApplicationProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.cs new file mode 100644 index 000000000000..57b0bb8014ef --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetApplicationProfile.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Contains the list of gallery applications that should be made available to the + /// VM/VMSS + /// + internal partial class ComputeFleetApplicationProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetApplicationProfile() + { + GalleryApplications = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Specifies the gallery applications that should be made available to the VM/VMSS. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetApplicationProfile(IList galleryApplications, IDictionary serializedAdditionalRawData) + { + GalleryApplications = galleryApplications; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the gallery applications that should be made available to the VM/VMSS. + public IList GalleryApplications { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs new file mode 100644 index 000000000000..03f7c0b17148 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetBootDiagnostics : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetBootDiagnostics)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsEnabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(IsEnabled.Value); + } + if (Optional.IsDefined(StorageUri)) + { + writer.WritePropertyName("storageUri"u8); + writer.WriteStringValue(StorageUri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetBootDiagnostics IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetBootDiagnostics)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetBootDiagnostics(document.RootElement, options); + } + + internal static ComputeFleetBootDiagnostics DeserializeComputeFleetBootDiagnostics(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enabled = default; + Uri storageUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("storageUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageUri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetBootDiagnostics(enabled, storageUri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetBootDiagnostics)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetBootDiagnostics IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetBootDiagnostics(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetBootDiagnostics)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.cs new file mode 100644 index 000000000000..c3ab5545ef52 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetBootDiagnostics.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Boot Diagnostics is a debugging feature which allows you to view Console Output + /// and Screenshot to diagnose VM status. You can easily view the output of your + /// console log. Azure also enables you to see a screenshot of the VM from the + /// hypervisor. + /// + public partial class ComputeFleetBootDiagnostics + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetBootDiagnostics() + { + } + + /// Initializes a new instance of . + /// Whether boot diagnostics should be enabled on the Virtual Machine. + /// + /// Uri of the storage account to use for placing the console output and + /// screenshot. If storageUri is not specified while enabling boot diagnostics, + /// managed storage will be used. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetBootDiagnostics(bool? isEnabled, Uri storageUri, IDictionary serializedAdditionalRawData) + { + IsEnabled = isEnabled; + StorageUri = storageUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether boot diagnostics should be enabled on the Virtual Machine. + public bool? IsEnabled { get; set; } + /// + /// Uri of the storage account to use for placing the console output and + /// screenshot. If storageUri is not specified while enabling boot diagnostics, + /// managed storage will be used. + /// + public Uri StorageUri { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetCachingType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetCachingType.cs new file mode 100644 index 000000000000..876f6ecbddba --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetCachingType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the caching requirements. + public readonly partial struct ComputeFleetCachingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetCachingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string ReadOnlyValue = "ReadOnly"; + private const string ReadWriteValue = "ReadWrite"; + + /// 'None' is default for Standard Storage. + public static ComputeFleetCachingType None { get; } = new ComputeFleetCachingType(NoneValue); + /// 'ReadOnly' is default for Premium Storage. + public static ComputeFleetCachingType ReadOnly { get; } = new ComputeFleetCachingType(ReadOnlyValue); + /// 'ReadWrite' is default for OS Disk. + public static ComputeFleetCachingType ReadWrite { get; } = new ComputeFleetCachingType(ReadWriteValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetCachingType left, ComputeFleetCachingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetCachingType left, ComputeFleetCachingType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetCachingType(string value) => new ComputeFleetCachingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetCachingType other && Equals(other); + /// + public bool Equals(ComputeFleetCachingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs new file mode 100644 index 000000000000..149c34e12ef4 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Compute Profile to use for running user's workloads. + public partial class ComputeFleetComputeProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Base Virtual Machine Profile Properties to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". + /// is null. + public ComputeFleetComputeProfile(ComputeFleetVmProfile baseVirtualMachineProfile) + { + Argument.AssertNotNull(baseVirtualMachineProfile, nameof(baseVirtualMachineProfile)); + + BaseVirtualMachineProfile = baseVirtualMachineProfile; + } + + /// Initializes a new instance of . + /// Base Virtual Machine Profile Properties to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". + /// + /// Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machine scale sets and Virtual Machines. + /// The default value will be the latest supported computeApiVersion by Compute Fleet. + /// + /// + /// Specifies the number of fault domains to use when creating the underlying VMSS. + /// A fault domain is a logical group of hardware within an Azure datacenter. + /// VMs in the same fault domain share a common power source and network switch. + /// If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). + /// This property cannot be updated. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetComputeProfile(ComputeFleetVmProfile baseVirtualMachineProfile, string computeApiVersion, int? platformFaultDomainCount, IDictionary serializedAdditionalRawData) + { + BaseVirtualMachineProfile = baseVirtualMachineProfile; + ComputeApiVersion = computeApiVersion; + PlatformFaultDomainCount = platformFaultDomainCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetComputeProfile() + { + } + + /// Base Virtual Machine Profile Properties to be specified according to "specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/{computeApiVersion}/virtualMachineScaleSet.json#/definitions/VirtualMachineScaleSetVMProfile". + public ComputeFleetVmProfile BaseVirtualMachineProfile { get; set; } + /// + /// Specifies the Microsoft.Compute API version to use when creating underlying Virtual Machine scale sets and Virtual Machines. + /// The default value will be the latest supported computeApiVersion by Compute Fleet. + /// + public string ComputeApiVersion { get; set; } + /// + /// Specifies the number of fault domains to use when creating the underlying VMSS. + /// A fault domain is a logical group of hardware within an Azure datacenter. + /// VMs in the same fault domain share a common power source and network switch. + /// If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). + /// This property cannot be updated. + /// + public int? PlatformFaultDomainCount { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs new file mode 100644 index 000000000000..16ec9939b843 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetDiagnosticsProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetDiagnosticsProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(BootDiagnostics)) + { + writer.WritePropertyName("bootDiagnostics"u8); + writer.WriteObjectValue(BootDiagnostics, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetDiagnosticsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetDiagnosticsProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetDiagnosticsProfile(document.RootElement, options); + } + + internal static ComputeFleetDiagnosticsProfile DeserializeComputeFleetDiagnosticsProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetBootDiagnostics bootDiagnostics = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bootDiagnostics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bootDiagnostics = ComputeFleetBootDiagnostics.DeserializeComputeFleetBootDiagnostics(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetDiagnosticsProfile(bootDiagnostics, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetDiagnosticsProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetDiagnosticsProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetDiagnosticsProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetDiagnosticsProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.cs new file mode 100644 index 000000000000..61135e8781dd --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiagnosticsProfile.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. + internal partial class ComputeFleetDiagnosticsProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetDiagnosticsProfile() + { + } + + /// Initializes a new instance of . + /// + /// Boot Diagnostics is a debugging feature which allows you to view Console Output + /// and Screenshot to diagnose VM status. **NOTE**: If storageUri is being + /// specified then ensure that the storage account is in the same region and + /// subscription as the VM. You can easily view the output of your console log. + /// Azure also enables you to see a screenshot of the VM from the hypervisor. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetDiagnosticsProfile(ComputeFleetBootDiagnostics bootDiagnostics, IDictionary serializedAdditionalRawData) + { + BootDiagnostics = bootDiagnostics; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Boot Diagnostics is a debugging feature which allows you to view Console Output + /// and Screenshot to diagnose VM status. **NOTE**: If storageUri is being + /// specified then ensure that the storage account is in the same region and + /// subscription as the VM. You can easily view the output of your console log. + /// Azure also enables you to see a screenshot of the VM from the hypervisor. + /// + public ComputeFleetBootDiagnostics BootDiagnostics { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskOption.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskOption.cs new file mode 100644 index 000000000000..c29a7c40577f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskOption.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the ephemeral disk option for operating system disk. + public readonly partial struct ComputeFleetDiffDiskOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDiffDiskOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LocalValue = "Local"; + + /// Local Option. + public static ComputeFleetDiffDiskOption Local { get; } = new ComputeFleetDiffDiskOption(LocalValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDiffDiskOption left, ComputeFleetDiffDiskOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDiffDiskOption left, ComputeFleetDiffDiskOption right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDiffDiskOption(string value) => new ComputeFleetDiffDiskOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDiffDiskOption other && Equals(other); + /// + public bool Equals(ComputeFleetDiffDiskOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskPlacement.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskPlacement.cs new file mode 100644 index 000000000000..49911cf9e424 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskPlacement.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the ephemeral disk placement for operating system disk. This property + /// can be used by user in the request to choose the location i.e, cache disk or + /// resource disk space for Ephemeral OS disk provisioning. For more information on + /// Ephemeral OS disk size requirements, please refer Ephemeral OS disk size + /// requirements for Windows VM at + /// https://docs.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements + /// and Linux VM at + /// https://docs.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements + /// Minimum api-version for NvmeDisk: 2024-03-01. + /// + public readonly partial struct ComputeFleetDiffDiskPlacement : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDiffDiskPlacement(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CacheDiskValue = "CacheDisk"; + private const string ResourceDiskValue = "ResourceDisk"; + private const string NvmeDiskValue = "NvmeDisk"; + + /// CacheDisk option. + public static ComputeFleetDiffDiskPlacement CacheDisk { get; } = new ComputeFleetDiffDiskPlacement(CacheDiskValue); + /// Resource Disk option. + public static ComputeFleetDiffDiskPlacement ResourceDisk { get; } = new ComputeFleetDiffDiskPlacement(ResourceDiskValue); + /// NvmeDisk option. + public static ComputeFleetDiffDiskPlacement NvmeDisk { get; } = new ComputeFleetDiffDiskPlacement(NvmeDiskValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDiffDiskPlacement left, ComputeFleetDiffDiskPlacement right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDiffDiskPlacement left, ComputeFleetDiffDiskPlacement right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDiffDiskPlacement(string value) => new ComputeFleetDiffDiskPlacement(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDiffDiskPlacement other && Equals(other); + /// + public bool Equals(ComputeFleetDiffDiskPlacement other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs new file mode 100644 index 000000000000..6aca5ab4dda3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetDiffDiskSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetDiffDiskSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Option)) + { + writer.WritePropertyName("option"u8); + writer.WriteStringValue(Option.Value.ToString()); + } + if (Optional.IsDefined(Placement)) + { + writer.WritePropertyName("placement"u8); + writer.WriteStringValue(Placement.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetDiffDiskSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetDiffDiskSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetDiffDiskSettings(document.RootElement, options); + } + + internal static ComputeFleetDiffDiskSettings DeserializeComputeFleetDiffDiskSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetDiffDiskOption? option = default; + ComputeFleetDiffDiskPlacement? placement = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("option"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + option = new ComputeFleetDiffDiskOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("placement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + placement = new ComputeFleetDiffDiskPlacement(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetDiffDiskSettings(option, placement, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetDiffDiskSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetDiffDiskSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetDiffDiskSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetDiffDiskSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.cs new file mode 100644 index 000000000000..8e836fbbf15a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiffDiskSettings.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes the parameters of ephemeral disk settings that can be specified for + /// operating system disk. **Note:** The ephemeral disk settings can only be + /// specified for managed disk. + /// + public partial class ComputeFleetDiffDiskSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetDiffDiskSettings() + { + } + + /// Initializes a new instance of . + /// Specifies the ephemeral disk settings for operating system disk. + /// + /// Specifies the ephemeral disk placement for operating system disk. Possible + /// values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: + /// **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** + /// is used. Refer to the VM size documentation for Windows VM at + /// https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + /// https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM + /// sizes exposes a cache disk. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetDiffDiskSettings(ComputeFleetDiffDiskOption? option, ComputeFleetDiffDiskPlacement? placement, IDictionary serializedAdditionalRawData) + { + Option = option; + Placement = placement; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the ephemeral disk settings for operating system disk. + public ComputeFleetDiffDiskOption? Option { get; set; } + /// + /// Specifies the ephemeral disk placement for operating system disk. Possible + /// values are: **CacheDisk,** **ResourceDisk.** The defaulting behavior is: + /// **CacheDisk** if one is configured for the VM size otherwise **ResourceDisk** + /// is used. Refer to the VM size documentation for Windows VM at + /// https://docs.microsoft.com/azure/virtual-machines/windows/sizes and Linux VM at + /// https://docs.microsoft.com/azure/virtual-machines/linux/sizes to check which VM + /// sizes exposes a cache disk. + /// + public ComputeFleetDiffDiskPlacement? Placement { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskControllerType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskControllerType.cs new file mode 100644 index 000000000000..d00b4e4c4bad --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskControllerType.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the disk controller type configured for the VM and + /// VirtualMachineScaleSet. This property is only supported for virtual machines + /// whose operating system disk and VM sku supports Generation 2 + /// (https://docs.microsoft.com/en-us/azure/virtual-machines/generation-2), please + /// check the HyperVGenerations capability returned as part of VM sku capabilities + /// in the response of Microsoft.Compute SKUs api for the region contains V2 + /// (https://docs.microsoft.com/rest/api/compute/resourceskus/list). For more + /// information about Disk Controller Types supported please refer to + /// https://aka.ms/azure-diskcontrollertypes. + /// + public readonly partial struct ComputeFleetDiskControllerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDiskControllerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ScsiValue = "SCSI"; + private const string NvmeValue = "NVMe"; + + /// SCSI disk type. + public static ComputeFleetDiskControllerType Scsi { get; } = new ComputeFleetDiskControllerType(ScsiValue); + /// NVMe disk type. + public static ComputeFleetDiskControllerType Nvme { get; } = new ComputeFleetDiskControllerType(NvmeValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDiskControllerType left, ComputeFleetDiskControllerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDiskControllerType left, ComputeFleetDiskControllerType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDiskControllerType(string value) => new ComputeFleetDiskControllerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDiskControllerType other && Equals(other); + /// + public bool Equals(ComputeFleetDiskControllerType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskCreateOptionType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskCreateOptionType.cs new file mode 100644 index 000000000000..ca045ef145f6 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskCreateOptionType.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies how the virtual machine should be created. + public readonly partial struct ComputeFleetDiskCreateOptionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDiskCreateOptionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FromImageValue = "FromImage"; + private const string EmptyValue = "Empty"; + private const string AttachValue = "Attach"; + private const string CopyValue = "Copy"; + private const string RestoreValue = "Restore"; + + /// + /// This value is used when you are using an image to create the virtual machine. + /// If you are using a platform image, you also use the imageReference element + /// described above. If you are using a marketplace image, you also use the + /// plan element previously described. + /// + public static ComputeFleetDiskCreateOptionType FromImage { get; } = new ComputeFleetDiskCreateOptionType(FromImageValue); + /// This value is used when creating an empty data disk. + public static ComputeFleetDiskCreateOptionType Empty { get; } = new ComputeFleetDiskCreateOptionType(EmptyValue); + /// This value is used when you are using a specialized disk to create the virtual machine. + public static ComputeFleetDiskCreateOptionType Attach { get; } = new ComputeFleetDiskCreateOptionType(AttachValue); + /// This value is used to create a data disk from a snapshot or another disk. + public static ComputeFleetDiskCreateOptionType Copy { get; } = new ComputeFleetDiskCreateOptionType(CopyValue); + /// This value is used to create a data disk from a disk restore point. + public static ComputeFleetDiskCreateOptionType Restore { get; } = new ComputeFleetDiskCreateOptionType(RestoreValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDiskCreateOptionType left, ComputeFleetDiskCreateOptionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDiskCreateOptionType left, ComputeFleetDiskCreateOptionType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDiskCreateOptionType(string value) => new ComputeFleetDiskCreateOptionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDiskCreateOptionType other && Equals(other); + /// + public bool Equals(ComputeFleetDiskCreateOptionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskDeleteOptionType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskDeleteOptionType.cs new file mode 100644 index 000000000000..911ee07aa984 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDiskDeleteOptionType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the behavior of the managed disk when the VM gets deleted, for + /// example whether the managed disk is deleted or detached. Supported values are: + /// **Delete.** If this value is used, the managed disk is deleted when VM gets + /// deleted. **Detach.** If this value is used, the managed disk is retained after + /// VM gets deleted. Minimum api-version: 2021-03-01. + /// + public readonly partial struct ComputeFleetDiskDeleteOptionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDiskDeleteOptionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "Delete"; + private const string DetachValue = "Detach"; + + /// If this value is used, the managed disk is deleted when VM gets deleted. + public static ComputeFleetDiskDeleteOptionType Delete { get; } = new ComputeFleetDiskDeleteOptionType(DeleteValue); + /// If this value is used, the managed disk is retained after VM gets deleted. + public static ComputeFleetDiskDeleteOptionType Detach { get; } = new ComputeFleetDiskDeleteOptionType(DetachValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDiskDeleteOptionType left, ComputeFleetDiskDeleteOptionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDiskDeleteOptionType left, ComputeFleetDiskDeleteOptionType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDiskDeleteOptionType(string value) => new ComputeFleetDiskDeleteOptionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDiskDeleteOptionType other && Equals(other); + /// + public bool Equals(ComputeFleetDiskDeleteOptionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDomainNameLabelScopeType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDomainNameLabelScopeType.cs new file mode 100644 index 000000000000..8a30a08da20c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetDomainNameLabelScopeType.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// The Domain name label scope.The concatenation of the hashed domain name label + /// that generated according to the policy from domain name label scope and vm + /// index will be the domain name labels of the PublicIPAddress resources that will + /// be created + /// + public readonly partial struct ComputeFleetDomainNameLabelScopeType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetDomainNameLabelScopeType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TenantReuseValue = "TenantReuse"; + private const string SubscriptionReuseValue = "SubscriptionReuse"; + private const string ResourceGroupReuseValue = "ResourceGroupReuse"; + private const string NoReuseValue = "NoReuse"; + + /// TenantReuse type. + public static ComputeFleetDomainNameLabelScopeType TenantReuse { get; } = new ComputeFleetDomainNameLabelScopeType(TenantReuseValue); + /// SubscriptionReuse type. + public static ComputeFleetDomainNameLabelScopeType SubscriptionReuse { get; } = new ComputeFleetDomainNameLabelScopeType(SubscriptionReuseValue); + /// ResourceGroupReuse type. + public static ComputeFleetDomainNameLabelScopeType ResourceGroupReuse { get; } = new ComputeFleetDomainNameLabelScopeType(ResourceGroupReuseValue); + /// NoReuse type. + public static ComputeFleetDomainNameLabelScopeType NoReuse { get; } = new ComputeFleetDomainNameLabelScopeType(NoReuseValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetDomainNameLabelScopeType left, ComputeFleetDomainNameLabelScopeType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetDomainNameLabelScopeType left, ComputeFleetDomainNameLabelScopeType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetDomainNameLabelScopeType(string value) => new ComputeFleetDomainNameLabelScopeType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetDomainNameLabelScopeType other && Equals(other); + /// + public bool Equals(ComputeFleetDomainNameLabelScopeType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs new file mode 100644 index 000000000000..02179b39f216 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetEncryptionIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetEncryptionIdentity)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(UserAssignedIdentityResourceId)) + { + writer.WritePropertyName("userAssignedIdentityResourceId"u8); + writer.WriteStringValue(UserAssignedIdentityResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetEncryptionIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetEncryptionIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetEncryptionIdentity(document.RootElement, options); + } + + internal static ComputeFleetEncryptionIdentity DeserializeComputeFleetEncryptionIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier userAssignedIdentityResourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("userAssignedIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedIdentityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetEncryptionIdentity(userAssignedIdentityResourceId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetEncryptionIdentity)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetEncryptionIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetEncryptionIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetEncryptionIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.cs new file mode 100644 index 000000000000..160e3df57d3c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEncryptionIdentity.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the Managed Identity used by ADE to get access token for keyvault + /// operations. + /// + internal partial class ComputeFleetEncryptionIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetEncryptionIdentity() + { + } + + /// Initializes a new instance of . + /// Specifies ARM Resource ID of one of the user identities associated with the VM. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetEncryptionIdentity(ResourceIdentifier userAssignedIdentityResourceId, IDictionary serializedAdditionalRawData) + { + UserAssignedIdentityResourceId = userAssignedIdentityResourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies ARM Resource ID of one of the user identities associated with the VM. + public ResourceIdentifier UserAssignedIdentityResourceId { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEvictionPolicy.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEvictionPolicy.cs new file mode 100644 index 000000000000..07b0776ceb2c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetEvictionPolicy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Different kind of eviction policies. + public readonly partial struct ComputeFleetEvictionPolicy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetEvictionPolicy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "Delete"; + private const string DeallocateValue = "Deallocate"; + + /// When evicted, the Spot VM will be deleted and the corresponding capacity will be updated to reflect this. + public static ComputeFleetEvictionPolicy Delete { get; } = new ComputeFleetEvictionPolicy(DeleteValue); + /// When evicted, the Spot VM will be deallocated/stopped. + public static ComputeFleetEvictionPolicy Deallocate { get; } = new ComputeFleetEvictionPolicy(DeallocateValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetEvictionPolicy left, ComputeFleetEvictionPolicy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetEvictionPolicy left, ComputeFleetEvictionPolicy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetEvictionPolicy(string value) => new ComputeFleetEvictionPolicy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetEvictionPolicy other && Equals(other); + /// + public bool Equals(ComputeFleetEvictionPolicy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetIPVersion.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetIPVersion.cs new file mode 100644 index 000000000000..cbf999f7796a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetIPVersion.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + /// values are: 'IPv4' and 'IPv6'. + /// + public readonly partial struct ComputeFleetIPVersion : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetIPVersion(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IPv4Value = "IPv4"; + private const string IPv6Value = "IPv6"; + + /// IPv4 version. + public static ComputeFleetIPVersion IPv4 { get; } = new ComputeFleetIPVersion(IPv4Value); + /// IPv6 version. + public static ComputeFleetIPVersion IPv6 { get; } = new ComputeFleetIPVersion(IPv6Value); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetIPVersion left, ComputeFleetIPVersion right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetIPVersion left, ComputeFleetIPVersion right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetIPVersion(string value) => new ComputeFleetIPVersion(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetIPVersion other && Equals(other); + /// + public bool Equals(ComputeFleetIPVersion other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs new file mode 100644 index 000000000000..774950f0c8e3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.Serialization.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetImageReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetImageReference)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(Offer)) + { + writer.WritePropertyName("offer"u8); + writer.WriteStringValue(Offer); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (options.Format != "W" && Optional.IsDefined(ExactVersion)) + { + writer.WritePropertyName("exactVersion"u8); + writer.WriteStringValue(ExactVersion); + } + if (Optional.IsDefined(SharedGalleryImageId)) + { + writer.WritePropertyName("sharedGalleryImageId"u8); + writer.WriteStringValue(SharedGalleryImageId); + } + if (Optional.IsDefined(CommunityGalleryImageId)) + { + writer.WritePropertyName("communityGalleryImageId"u8); + writer.WriteStringValue(CommunityGalleryImageId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetImageReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetImageReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetImageReference(document.RootElement, options); + } + + internal static ComputeFleetImageReference DeserializeComputeFleetImageReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string publisher = default; + string offer = default; + string sku = default; + string version = default; + string exactVersion = default; + string sharedGalleryImageId = default; + string communityGalleryImageId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("offer"u8)) + { + offer = property.Value.GetString(); + continue; + } + if (property.NameEquals("sku"u8)) + { + sku = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("exactVersion"u8)) + { + exactVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("sharedGalleryImageId"u8)) + { + sharedGalleryImageId = property.Value.GetString(); + continue; + } + if (property.NameEquals("communityGalleryImageId"u8)) + { + communityGalleryImageId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetImageReference( + id, + publisher, + offer, + sku, + version, + exactVersion, + sharedGalleryImageId, + communityGalleryImageId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetImageReference)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetImageReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetImageReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetImageReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.cs new file mode 100644 index 000000000000..942f9ac529ce --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetImageReference.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies information about the image to use. You can specify information about + /// platform images, marketplace images, or virtual machine images. This element is + /// required when you want to use a platform image, marketplace image, or virtual + /// machine image, but is not used in other creation operations. NOTE: Image + /// reference publisher and offer can only be set when you create the scale set. + /// + public partial class ComputeFleetImageReference + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetImageReference() + { + } + + /// Initializes a new instance of . + /// Resource Id. + /// The image publisher. + /// + /// Specifies the offer of the platform image or marketplace image used to create + /// the virtual machine. + /// + /// The image SKU. + /// + /// Specifies the version of the platform image or marketplace image used to create + /// the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + /// Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest + /// version of an image available at deploy time. Even if you use 'latest', the VM + /// image will not automatically update after deploy time even if a new version + /// becomes available. Please do not use field 'version' for gallery image + /// deployment, gallery image should always use 'id' field for deployment, to use 'latest' + /// version of gallery image, just set + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + /// in the 'id' field without version input. + /// + /// + /// Specifies in decimal numbers, the version of platform image or marketplace + /// image used to create the virtual machine. This readonly field differs from 'version', + /// only if the value specified in 'version' field is 'latest'. + /// + /// + /// Specified the shared gallery image unique id for vm deployment. This can be + /// fetched from shared gallery image GET call. + /// + /// + /// Specified the community gallery image unique id for vm deployment. This can be + /// fetched from community gallery image GET call. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetImageReference(ResourceIdentifier id, string publisher, string offer, string sku, string version, string exactVersion, string sharedGalleryImageId, string communityGalleryImageId, IDictionary serializedAdditionalRawData) + { + Id = id; + Publisher = publisher; + Offer = offer; + Sku = sku; + Version = version; + ExactVersion = exactVersion; + SharedGalleryImageId = sharedGalleryImageId; + CommunityGalleryImageId = communityGalleryImageId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource Id. + public ResourceIdentifier Id { get; set; } + /// The image publisher. + public string Publisher { get; set; } + /// + /// Specifies the offer of the platform image or marketplace image used to create + /// the virtual machine. + /// + public string Offer { get; set; } + /// The image SKU. + public string Sku { get; set; } + /// + /// Specifies the version of the platform image or marketplace image used to create + /// the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. + /// Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest + /// version of an image available at deploy time. Even if you use 'latest', the VM + /// image will not automatically update after deploy time even if a new version + /// becomes available. Please do not use field 'version' for gallery image + /// deployment, gallery image should always use 'id' field for deployment, to use 'latest' + /// version of gallery image, just set + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}' + /// in the 'id' field without version input. + /// + public string Version { get; set; } + /// + /// Specifies in decimal numbers, the version of platform image or marketplace + /// image used to create the virtual machine. This readonly field differs from 'version', + /// only if the value specified in 'version' field is 'latest'. + /// + public string ExactVersion { get; } + /// + /// Specified the shared gallery image unique id for vm deployment. This can be + /// fetched from shared gallery image GET call. + /// + public string SharedGalleryImageId { get; set; } + /// + /// Specified the community gallery image unique id for vm deployment. This can be + /// fetched from community gallery image GET call. + /// + public string CommunityGalleryImageId { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs new file mode 100644 index 000000000000..e255795755e6 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetInnerError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetInnerError)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ExceptionType)) + { + writer.WritePropertyName("exceptionType"u8); + writer.WriteStringValue(ExceptionType); + } + if (Optional.IsDefined(ErrorDetail)) + { + writer.WritePropertyName("errorDetail"u8); + writer.WriteStringValue(ErrorDetail); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetInnerError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetInnerError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetInnerError(document.RootElement, options); + } + + internal static ComputeFleetInnerError DeserializeComputeFleetInnerError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string exceptionType = default; + string errorDetail = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("exceptionType"u8)) + { + exceptionType = property.Value.GetString(); + continue; + } + if (property.NameEquals("errorDetail"u8)) + { + errorDetail = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetInnerError(exceptionType, errorDetail, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetInnerError)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetInnerError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetInnerError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetInnerError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.cs new file mode 100644 index 000000000000..a75c2c26722f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetInnerError.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Inner error details. + public partial class ComputeFleetInnerError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ComputeFleetInnerError() + { + } + + /// Initializes a new instance of . + /// The exception type. + /// The internal error message or exception dump. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetInnerError(string exceptionType, string errorDetail, IDictionary serializedAdditionalRawData) + { + ExceptionType = exceptionType; + ErrorDetail = errorDetail; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The exception type. + public string ExceptionType { get; } + /// The internal error message or exception dump. + public string ErrorDetail { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs new file mode 100644 index 000000000000..979a435b17d9 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.Serialization.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetKeyVaultSecretReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetKeyVaultSecretReference)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("secretUrl"u8); + writer.WriteStringValue(SecretUri.AbsoluteUri); + writer.WritePropertyName("sourceVault"u8); + JsonSerializer.Serialize(writer, SourceVault); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetKeyVaultSecretReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetKeyVaultSecretReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetKeyVaultSecretReference(document.RootElement, options); + } + + internal static ComputeFleetKeyVaultSecretReference DeserializeComputeFleetKeyVaultSecretReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri secretUrl = default; + WritableSubResource sourceVault = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secretUrl"u8)) + { + secretUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceVault"u8)) + { + sourceVault = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetKeyVaultSecretReference(secretUrl, sourceVault, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetKeyVaultSecretReference)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetKeyVaultSecretReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetKeyVaultSecretReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetKeyVaultSecretReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.cs new file mode 100644 index 000000000000..05224e986a35 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetKeyVaultSecretReference.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a reference to Key Vault Secret. + public partial class ComputeFleetKeyVaultSecretReference + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The URL referencing a secret in a Key Vault. + /// The relative URL of the Key Vault containing the secret. + /// or is null. + public ComputeFleetKeyVaultSecretReference(Uri secretUri, WritableSubResource sourceVault) + { + Argument.AssertNotNull(secretUri, nameof(secretUri)); + Argument.AssertNotNull(sourceVault, nameof(sourceVault)); + + SecretUri = secretUri; + SourceVault = sourceVault; + } + + /// Initializes a new instance of . + /// The URL referencing a secret in a Key Vault. + /// The relative URL of the Key Vault containing the secret. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetKeyVaultSecretReference(Uri secretUri, WritableSubResource sourceVault, IDictionary serializedAdditionalRawData) + { + SecretUri = secretUri; + SourceVault = sourceVault; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetKeyVaultSecretReference() + { + } + + /// The URL referencing a secret in a Key Vault. + public Uri SecretUri { get; set; } + /// The relative URL of the Key Vault containing the secret. + internal WritableSubResource SourceVault { get; set; } + /// Gets or sets Id. + public ResourceIdentifier SourceVaultId + { + get => SourceVault is null ? default : SourceVault.Id; + set + { + if (SourceVault is null) + SourceVault = new WritableSubResource(); + SourceVault.Id = value; + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs new file mode 100644 index 000000000000..090b425e6ecf --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetLinuxConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetLinuxConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsPasswordAuthenticationDisabled)) + { + writer.WritePropertyName("disablePasswordAuthentication"u8); + writer.WriteBooleanValue(IsPasswordAuthenticationDisabled.Value); + } + if (Optional.IsDefined(Ssh)) + { + writer.WritePropertyName("ssh"u8); + writer.WriteObjectValue(Ssh, options); + } + if (Optional.IsDefined(IsVmAgentProvisioned)) + { + writer.WritePropertyName("provisionVMAgent"u8); + writer.WriteBooleanValue(IsVmAgentProvisioned.Value); + } + if (Optional.IsDefined(PatchSettings)) + { + writer.WritePropertyName("patchSettings"u8); + writer.WriteObjectValue(PatchSettings, options); + } + if (Optional.IsDefined(IsVmAgentPlatformUpdatesEnabled)) + { + writer.WritePropertyName("enableVMAgentPlatformUpdates"u8); + writer.WriteBooleanValue(IsVmAgentPlatformUpdatesEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetLinuxConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetLinuxConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetLinuxConfiguration(document.RootElement, options); + } + + internal static ComputeFleetLinuxConfiguration DeserializeComputeFleetLinuxConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? disablePasswordAuthentication = default; + ComputeFleetSshConfiguration ssh = default; + bool? provisionVmAgent = default; + ComputeFleetLinuxPatchSettings patchSettings = default; + bool? enableVmAgentPlatformUpdates = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disablePasswordAuthentication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disablePasswordAuthentication = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("ssh"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ssh = ComputeFleetSshConfiguration.DeserializeComputeFleetSshConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("provisionVMAgent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisionVmAgent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("patchSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchSettings = ComputeFleetLinuxPatchSettings.DeserializeComputeFleetLinuxPatchSettings(property.Value, options); + continue; + } + if (property.NameEquals("enableVMAgentPlatformUpdates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableVmAgentPlatformUpdates = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetLinuxConfiguration( + disablePasswordAuthentication, + ssh, + provisionVmAgent, + patchSettings, + enableVmAgentPlatformUpdates, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetLinuxConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetLinuxConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.cs new file mode 100644 index 000000000000..0ec5e9fa0925 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxConfiguration.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the Linux operating system settings on the virtual machine. For a + /// list of supported Linux distributions, see [Linux on Azure-Endorsed + /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + /// + public partial class ComputeFleetLinuxConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetLinuxConfiguration() + { + } + + /// Initializes a new instance of . + /// Specifies whether password authentication should be disabled. + /// Specifies the ssh key configuration for a Linux OS. + /// + /// Indicates whether virtual machine agent should be provisioned on the virtual + /// machine. When this property is not specified in the request body, default + /// behavior is to set it to true. This will ensure that VM Agent is installed on + /// the VM so that extensions can be added to the VM later. + /// + /// [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + /// + /// Indicates whether VMAgent Platform Updates is enabled for the Linux virtual + /// machine. Default value is false. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetLinuxConfiguration(bool? isPasswordAuthenticationDisabled, ComputeFleetSshConfiguration ssh, bool? isVmAgentProvisioned, ComputeFleetLinuxPatchSettings patchSettings, bool? isVmAgentPlatformUpdatesEnabled, IDictionary serializedAdditionalRawData) + { + IsPasswordAuthenticationDisabled = isPasswordAuthenticationDisabled; + Ssh = ssh; + IsVmAgentProvisioned = isVmAgentProvisioned; + PatchSettings = patchSettings; + IsVmAgentPlatformUpdatesEnabled = isVmAgentPlatformUpdatesEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies whether password authentication should be disabled. + public bool? IsPasswordAuthenticationDisabled { get; set; } + /// Specifies the ssh key configuration for a Linux OS. + internal ComputeFleetSshConfiguration Ssh { get; set; } + /// The list of SSH public keys used to authenticate with linux based VMs. + public IList SshPublicKeys + { + get + { + if (Ssh is null) + Ssh = new ComputeFleetSshConfiguration(); + return Ssh.PublicKeys; + } + } + + /// + /// Indicates whether virtual machine agent should be provisioned on the virtual + /// machine. When this property is not specified in the request body, default + /// behavior is to set it to true. This will ensure that VM Agent is installed on + /// the VM so that extensions can be added to the VM later. + /// + public bool? IsVmAgentProvisioned { get; set; } + /// [Preview Feature] Specifies settings related to VM Guest Patching on Linux. + public ComputeFleetLinuxPatchSettings PatchSettings { get; set; } + /// + /// Indicates whether VMAgent Platform Updates is enabled for the Linux virtual + /// machine. Default value is false. + /// + public bool? IsVmAgentPlatformUpdatesEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchAssessmentMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchAssessmentMode.cs new file mode 100644 index 000000000000..89cc72e7c1e7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchAssessmentMode.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + /// machine.

Possible values are:

**ImageDefault** - You + /// control the timing of patch assessments on a virtual machine.

+ /// **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + /// The property provisionVMAgent must be true. + ///
+ public readonly partial struct ComputeFleetLinuxPatchAssessmentMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetLinuxPatchAssessmentMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ImageDefaultValue = "ImageDefault"; + private const string AutomaticByPlatformValue = "AutomaticByPlatform"; + + /// You control the timing of patch assessments on a virtual machine. + public static ComputeFleetLinuxPatchAssessmentMode ImageDefault { get; } = new ComputeFleetLinuxPatchAssessmentMode(ImageDefaultValue); + /// The platform will trigger periodic patch assessments.The property provisionVMAgent must be true. + public static ComputeFleetLinuxPatchAssessmentMode AutomaticByPlatform { get; } = new ComputeFleetLinuxPatchAssessmentMode(AutomaticByPlatformValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetLinuxPatchAssessmentMode left, ComputeFleetLinuxPatchAssessmentMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetLinuxPatchAssessmentMode left, ComputeFleetLinuxPatchAssessmentMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetLinuxPatchAssessmentMode(string value) => new ComputeFleetLinuxPatchAssessmentMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetLinuxPatchAssessmentMode other && Equals(other); + /// + public bool Equals(ComputeFleetLinuxPatchAssessmentMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs new file mode 100644 index 000000000000..2df519de962a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetLinuxPatchSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetLinuxPatchSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PatchMode)) + { + writer.WritePropertyName("patchMode"u8); + writer.WriteStringValue(PatchMode.Value.ToString()); + } + if (Optional.IsDefined(AssessmentMode)) + { + writer.WritePropertyName("assessmentMode"u8); + writer.WriteStringValue(AssessmentMode.Value.ToString()); + } + if (Optional.IsDefined(AutomaticByPlatformSettings)) + { + writer.WritePropertyName("automaticByPlatformSettings"u8); + writer.WriteObjectValue(AutomaticByPlatformSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetLinuxPatchSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetLinuxPatchSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetLinuxPatchSettings(document.RootElement, options); + } + + internal static ComputeFleetLinuxPatchSettings DeserializeComputeFleetLinuxPatchSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetLinuxVmGuestPatchMode? patchMode = default; + ComputeFleetLinuxPatchAssessmentMode? assessmentMode = default; + ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patchMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchMode = new ComputeFleetLinuxVmGuestPatchMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("assessmentMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessmentMode = new ComputeFleetLinuxPatchAssessmentMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("automaticByPlatformSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + automaticByPlatformSettings = ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.DeserializeComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetLinuxPatchSettings(patchMode, assessmentMode, automaticByPlatformSettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxPatchSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetLinuxPatchSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetLinuxPatchSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxPatchSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.cs new file mode 100644 index 000000000000..1c5db0d29f56 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxPatchSettings.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies settings related to VM Guest Patching on Linux. + public partial class ComputeFleetLinuxPatchSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetLinuxPatchSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - The + /// virtual machine's default patching configuration is used. <br /><br /> + /// **AutomaticByPlatform** - The virtual machine will be automatically updated by + /// the platform. The property provisionVMAgent must be true + /// + /// + /// Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + /// machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You + /// control the timing of patch assessments on a virtual machine. <br /><br /> + /// **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + /// The property provisionVMAgent must be true. + /// + /// + /// Specifies additional settings for patch mode AutomaticByPlatform in VM Guest + /// Patching on Linux. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetLinuxPatchSettings(ComputeFleetLinuxVmGuestPatchMode? patchMode, ComputeFleetLinuxPatchAssessmentMode? assessmentMode, ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings, IDictionary serializedAdditionalRawData) + { + PatchMode = patchMode; + AssessmentMode = assessmentMode; + AutomaticByPlatformSettings = automaticByPlatformSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - The + /// virtual machine's default patching configuration is used. <br /><br /> + /// **AutomaticByPlatform** - The virtual machine will be automatically updated by + /// the platform. The property provisionVMAgent must be true + /// + public ComputeFleetLinuxVmGuestPatchMode? PatchMode { get; set; } + /// + /// Specifies the mode of VM Guest Patch Assessment for the IaaS virtual + /// machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You + /// control the timing of patch assessments on a virtual machine. <br /><br /> + /// **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + /// The property provisionVMAgent must be true. + /// + public ComputeFleetLinuxPatchAssessmentMode? AssessmentMode { get; set; } + /// + /// Specifies additional settings for patch mode AutomaticByPlatform in VM Guest + /// Patching on Linux. + /// + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting.cs new file mode 100644 index 000000000000..411ab05b0a2c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// + public readonly partial struct ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string IfRequiredValue = "IfRequired"; + private const string NeverValue = "Never"; + private const string AlwaysValue = "Always"; + + /// Unknown Reboot setting. + public static ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Unknown { get; } = new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(UnknownValue); + /// IfRequired Reboot setting. + public static ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting IfRequired { get; } = new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(IfRequiredValue); + /// Never Reboot setting. + public static ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Never { get; } = new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(NeverValue); + /// Always Reboot setting. + public static ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting Always { get; } = new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(AlwaysValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting left, ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting left, ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(string value) => new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting other && Equals(other); + /// + public bool Equals(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs new file mode 100644 index 000000000000..2b8bbc2bc993 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(RebootSetting)) + { + writer.WritePropertyName("rebootSetting"u8); + writer.WriteStringValue(RebootSetting.Value.ToString()); + } + if (Optional.IsDefined(IsBypassPlatformSafetyChecksOnUserScheduleEnabled)) + { + writer.WritePropertyName("bypassPlatformSafetyChecksOnUserSchedule"u8); + writer.WriteBooleanValue(IsBypassPlatformSafetyChecksOnUserScheduleEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(document.RootElement, options); + } + + internal static ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings DeserializeComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting? rebootSetting = default; + bool? bypassPlatformSafetyChecksOnUserSchedule = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rebootSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rebootSetting = new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting(property.Value.GetString()); + continue; + } + if (property.NameEquals("bypassPlatformSafetyChecksOnUserSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bypassPlatformSafetyChecksOnUserSchedule = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(rebootSetting, bypassPlatformSafetyChecksOnUserSchedule, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.cs new file mode 100644 index 000000000000..432f844b3927 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies additional settings to be applied when patch mode AutomaticByPlatform + /// is selected in Linux patch settings. + /// + public partial class ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// + /// Enables customer to schedule patching without accidental upgrades. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetLinuxVmGuestPatchAutomaticByPlatformSettings(ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting? rebootSetting, bool? isBypassPlatformSafetyChecksOnUserScheduleEnabled, IDictionary serializedAdditionalRawData) + { + RebootSetting = rebootSetting; + IsBypassPlatformSafetyChecksOnUserScheduleEnabled = isBypassPlatformSafetyChecksOnUserScheduleEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// + public ComputeFleetLinuxVmGuestPatchAutomaticByPlatformRebootSetting? RebootSetting { get; set; } + /// Enables customer to schedule patching without accidental upgrades. + public bool? IsBypassPlatformSafetyChecksOnUserScheduleEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchMode.cs new file mode 100644 index 000000000000..277ca7b4e3c4 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetLinuxVmGuestPatchMode.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible. + /// + public readonly partial struct ComputeFleetLinuxVmGuestPatchMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetLinuxVmGuestPatchMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ImageDefaultValue = "ImageDefault"; + private const string AutomaticByPlatformValue = "AutomaticByPlatform"; + + /// The virtual machine's default patching configuration is used. + public static ComputeFleetLinuxVmGuestPatchMode ImageDefault { get; } = new ComputeFleetLinuxVmGuestPatchMode(ImageDefaultValue); + /// The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true. + public static ComputeFleetLinuxVmGuestPatchMode AutomaticByPlatform { get; } = new ComputeFleetLinuxVmGuestPatchMode(AutomaticByPlatformValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetLinuxVmGuestPatchMode left, ComputeFleetLinuxVmGuestPatchMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetLinuxVmGuestPatchMode left, ComputeFleetLinuxVmGuestPatchMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetLinuxVmGuestPatchMode(string value) => new ComputeFleetLinuxVmGuestPatchMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetLinuxVmGuestPatchMode other && Equals(other); + /// + public bool Equals(ComputeFleetLinuxVmGuestPatchMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkApiVersion.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkApiVersion.cs new file mode 100644 index 000000000000..8e8b41743bc0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkApiVersion.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// specifies the Microsoft.Network API version used when creating networking + /// resources in the Network Interface Configurations for Virtual Machine Scale Set + /// with orchestration mode 'Flexible' + /// + public readonly partial struct ComputeFleetNetworkApiVersion : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetNetworkApiVersion(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string V20201101Value = "2020-11-01"; + + /// Initial version supported. Later versions are supported as well. + public static ComputeFleetNetworkApiVersion V20201101 { get; } = new ComputeFleetNetworkApiVersion(V20201101Value); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetNetworkApiVersion left, ComputeFleetNetworkApiVersion right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetNetworkApiVersion left, ComputeFleetNetworkApiVersion right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetNetworkApiVersion(string value) => new ComputeFleetNetworkApiVersion(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetNetworkApiVersion other && Equals(other); + /// + public bool Equals(ComputeFleetNetworkApiVersion other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliaryMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliaryMode.cs new file mode 100644 index 000000000000..27eb491f295c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliaryMode.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// + public readonly partial struct ComputeFleetNetworkInterfaceAuxiliaryMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetNetworkInterfaceAuxiliaryMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string AcceleratedConnectionsValue = "AcceleratedConnections"; + private const string FloatingValue = "Floating"; + + /// None Mode. + public static ComputeFleetNetworkInterfaceAuxiliaryMode None { get; } = new ComputeFleetNetworkInterfaceAuxiliaryMode(NoneValue); + /// AcceleratedConnections Mode. + public static ComputeFleetNetworkInterfaceAuxiliaryMode AcceleratedConnections { get; } = new ComputeFleetNetworkInterfaceAuxiliaryMode(AcceleratedConnectionsValue); + /// Floating Mode. + public static ComputeFleetNetworkInterfaceAuxiliaryMode Floating { get; } = new ComputeFleetNetworkInterfaceAuxiliaryMode(FloatingValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetNetworkInterfaceAuxiliaryMode left, ComputeFleetNetworkInterfaceAuxiliaryMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetNetworkInterfaceAuxiliaryMode left, ComputeFleetNetworkInterfaceAuxiliaryMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetNetworkInterfaceAuxiliaryMode(string value) => new ComputeFleetNetworkInterfaceAuxiliaryMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetNetworkInterfaceAuxiliaryMode other && Equals(other); + /// + public bool Equals(ComputeFleetNetworkInterfaceAuxiliaryMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliarySku.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliarySku.cs new file mode 100644 index 000000000000..600d4967e83f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetNetworkInterfaceAuxiliarySku.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// + public readonly partial struct ComputeFleetNetworkInterfaceAuxiliarySku : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetNetworkInterfaceAuxiliarySku(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string A1Value = "A1"; + private const string A2Value = "A2"; + private const string A4Value = "A4"; + private const string A8Value = "A8"; + + /// no sku. + public static ComputeFleetNetworkInterfaceAuxiliarySku None { get; } = new ComputeFleetNetworkInterfaceAuxiliarySku(NoneValue); + /// A1 sku. + public static ComputeFleetNetworkInterfaceAuxiliarySku A1 { get; } = new ComputeFleetNetworkInterfaceAuxiliarySku(A1Value); + /// A2 sku. + public static ComputeFleetNetworkInterfaceAuxiliarySku A2 { get; } = new ComputeFleetNetworkInterfaceAuxiliarySku(A2Value); + /// A4 sku. + public static ComputeFleetNetworkInterfaceAuxiliarySku A4 { get; } = new ComputeFleetNetworkInterfaceAuxiliarySku(A4Value); + /// A8 sku. + public static ComputeFleetNetworkInterfaceAuxiliarySku A8 { get; } = new ComputeFleetNetworkInterfaceAuxiliarySku(A8Value); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetNetworkInterfaceAuxiliarySku left, ComputeFleetNetworkInterfaceAuxiliarySku right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetNetworkInterfaceAuxiliarySku left, ComputeFleetNetworkInterfaceAuxiliarySku right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetNetworkInterfaceAuxiliarySku(string value) => new ComputeFleetNetworkInterfaceAuxiliarySku(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetNetworkInterfaceAuxiliarySku other && Equals(other); + /// + public bool Equals(ComputeFleetNetworkInterfaceAuxiliarySku other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.cs new file mode 100644 index 000000000000..619a0dd51bcf --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOSImageNotificationProfile.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies OS Image Scheduled Event related configurations. + public partial class ComputeFleetOSImageNotificationProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetOSImageNotificationProfile() + { + } + + /// Initializes a new instance of . + /// + /// Length of time a Virtual Machine being reimaged or having its OS upgraded will + /// have to potentially approve the OS Image Scheduled Event before the event is + /// auto approved (timed out). The configuration is specified in ISO 8601 format, + /// and the value must not exceed 15 minutes (PT15M) + /// + /// Specifies whether the OS Image Scheduled event is enabled or disabled. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetOSImageNotificationProfile(string notBeforeTimeout, bool? isEnabled, IDictionary serializedAdditionalRawData) + { + NotBeforeTimeout = notBeforeTimeout; + IsEnabled = isEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Length of time a Virtual Machine being reimaged or having its OS upgraded will + /// have to potentially approve the OS Image Scheduled Event before the event is + /// auto approved (timed out). The configuration is specified in ISO 8601 format, + /// and the value must not exceed 15 minutes (PT15M) + /// + public string NotBeforeTimeout { get; set; } + /// Specifies whether the OS Image Scheduled event is enabled or disabled. + public bool? IsEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOperatingSystemType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOperatingSystemType.cs new file mode 100644 index 000000000000..5591e628c43a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetOperatingSystemType.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// This property allows you to specify the type of the OS that is included in the + /// disk if creating a VM from user-image or a specialized VHD. Possible values + /// are: **Windows,** **Linux.** + /// + public readonly partial struct ComputeFleetOperatingSystemType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetOperatingSystemType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + + /// Windows OS type. + public static ComputeFleetOperatingSystemType Windows { get; } = new ComputeFleetOperatingSystemType(WindowsValue); + /// Linux OS type. + public static ComputeFleetOperatingSystemType Linux { get; } = new ComputeFleetOperatingSystemType(LinuxValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetOperatingSystemType left, ComputeFleetOperatingSystemType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetOperatingSystemType left, ComputeFleetOperatingSystemType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetOperatingSystemType(string value) => new ComputeFleetOperatingSystemType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetOperatingSystemType other && Equals(other); + /// + public bool Equals(ComputeFleetOperatingSystemType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs new file mode 100644 index 000000000000..d573cb9046d8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetPatch)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + if (Optional.IsDefined(Plan)) + { + writer.WritePropertyName("plan"u8); + JsonSerializer.Serialize(writer, Plan); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetPatch(document.RootElement, options); + } + + internal static ComputeFleetPatch DeserializeComputeFleetPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + ManagedServiceIdentity identity = default; + ArmPlan plan = default; + ComputeFleetProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("plan"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + plan = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetProperties.DeserializeComputeFleetProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetPatch(tags ?? new ChangeTrackingDictionary(), identity, plan, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetPatch)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.cs new file mode 100644 index 000000000000..7c9440aec518 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPatch.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Fleet Update Model. + public partial class ComputeFleetPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Updatable managed service identity. + /// Updatable resource plan. + /// RP-specific updatable properties. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetPatch(IDictionary tags, ManagedServiceIdentity identity, ArmPlan plan, ComputeFleetProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Identity = identity; + Plan = plan; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Updatable resource plan. + public ArmPlan Plan { get; set; } + /// RP-specific updatable properties. + public ComputeFleetProperties Properties { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs new file mode 100644 index 000000000000..ef31137b7980 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(SpotPriorityProfile)) + { + writer.WritePropertyName("spotPriorityProfile"u8); + writer.WriteObjectValue(SpotPriorityProfile, options); + } + if (Optional.IsDefined(RegularPriorityProfile)) + { + writer.WritePropertyName("regularPriorityProfile"u8); + writer.WriteObjectValue(RegularPriorityProfile, options); + } + writer.WritePropertyName("vmSizesProfile"u8); + writer.WriteStartArray(); + foreach (var item in VmSizesProfile) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("computeProfile"u8); + writer.WriteObjectValue(ComputeProfile, options); + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UniqueId)) + { + writer.WritePropertyName("uniqueId"u8); + writer.WriteStringValue(UniqueId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetProperties(document.RootElement, options); + } + + internal static ComputeFleetProperties DeserializeComputeFleetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetProvisioningState? provisioningState = default; + SpotPriorityProfile spotPriorityProfile = default; + RegularPriorityProfile regularPriorityProfile = default; + IList vmSizesProfile = default; + ComputeFleetComputeProfile computeProfile = default; + DateTimeOffset? timeCreated = default; + string uniqueId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ComputeFleetProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("spotPriorityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + spotPriorityProfile = SpotPriorityProfile.DeserializeSpotPriorityProfile(property.Value, options); + continue; + } + if (property.NameEquals("regularPriorityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + regularPriorityProfile = RegularPriorityProfile.DeserializeRegularPriorityProfile(property.Value, options); + continue; + } + if (property.NameEquals("vmSizesProfile"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmSizeProfile.DeserializeComputeFleetVmSizeProfile(item, options)); + } + vmSizesProfile = array; + continue; + } + if (property.NameEquals("computeProfile"u8)) + { + computeProfile = ComputeFleetComputeProfile.DeserializeComputeFleetComputeProfile(property.Value, options); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("uniqueId"u8)) + { + uniqueId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetProperties( + provisioningState, + spotPriorityProfile, + regularPriorityProfile, + vmSizesProfile, + computeProfile, + timeCreated, + uniqueId, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs new file mode 100644 index 000000000000..fe9bffc332da --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Details of the Compute Fleet. + public partial class ComputeFleetProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// List of VM sizes supported for Compute Fleet. + /// Compute Profile to use for running user's workloads. + /// or is null. + public ComputeFleetProperties(IEnumerable vmSizesProfile, ComputeFleetComputeProfile computeProfile) + { + Argument.AssertNotNull(vmSizesProfile, nameof(vmSizesProfile)); + Argument.AssertNotNull(computeProfile, nameof(computeProfile)); + + VmSizesProfile = vmSizesProfile.ToList(); + ComputeProfile = computeProfile; + } + + /// Initializes a new instance of . + /// The status of the last operation. + /// Configuration Options for Spot instances in Compute Fleet. + /// Configuration Options for Regular instances in Compute Fleet. + /// List of VM sizes supported for Compute Fleet. + /// Compute Profile to use for running user's workloads. + /// Specifies the time at which the Compute Fleet is created. + /// Specifies the ID which uniquely identifies a Compute Fleet. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetProperties(ComputeFleetProvisioningState? provisioningState, SpotPriorityProfile spotPriorityProfile, RegularPriorityProfile regularPriorityProfile, IList vmSizesProfile, ComputeFleetComputeProfile computeProfile, DateTimeOffset? createdOn, string uniqueId, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + SpotPriorityProfile = spotPriorityProfile; + RegularPriorityProfile = regularPriorityProfile; + VmSizesProfile = vmSizesProfile; + ComputeProfile = computeProfile; + CreatedOn = createdOn; + UniqueId = uniqueId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetProperties() + { + } + + /// The status of the last operation. + public ComputeFleetProvisioningState? ProvisioningState { get; } + /// Configuration Options for Spot instances in Compute Fleet. + public SpotPriorityProfile SpotPriorityProfile { get; set; } + /// Configuration Options for Regular instances in Compute Fleet. + public RegularPriorityProfile RegularPriorityProfile { get; set; } + /// List of VM sizes supported for Compute Fleet. + public IList VmSizesProfile { get; } + /// Compute Profile to use for running user's workloads. + public ComputeFleetComputeProfile ComputeProfile { get; set; } + /// Specifies the time at which the Compute Fleet is created. + public DateTimeOffset? CreatedOn { get; } + /// Specifies the ID which uniquely identifies a Compute Fleet. + public string UniqueId { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProtocolType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProtocolType.cs new file mode 100644 index 000000000000..23910058cb6e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProtocolType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the protocol of WinRM listener. Possible values are: **http,** + /// **https.** + /// + public readonly partial struct ComputeFleetProtocolType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetProtocolType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HttpValue = "Http"; + private const string HttpsValue = "Https"; + + /// Http protocol. + public static ComputeFleetProtocolType Http { get; } = new ComputeFleetProtocolType(HttpValue); + /// Https protocol. + public static ComputeFleetProtocolType Https { get; } = new ComputeFleetProtocolType(HttpsValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetProtocolType left, ComputeFleetProtocolType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetProtocolType left, ComputeFleetProtocolType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetProtocolType(string value) => new ComputeFleetProtocolType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetProtocolType other && Equals(other); + /// + public bool Equals(ComputeFleetProtocolType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProvisioningState.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProvisioningState.cs new file mode 100644 index 000000000000..5c54461dfcd9 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The status of the current operation. + public readonly partial struct ComputeFleetProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string MigratingValue = "Migrating"; + + /// Resource has been created. + public static ComputeFleetProvisioningState Succeeded { get; } = new ComputeFleetProvisioningState(SucceededValue); + /// Resource creation failed. + public static ComputeFleetProvisioningState Failed { get; } = new ComputeFleetProvisioningState(FailedValue); + /// Resource creation was canceled. + public static ComputeFleetProvisioningState Canceled { get; } = new ComputeFleetProvisioningState(CanceledValue); + /// Initial creation in progress. + public static ComputeFleetProvisioningState Creating { get; } = new ComputeFleetProvisioningState(CreatingValue); + /// Update in progress. + public static ComputeFleetProvisioningState Updating { get; } = new ComputeFleetProvisioningState(UpdatingValue); + /// Deletion in progress. + public static ComputeFleetProvisioningState Deleting { get; } = new ComputeFleetProvisioningState(DeletingValue); + /// Resource is being migrated from one subscription or resource group to another. + public static ComputeFleetProvisioningState Migrating { get; } = new ComputeFleetProvisioningState(MigratingValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetProvisioningState left, ComputeFleetProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetProvisioningState left, ComputeFleetProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetProvisioningState(string value) => new ComputeFleetProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetProvisioningState other && Equals(other); + /// + public bool Equals(ComputeFleetProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.cs new file mode 100644 index 000000000000..68a4f5abcdb8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProxyAgentSettings.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum + /// api-version: 2023-09-01. + /// + public partial class ComputeFleetProxyAgentSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetProxyAgentSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies whether ProxyAgent feature should be enabled on the virtual machine + /// or virtual machine scale set. + /// + /// + /// Specifies the mode that ProxyAgent will execute on if the feature is enabled. + /// ProxyAgent will start to audit or monitor but not enforce access control over + /// requests to host endpoints in Audit mode, while in Enforce mode it will enforce + /// access control. The default value is Enforce mode. + /// + /// + /// Increase the value of this property allows user to reset the key used for + /// securing communication channel between guest and host. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetProxyAgentSettings(bool? isEnabled, ProxyAgentExecuteMode? mode, int? keyIncarnationId, IDictionary serializedAdditionalRawData) + { + IsEnabled = isEnabled; + Mode = mode; + KeyIncarnationId = keyIncarnationId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies whether ProxyAgent feature should be enabled on the virtual machine + /// or virtual machine scale set. + /// + public bool? IsEnabled { get; set; } + /// + /// Specifies the mode that ProxyAgent will execute on if the feature is enabled. + /// ProxyAgent will start to audit or monitor but not enforce access control over + /// requests to host endpoints in Audit mode, while in Enforce mode it will enforce + /// access control. The default value is Enforce mode. + /// + public ProxyAgentExecuteMode? Mode { get; set; } + /// + /// Increase the value of this property allows user to reset the key used for + /// securing communication channel between guest and host. + /// + public int? KeyIncarnationId { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs new file mode 100644 index 000000000000..bc2f6b2907b0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetPublicIPAddressSku : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetPublicIPAddressSku)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (Optional.IsDefined(Tier)) + { + writer.WritePropertyName("tier"u8); + writer.WriteStringValue(Tier.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetPublicIPAddressSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetPublicIPAddressSku)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetPublicIPAddressSku(document.RootElement, options); + } + + internal static ComputeFleetPublicIPAddressSku DeserializeComputeFleetPublicIPAddressSku(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetPublicIPAddressSkuName? name = default; + ComputeFleetPublicIPAddressSkuTier? tier = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new ComputeFleetPublicIPAddressSkuName(property.Value.GetString()); + continue; + } + if (property.NameEquals("tier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tier = new ComputeFleetPublicIPAddressSkuTier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetPublicIPAddressSku(name, tier, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetPublicIPAddressSku)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetPublicIPAddressSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetPublicIPAddressSku(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetPublicIPAddressSku)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.cs new file mode 100644 index 000000000000..78ad954460cf --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSku.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes the public IP Sku. It can only be set with OrchestrationMode as + /// Flexible. + /// + public partial class ComputeFleetPublicIPAddressSku + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetPublicIPAddressSku() + { + } + + /// Initializes a new instance of . + /// Specify public IP sku name. + /// Specify public IP sku tier. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetPublicIPAddressSku(ComputeFleetPublicIPAddressSkuName? name, ComputeFleetPublicIPAddressSkuTier? tier, IDictionary serializedAdditionalRawData) + { + Name = name; + Tier = tier; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specify public IP sku name. + public ComputeFleetPublicIPAddressSkuName? Name { get; set; } + /// Specify public IP sku tier. + public ComputeFleetPublicIPAddressSkuTier? Tier { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuName.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuName.cs new file mode 100644 index 000000000000..2174980dc24b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuName.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specify public IP sku name. + public readonly partial struct ComputeFleetPublicIPAddressSkuName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetPublicIPAddressSkuName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BasicValue = "Basic"; + private const string StandardValue = "Standard"; + + /// Basic sku name. + public static ComputeFleetPublicIPAddressSkuName Basic { get; } = new ComputeFleetPublicIPAddressSkuName(BasicValue); + /// Standard sku name. + public static ComputeFleetPublicIPAddressSkuName Standard { get; } = new ComputeFleetPublicIPAddressSkuName(StandardValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetPublicIPAddressSkuName left, ComputeFleetPublicIPAddressSkuName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetPublicIPAddressSkuName left, ComputeFleetPublicIPAddressSkuName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetPublicIPAddressSkuName(string value) => new ComputeFleetPublicIPAddressSkuName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetPublicIPAddressSkuName other && Equals(other); + /// + public bool Equals(ComputeFleetPublicIPAddressSkuName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuTier.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuTier.cs new file mode 100644 index 000000000000..2d2eb6062fae --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetPublicIPAddressSkuTier.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specify public IP sku tier. + public readonly partial struct ComputeFleetPublicIPAddressSkuTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetPublicIPAddressSkuTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RegionalValue = "Regional"; + private const string GlobalValue = "Global"; + + /// Regional sku tier. + public static ComputeFleetPublicIPAddressSkuTier Regional { get; } = new ComputeFleetPublicIPAddressSkuTier(RegionalValue); + /// Global sku tier. + public static ComputeFleetPublicIPAddressSkuTier Global { get; } = new ComputeFleetPublicIPAddressSkuTier(GlobalValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetPublicIPAddressSkuTier left, ComputeFleetPublicIPAddressSkuTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetPublicIPAddressSkuTier left, ComputeFleetPublicIPAddressSkuTier right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetPublicIPAddressSkuTier(string value) => new ComputeFleetPublicIPAddressSkuTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetPublicIPAddressSkuTier other && Equals(other); + /// + public bool Equals(ComputeFleetPublicIPAddressSkuTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs new file mode 100644 index 000000000000..dcdb4b81dea6 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetScheduledEventsProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetScheduledEventsProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(TerminateNotificationProfile)) + { + writer.WritePropertyName("terminateNotificationProfile"u8); + writer.WriteObjectValue(TerminateNotificationProfile, options); + } + if (Optional.IsDefined(OSImageNotificationProfile)) + { + writer.WritePropertyName("osImageNotificationProfile"u8); + writer.WriteObjectValue(OSImageNotificationProfile, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetScheduledEventsProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetScheduledEventsProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetScheduledEventsProfile(document.RootElement, options); + } + + internal static ComputeFleetScheduledEventsProfile DeserializeComputeFleetScheduledEventsProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetTerminateNotificationProfile terminateNotificationProfile = default; + ComputeFleetOSImageNotificationProfile osImageNotificationProfile = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("terminateNotificationProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + terminateNotificationProfile = ComputeFleetTerminateNotificationProfile.DeserializeComputeFleetTerminateNotificationProfile(property.Value, options); + continue; + } + if (property.NameEquals("osImageNotificationProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osImageNotificationProfile = ComputeFleetOSImageNotificationProfile.DeserializeComputeFleetOSImageNotificationProfile(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetScheduledEventsProfile(terminateNotificationProfile, osImageNotificationProfile, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetScheduledEventsProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetScheduledEventsProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetScheduledEventsProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetScheduledEventsProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.cs new file mode 100644 index 000000000000..0d79b652734a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetScheduledEventsProfile.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies Scheduled Event related configurations. + public partial class ComputeFleetScheduledEventsProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetScheduledEventsProfile() + { + } + + /// Initializes a new instance of . + /// Specifies Terminate Scheduled Event related configurations. + /// Specifies OS Image Scheduled Event related configurations. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetScheduledEventsProfile(ComputeFleetTerminateNotificationProfile terminateNotificationProfile, ComputeFleetOSImageNotificationProfile osImageNotificationProfile, IDictionary serializedAdditionalRawData) + { + TerminateNotificationProfile = terminateNotificationProfile; + OSImageNotificationProfile = osImageNotificationProfile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies Terminate Scheduled Event related configurations. + public ComputeFleetTerminateNotificationProfile TerminateNotificationProfile { get; set; } + /// Specifies OS Image Scheduled Event related configurations. + public ComputeFleetOSImageNotificationProfile OSImageNotificationProfile { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityEncryptionType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityEncryptionType.cs new file mode 100644 index 000000000000..d1ec7d568b5d --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityEncryptionType.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the EncryptionType of the managed disk. + /// **Note:** It can be set for only Confidential VMs. + /// + public readonly partial struct ComputeFleetSecurityEncryptionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetSecurityEncryptionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string VmGuestStateOnlyValue = "VMGuestStateOnly"; + private const string DiskWithVmGuestStateValue = "DiskWithVMGuestState"; + private const string NonPersistedTpmValue = "NonPersistedTPM"; + + /// + /// EncryptionType of the managed disk is set to VMGuestStateOnly for encryption + /// of just the VMGuestState blob. + /// + public static ComputeFleetSecurityEncryptionType VmGuestStateOnly { get; } = new ComputeFleetSecurityEncryptionType(VmGuestStateOnlyValue); + /// + /// EncryptionType of the managed disk is set to DiskWithVMGuestState for encryption + /// of the managed disk along with VMGuestState blob. + /// + public static ComputeFleetSecurityEncryptionType DiskWithVmGuestState { get; } = new ComputeFleetSecurityEncryptionType(DiskWithVmGuestStateValue); + /// + /// EncryptionType of the managed disk is set to NonPersistedTPM for not persisting + /// firmware state in the VMGuestState blob. + /// + public static ComputeFleetSecurityEncryptionType NonPersistedTpm { get; } = new ComputeFleetSecurityEncryptionType(NonPersistedTpmValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetSecurityEncryptionType left, ComputeFleetSecurityEncryptionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetSecurityEncryptionType left, ComputeFleetSecurityEncryptionType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetSecurityEncryptionType(string value) => new ComputeFleetSecurityEncryptionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetSecurityEncryptionType other && Equals(other); + /// + public bool Equals(ComputeFleetSecurityEncryptionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs new file mode 100644 index 000000000000..9166503e4d30 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetSecurityPostureReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSecurityPostureReference)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsCollectionDefined(ExcludeExtensions)) + { + writer.WritePropertyName("excludeExtensions"u8); + writer.WriteStartArray(); + foreach (var item in ExcludeExtensions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsOverridable)) + { + writer.WritePropertyName("isOverridable"u8); + writer.WriteBooleanValue(IsOverridable.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetSecurityPostureReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSecurityPostureReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetSecurityPostureReference(document.RootElement, options); + } + + internal static ComputeFleetSecurityPostureReference DeserializeComputeFleetSecurityPostureReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IList excludeExtensions = default; + bool? isOverridable = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("excludeExtensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + excludeExtensions = array; + continue; + } + if (property.NameEquals("isOverridable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOverridable = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetSecurityPostureReference(id, excludeExtensions ?? new ChangeTrackingList(), isOverridable, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetSecurityPostureReference)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetSecurityPostureReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetSecurityPostureReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetSecurityPostureReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.cs new file mode 100644 index 000000000000..b0595191513c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityPostureReference.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the security posture to be used for all virtual machines in the scale + /// set. Minimum api-version: 2023-03-01 + /// + public partial class ComputeFleetSecurityPostureReference + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetSecurityPostureReference() + { + ExcludeExtensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The security posture reference id in the form of + /// /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest + /// + /// + /// List of virtual machine extension names to exclude when applying the security + /// posture. + /// + /// Whether the security posture can be overridden by the user. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetSecurityPostureReference(string id, IList excludeExtensions, bool? isOverridable, IDictionary serializedAdditionalRawData) + { + Id = id; + ExcludeExtensions = excludeExtensions; + IsOverridable = isOverridable; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The security posture reference id in the form of + /// /CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest + /// + public string Id { get; set; } + /// + /// List of virtual machine extension names to exclude when applying the security + /// posture. + /// + public IList ExcludeExtensions { get; } + /// Whether the security posture can be overridden by the user. + public bool? IsOverridable { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs new file mode 100644 index 000000000000..87d89420da58 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetSecurityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSecurityProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(UefiSettings)) + { + writer.WritePropertyName("uefiSettings"u8); + writer.WriteObjectValue(UefiSettings, options); + } + if (Optional.IsDefined(IsEncryptionAtHostEnabled)) + { + writer.WritePropertyName("encryptionAtHost"u8); + writer.WriteBooleanValue(IsEncryptionAtHostEnabled.Value); + } + if (Optional.IsDefined(SecurityType)) + { + writer.WritePropertyName("securityType"u8); + writer.WriteStringValue(SecurityType.Value.ToString()); + } + if (Optional.IsDefined(EncryptionIdentity)) + { + writer.WritePropertyName("encryptionIdentity"u8); + writer.WriteObjectValue(EncryptionIdentity, options); + } + if (Optional.IsDefined(ProxyAgentSettings)) + { + writer.WritePropertyName("proxyAgentSettings"u8); + writer.WriteObjectValue(ProxyAgentSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSecurityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetSecurityProfile(document.RootElement, options); + } + + internal static ComputeFleetSecurityProfile DeserializeComputeFleetSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetUefiSettings uefiSettings = default; + bool? encryptionAtHost = default; + ComputeFleetSecurityType? securityType = default; + ComputeFleetEncryptionIdentity encryptionIdentity = default; + ComputeFleetProxyAgentSettings proxyAgentSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uefiSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uefiSettings = ComputeFleetUefiSettings.DeserializeComputeFleetUefiSettings(property.Value, options); + continue; + } + if (property.NameEquals("encryptionAtHost"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionAtHost = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("securityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityType = new ComputeFleetSecurityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("encryptionIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryptionIdentity = ComputeFleetEncryptionIdentity.DeserializeComputeFleetEncryptionIdentity(property.Value, options); + continue; + } + if (property.NameEquals("proxyAgentSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + proxyAgentSettings = ComputeFleetProxyAgentSettings.DeserializeComputeFleetProxyAgentSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetSecurityProfile( + uefiSettings, + encryptionAtHost, + securityType, + encryptionIdentity, + proxyAgentSettings, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetSecurityProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetSecurityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetSecurityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetSecurityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.cs new file mode 100644 index 000000000000..655a0ebe1463 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityProfile.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the Security profile settings for the virtual machine or virtual + /// machine scale set. + /// + public partial class ComputeFleetSecurityProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetSecurityProfile() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the security settings like secure boot and vTPM used while creating + /// the virtual machine. Minimum api-version: 2020-12-01. + /// + /// + /// This property can be used by user in the request to enable or disable the Host + /// Encryption for the virtual machine or virtual machine scale set. This will + /// enable the encryption for all the disks including Resource/Temp disk at host + /// itself. The default behavior is: The Encryption at host will be disabled unless + /// this property is set to true for the resource. + /// + /// + /// Specifies the SecurityType of the virtual machine. It has to be set to any + /// specified value to enable UefiSettings. The default behavior is: UefiSettings + /// will not be enabled unless this property is set. + /// + /// + /// Specifies the Managed Identity used by ADE to get access token for keyvault + /// operations. + /// + /// + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum + /// api-version: 2023-09-01. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetSecurityProfile(ComputeFleetUefiSettings uefiSettings, bool? isEncryptionAtHostEnabled, ComputeFleetSecurityType? securityType, ComputeFleetEncryptionIdentity encryptionIdentity, ComputeFleetProxyAgentSettings proxyAgentSettings, IDictionary serializedAdditionalRawData) + { + UefiSettings = uefiSettings; + IsEncryptionAtHostEnabled = isEncryptionAtHostEnabled; + SecurityType = securityType; + EncryptionIdentity = encryptionIdentity; + ProxyAgentSettings = proxyAgentSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the security settings like secure boot and vTPM used while creating + /// the virtual machine. Minimum api-version: 2020-12-01. + /// + public ComputeFleetUefiSettings UefiSettings { get; set; } + /// + /// This property can be used by user in the request to enable or disable the Host + /// Encryption for the virtual machine or virtual machine scale set. This will + /// enable the encryption for all the disks including Resource/Temp disk at host + /// itself. The default behavior is: The Encryption at host will be disabled unless + /// this property is set to true for the resource. + /// + public bool? IsEncryptionAtHostEnabled { get; set; } + /// + /// Specifies the SecurityType of the virtual machine. It has to be set to any + /// specified value to enable UefiSettings. The default behavior is: UefiSettings + /// will not be enabled unless this property is set. + /// + public ComputeFleetSecurityType? SecurityType { get; set; } + /// + /// Specifies the Managed Identity used by ADE to get access token for keyvault + /// operations. + /// + internal ComputeFleetEncryptionIdentity EncryptionIdentity { get; set; } + /// Specifies ARM Resource ID of one of the user identities associated with the VM. + public ResourceIdentifier UserAssignedIdentityResourceId + { + get => EncryptionIdentity is null ? default : EncryptionIdentity.UserAssignedIdentityResourceId; + set + { + if (EncryptionIdentity is null) + EncryptionIdentity = new ComputeFleetEncryptionIdentity(); + EncryptionIdentity.UserAssignedIdentityResourceId = value; + } + } + + /// + /// Specifies ProxyAgent settings while creating the virtual machine. Minimum + /// api-version: 2023-09-01. + /// + public ComputeFleetProxyAgentSettings ProxyAgentSettings { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityType.cs new file mode 100644 index 000000000000..7b97d0bc1ff0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSecurityType.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the SecurityType of the virtual machine. It has to be set to any + /// specified value to enable UefiSettings. The default behavior is: UefiSettings + /// will not be enabled unless this property is set. + /// + public readonly partial struct ComputeFleetSecurityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetSecurityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TrustedLaunchValue = "TrustedLaunch"; + private const string ConfidentialVmValue = "ConfidentialVM"; + + /// TrustedLaunch security type. + public static ComputeFleetSecurityType TrustedLaunch { get; } = new ComputeFleetSecurityType(TrustedLaunchValue); + /// ConfidentialVM security type. + public static ComputeFleetSecurityType ConfidentialVm { get; } = new ComputeFleetSecurityType(ConfidentialVmValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetSecurityType left, ComputeFleetSecurityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetSecurityType left, ComputeFleetSecurityType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetSecurityType(string value) => new ComputeFleetSecurityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetSecurityType other && Equals(other); + /// + public bool Equals(ComputeFleetSecurityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs new file mode 100644 index 000000000000..791b7b0424a7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetSshConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSshConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(PublicKeys)) + { + writer.WritePropertyName("publicKeys"u8); + writer.WriteStartArray(); + foreach (var item in PublicKeys) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetSshConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSshConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetSshConfiguration(document.RootElement, options); + } + + internal static ComputeFleetSshConfiguration DeserializeComputeFleetSshConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList publicKeys = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("publicKeys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetSshPublicKey.DeserializeComputeFleetSshPublicKey(item, options)); + } + publicKeys = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetSshConfiguration(publicKeys ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetSshConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetSshConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetSshConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetSshConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.cs new file mode 100644 index 000000000000..941f8a22adb4 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// SSH configuration for Linux based VMs running on Azure. + internal partial class ComputeFleetSshConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetSshConfiguration() + { + PublicKeys = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of SSH public keys used to authenticate with linux based VMs. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetSshConfiguration(IList publicKeys, IDictionary serializedAdditionalRawData) + { + PublicKeys = publicKeys; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of SSH public keys used to authenticate with linux based VMs. + public IList PublicKeys { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs new file mode 100644 index 000000000000..99d8fe18f895 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetSshPublicKey : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSshPublicKey)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (Optional.IsDefined(KeyData)) + { + writer.WritePropertyName("keyData"u8); + writer.WriteStringValue(KeyData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetSshPublicKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetSshPublicKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetSshPublicKey(document.RootElement, options); + } + + internal static ComputeFleetSshPublicKey DeserializeComputeFleetSshPublicKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string path = default; + string keyData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyData"u8)) + { + keyData = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetSshPublicKey(path, keyData, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetSshPublicKey)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetSshPublicKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetSshPublicKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetSshPublicKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.cs new file mode 100644 index 000000000000..292cdb5c4231 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetSshPublicKey.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Contains information about SSH certificate public key and the path on the Linux + /// VM where the public key is placed. + /// + public partial class ComputeFleetSshPublicKey + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetSshPublicKey() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the full path on the created VM where ssh public key is stored. If + /// the file already exists, the specified key is appended to the file. Example: + /// /home/user/.ssh/authorized_keys + /// + /// + /// SSH public key certificate used to authenticate with the VM through ssh. The + /// key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, + /// see [Create SSH keys on Linux and Mac for Linux VMs in + /// Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetSshPublicKey(string path, string keyData, IDictionary serializedAdditionalRawData) + { + Path = path; + KeyData = keyData; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the full path on the created VM where ssh public key is stored. If + /// the file already exists, the specified key is appended to the file. Example: + /// /home/user/.ssh/authorized_keys + /// + public string Path { get; set; } + /// + /// SSH public key certificate used to authenticate with the VM through ssh. The + /// key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, + /// see [Create SSH keys on Linux and Mac for Linux VMs in + /// Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + /// + public string KeyData { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetStorageAccountType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetStorageAccountType.cs new file mode 100644 index 000000000000..0a9e350b147b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetStorageAccountType.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the storage account type for the managed disk. Managed OS disk + /// storage account type can only be set when you create the scale set. NOTE: + /// UltraSSD_LRS can only be used with data disks. It cannot be used with OS Disk. + /// Standard_LRS uses Standard HDD. StandardSSD_LRS uses Standard SSD. Premium_LRS + /// uses Premium SSD. UltraSSD_LRS uses Ultra disk. Premium_ZRS uses Premium SSD + /// zone redundant storage. StandardSSD_ZRS uses Standard SSD zone redundant + /// storage. For more information regarding disks supported for Windows Virtual + /// Machines, refer to + /// https://docs.microsoft.com/azure/virtual-machines/windows/disks-types and, for + /// Linux Virtual Machines, refer to + /// https://docs.microsoft.com/azure/virtual-machines/linux/disks-types + /// + public readonly partial struct ComputeFleetStorageAccountType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetStorageAccountType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardLrsValue = "Standard_LRS"; + private const string PremiumLrsValue = "Premium_LRS"; + private const string StandardSsdLrdValue = "StandardSSD_LRS"; + private const string UltraSsdLrsValue = "UltraSSD_LRS"; + private const string PremiumZrsValue = "Premium_ZRS"; + private const string StandardSsdZrsValue = "StandardSSD_ZRS"; + private const string PremiumV2LRSValue = "PremiumV2_LRS"; + + /// Standard_LRS option. + public static ComputeFleetStorageAccountType StandardLrs { get; } = new ComputeFleetStorageAccountType(StandardLrsValue); + /// Premium_LRS option. + public static ComputeFleetStorageAccountType PremiumLrs { get; } = new ComputeFleetStorageAccountType(PremiumLrsValue); + /// StandardSSD_LRS option. + public static ComputeFleetStorageAccountType StandardSsdLrd { get; } = new ComputeFleetStorageAccountType(StandardSsdLrdValue); + /// UltraSSD_LRS option. + public static ComputeFleetStorageAccountType UltraSsdLrs { get; } = new ComputeFleetStorageAccountType(UltraSsdLrsValue); + /// Premium_ZRS option. + public static ComputeFleetStorageAccountType PremiumZrs { get; } = new ComputeFleetStorageAccountType(PremiumZrsValue); + /// StandardSSD_ZRS option. + public static ComputeFleetStorageAccountType StandardSsdZrs { get; } = new ComputeFleetStorageAccountType(StandardSsdZrsValue); + /// PremiumV2_LRS option. + public static ComputeFleetStorageAccountType PremiumV2LRS { get; } = new ComputeFleetStorageAccountType(PremiumV2LRSValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetStorageAccountType left, ComputeFleetStorageAccountType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetStorageAccountType left, ComputeFleetStorageAccountType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetStorageAccountType(string value) => new ComputeFleetStorageAccountType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetStorageAccountType other && Equals(other); + /// + public bool Equals(ComputeFleetStorageAccountType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.cs new file mode 100644 index 000000000000..3dc3f37b1812 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetTerminateNotificationProfile.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies Terminate Scheduled Event related configurations. + public partial class ComputeFleetTerminateNotificationProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetTerminateNotificationProfile() + { + } + + /// Initializes a new instance of . + /// + /// Configurable length of time a Virtual Machine being deleted will have to + /// potentially approve the Terminate Scheduled Event before the event is auto + /// approved (timed out). The configuration must be specified in ISO 8601 format, + /// the default value is 5 minutes (PT5M) + /// + /// Specifies whether the Terminate Scheduled event is enabled or disabled. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetTerminateNotificationProfile(string notBeforeTimeout, bool? isEnabled, IDictionary serializedAdditionalRawData) + { + NotBeforeTimeout = notBeforeTimeout; + IsEnabled = isEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Configurable length of time a Virtual Machine being deleted will have to + /// potentially approve the Terminate Scheduled Event before the event is auto + /// approved (timed out). The configuration must be specified in ISO 8601 format, + /// the default value is 5 minutes (PT5M) + /// + public string NotBeforeTimeout { get; set; } + /// Specifies whether the Terminate Scheduled event is enabled or disabled. + public bool? IsEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs new file mode 100644 index 000000000000..c70fae5c42af --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetUefiSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetUefiSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsSecureBootEnabled)) + { + writer.WritePropertyName("secureBootEnabled"u8); + writer.WriteBooleanValue(IsSecureBootEnabled.Value); + } + if (Optional.IsDefined(IsVTpmEnabled)) + { + writer.WritePropertyName("vTpmEnabled"u8); + writer.WriteBooleanValue(IsVTpmEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetUefiSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetUefiSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetUefiSettings(document.RootElement, options); + } + + internal static ComputeFleetUefiSettings DeserializeComputeFleetUefiSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? secureBootEnabled = default; + bool? vTpmEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("secureBootEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + secureBootEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("vTpmEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vTpmEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetUefiSettings(secureBootEnabled, vTpmEnabled, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetUefiSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetUefiSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetUefiSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetUefiSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.cs new file mode 100644 index 000000000000..040ea58ef3b0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetUefiSettings.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the security settings like secure boot and vTPM used while creating + /// the virtual machine. Minimum api-version: 2020-12-01. + /// + public partial class ComputeFleetUefiSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetUefiSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies whether secure boot should be enabled on the virtual machine. Minimum + /// api-version: 2020-12-01. + /// + /// + /// Specifies whether vTPM should be enabled on the virtual machine. Minimum + /// api-version: 2020-12-01. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetUefiSettings(bool? isSecureBootEnabled, bool? isVTpmEnabled, IDictionary serializedAdditionalRawData) + { + IsSecureBootEnabled = isSecureBootEnabled; + IsVTpmEnabled = isVTpmEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies whether secure boot should be enabled on the virtual machine. Minimum + /// api-version: 2020-12-01. + /// + public bool? IsSecureBootEnabled { get; set; } + /// + /// Specifies whether vTPM should be enabled on the virtual machine. Minimum + /// api-version: 2020-12-01. + /// + public bool? IsVTpmEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs new file mode 100644 index 000000000000..2c17ffcb8e9a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVaultCertificate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVaultCertificate)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(CertificateUri)) + { + writer.WritePropertyName("certificateUrl"u8); + writer.WriteStringValue(CertificateUri.AbsoluteUri); + } + if (Optional.IsDefined(CertificateStore)) + { + writer.WritePropertyName("certificateStore"u8); + writer.WriteStringValue(CertificateStore); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVaultCertificate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVaultCertificate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVaultCertificate(document.RootElement, options); + } + + internal static ComputeFleetVaultCertificate DeserializeComputeFleetVaultCertificate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri certificateUrl = default; + string certificateStore = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("certificateUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + certificateUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("certificateStore"u8)) + { + certificateStore = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVaultCertificate(certificateUrl, certificateStore, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVaultCertificate)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVaultCertificate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVaultCertificate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVaultCertificate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.cs new file mode 100644 index 000000000000..74c15f225abd --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultCertificate.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes a single certificate reference in a Key Vault, and where the + /// certificate should reside on the VM. + /// + public partial class ComputeFleetVaultCertificate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVaultCertificate() + { + } + + /// Initializes a new instance of . + /// + /// This is the URL of a certificate that has been uploaded to Key Vault as a + /// secret. For adding a secret to the Key Vault, see [Add a key or secret to the + /// key + /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + /// In this case, your certificate needs to be It is the Base64 encoding of the + /// following JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a virtual + /// machine it is recommended to use the [Azure Key Vault virtual machine extension + /// for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + /// + /// For Windows VMs, specifies the certificate store on the Virtual Machine to + /// which the certificate should be added. The specified certificate store is + /// implicitly in the LocalMachine account. For Linux VMs, the certificate file is + /// placed under the /var/lib/waagent directory, with the file name + /// <UppercaseThumbprint>.crt for the X509 certificate file and + /// <UppercaseThumbprint>.prv for private key. Both of these files are .pem + /// formatted. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVaultCertificate(Uri certificateUri, string certificateStore, IDictionary serializedAdditionalRawData) + { + CertificateUri = certificateUri; + CertificateStore = certificateStore; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// This is the URL of a certificate that has been uploaded to Key Vault as a + /// secret. For adding a secret to the Key Vault, see [Add a key or secret to the + /// key + /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + /// In this case, your certificate needs to be It is the Base64 encoding of the + /// following JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a virtual + /// machine it is recommended to use the [Azure Key Vault virtual machine extension + /// for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + public Uri CertificateUri { get; set; } + /// + /// For Windows VMs, specifies the certificate store on the Virtual Machine to + /// which the certificate should be added. The specified certificate store is + /// implicitly in the LocalMachine account. For Linux VMs, the certificate file is + /// placed under the /var/lib/waagent directory, with the file name + /// <UppercaseThumbprint>.crt for the X509 certificate file and + /// <UppercaseThumbprint>.prv for private key. Both of these files are .pem + /// formatted. + /// + public string CertificateStore { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs new file mode 100644 index 000000000000..2aece832749b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVaultSecretGroup : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVaultSecretGroup)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(SourceVault)) + { + writer.WritePropertyName("sourceVault"u8); + JsonSerializer.Serialize(writer, SourceVault); + } + if (Optional.IsCollectionDefined(VaultCertificates)) + { + writer.WritePropertyName("vaultCertificates"u8); + writer.WriteStartArray(); + foreach (var item in VaultCertificates) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVaultSecretGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVaultSecretGroup)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVaultSecretGroup(document.RootElement, options); + } + + internal static ComputeFleetVaultSecretGroup DeserializeComputeFleetVaultSecretGroup(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource sourceVault = default; + IList vaultCertificates = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceVault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceVault = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("vaultCertificates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVaultCertificate.DeserializeComputeFleetVaultCertificate(item, options)); + } + vaultCertificates = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVaultSecretGroup(sourceVault, vaultCertificates ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVaultSecretGroup)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVaultSecretGroup IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVaultSecretGroup(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVaultSecretGroup)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.cs new file mode 100644 index 000000000000..888991b6f1ed --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVaultSecretGroup.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a set of certificates which are all in the same Key Vault. + public partial class ComputeFleetVaultSecretGroup + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVaultSecretGroup() + { + VaultCertificates = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The relative URL of the Key Vault containing all of the certificates in + /// VaultCertificates. + /// + /// The list of key vault references in SourceVault which contain certificates. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVaultSecretGroup(WritableSubResource sourceVault, IList vaultCertificates, IDictionary serializedAdditionalRawData) + { + SourceVault = sourceVault; + VaultCertificates = vaultCertificates; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The relative URL of the Key Vault containing all of the certificates in + /// VaultCertificates. + /// + internal WritableSubResource SourceVault { get; set; } + /// Gets or sets Id. + public ResourceIdentifier SourceVaultId + { + get => SourceVault is null ? default : SourceVault.Id; + set + { + if (SourceVault is null) + SourceVault = new WritableSubResource(); + SourceVault.Id = value; + } + } + + /// The list of key vault references in SourceVault which contain certificates. + public IList VaultCertificates { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs new file mode 100644 index 000000000000..268137c084a8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetVirtualHardDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVirtualHardDisk)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVirtualHardDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVirtualHardDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVirtualHardDisk(document.RootElement, options); + } + + internal static ComputeFleetVirtualHardDisk DeserializeComputeFleetVirtualHardDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri uri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("uri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVirtualHardDisk(uri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVirtualHardDisk)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVirtualHardDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVirtualHardDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVirtualHardDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDeleteOption.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDeleteOption.cs new file mode 100644 index 000000000000..b0e841c66875 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDeleteOption.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specify what happens to the network interface when the VM is deleted. + public readonly partial struct ComputeFleetVmDeleteOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetVmDeleteOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeleteValue = "Delete"; + private const string DetachValue = "Detach"; + + /// Delete Option. + public static ComputeFleetVmDeleteOption Delete { get; } = new ComputeFleetVmDeleteOption(DeleteValue); + /// Detach Option. + public static ComputeFleetVmDeleteOption Detach { get; } = new ComputeFleetVmDeleteOption(DetachValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetVmDeleteOption left, ComputeFleetVmDeleteOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetVmDeleteOption left, ComputeFleetVmDeleteOption right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetVmDeleteOption(string value) => new ComputeFleetVmDeleteOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetVmDeleteOption other && Equals(other); + /// + public bool Equals(ComputeFleetVmDeleteOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs new file mode 100644 index 000000000000..ce40c4d781f3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmDiskSecurityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmDiskSecurityProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(SecurityEncryptionType)) + { + writer.WritePropertyName("securityEncryptionType"u8); + writer.WriteStringValue(SecurityEncryptionType.Value.ToString()); + } + if (Optional.IsDefined(DiskEncryptionSet)) + { + writer.WritePropertyName("diskEncryptionSet"u8); + JsonSerializer.Serialize(writer, DiskEncryptionSet); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmDiskSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmDiskSecurityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmDiskSecurityProfile(document.RootElement, options); + } + + internal static ComputeFleetVmDiskSecurityProfile DeserializeComputeFleetVmDiskSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetSecurityEncryptionType? securityEncryptionType = default; + WritableSubResource diskEncryptionSet = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("securityEncryptionType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityEncryptionType = new ComputeFleetSecurityEncryptionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("diskEncryptionSet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskEncryptionSet = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmDiskSecurityProfile(securityEncryptionType, diskEncryptionSet, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmDiskSecurityProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmDiskSecurityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmDiskSecurityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmDiskSecurityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.cs new file mode 100644 index 000000000000..c011da5fdaf0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmDiskSecurityProfile.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the security profile settings for the managed disk. **Note:** It can + /// only be set for Confidential VMs. + /// + public partial class ComputeFleetVmDiskSecurityProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmDiskSecurityProfile() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the EncryptionType of the managed disk. It is set to + /// DiskWithVMGuestState for encryption of the managed disk along with VMGuestState + /// blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and + /// NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. + /// **Note:** It can be set for only Confidential VMs. + /// + /// + /// Specifies the customer managed disk encryption set resource id for the managed + /// disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and + /// VMGuest blob. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmDiskSecurityProfile(ComputeFleetSecurityEncryptionType? securityEncryptionType, WritableSubResource diskEncryptionSet, IDictionary serializedAdditionalRawData) + { + SecurityEncryptionType = securityEncryptionType; + DiskEncryptionSet = diskEncryptionSet; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the EncryptionType of the managed disk. It is set to + /// DiskWithVMGuestState for encryption of the managed disk along with VMGuestState + /// blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and + /// NonPersistedTPM for not persisting firmware state in the VMGuestState blob.. + /// **Note:** It can be set for only Confidential VMs. + /// + public ComputeFleetSecurityEncryptionType? SecurityEncryptionType { get; set; } + /// + /// Specifies the customer managed disk encryption set resource id for the managed + /// disk that is used for Customer Managed Key encrypted ConfidentialVM OS Disk and + /// VMGuest blob. + /// + internal WritableSubResource DiskEncryptionSet { get; set; } + /// Gets or sets Id. + public ResourceIdentifier DiskEncryptionSetId + { + get => DiskEncryptionSet is null ? default : DiskEncryptionSet.Id; + set + { + if (DiskEncryptionSet is null) + DiskEncryptionSet = new WritableSubResource(); + DiskEncryptionSet.Id = value; + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs new file mode 100644 index 000000000000..f040c5a8b34e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmGalleryApplication : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmGalleryApplication)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStringValue(Tags); + } + if (Optional.IsDefined(Order)) + { + writer.WritePropertyName("order"u8); + writer.WriteNumberValue(Order.Value); + } + writer.WritePropertyName("packageReferenceId"u8); + writer.WriteStringValue(PackageReferenceId); + if (Optional.IsDefined(ConfigurationReference)) + { + writer.WritePropertyName("configurationReference"u8); + writer.WriteStringValue(ConfigurationReference); + } + if (Optional.IsDefined(IsTreatFailureAsDeploymentFailureEnabled)) + { + writer.WritePropertyName("treatFailureAsDeploymentFailure"u8); + writer.WriteBooleanValue(IsTreatFailureAsDeploymentFailureEnabled.Value); + } + if (Optional.IsDefined(IsAutomaticUpgradeEnabled)) + { + writer.WritePropertyName("enableAutomaticUpgrade"u8); + writer.WriteBooleanValue(IsAutomaticUpgradeEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmGalleryApplication IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmGalleryApplication)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmGalleryApplication(document.RootElement, options); + } + + internal static ComputeFleetVmGalleryApplication DeserializeComputeFleetVmGalleryApplication(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string tags = default; + int? order = default; + ResourceIdentifier packageReferenceId = default; + string configurationReference = default; + bool? treatFailureAsDeploymentFailure = default; + bool? enableAutomaticUpgrade = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + tags = property.Value.GetString(); + continue; + } + if (property.NameEquals("order"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + order = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("packageReferenceId"u8)) + { + packageReferenceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("configurationReference"u8)) + { + configurationReference = property.Value.GetString(); + continue; + } + if (property.NameEquals("treatFailureAsDeploymentFailure"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + treatFailureAsDeploymentFailure = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableAutomaticUpgrade"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutomaticUpgrade = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmGalleryApplication( + tags, + order, + packageReferenceId, + configurationReference, + treatFailureAsDeploymentFailure, + enableAutomaticUpgrade, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmGalleryApplication)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmGalleryApplication IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmGalleryApplication(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmGalleryApplication)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.cs new file mode 100644 index 000000000000..2b449b09a3a1 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGalleryApplication.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the required information to reference a compute gallery application + /// version + /// + public partial class ComputeFleetVmGalleryApplication + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Specifies the GalleryApplicationVersion resource id on the form of + /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} + /// + /// is null. + public ComputeFleetVmGalleryApplication(ResourceIdentifier packageReferenceId) + { + Argument.AssertNotNull(packageReferenceId, nameof(packageReferenceId)); + + PackageReferenceId = packageReferenceId; + } + + /// Initializes a new instance of . + /// Optional, Specifies a passthrough value for more generic context. + /// Optional, Specifies the order in which the packages have to be installed. + /// + /// Specifies the GalleryApplicationVersion resource id on the form of + /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} + /// + /// + /// Optional, Specifies the uri to an azure blob that will replace the default + /// configuration for the package if provided + /// + /// + /// Optional, If true, any failure for any operation in the VmApplication will fail + /// the deployment + /// + /// + /// If set to true, when a new Gallery Application version is available in PIR/SIG, + /// it will be automatically updated for the VM/VMSS + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmGalleryApplication(string tags, int? order, ResourceIdentifier packageReferenceId, string configurationReference, bool? isTreatFailureAsDeploymentFailureEnabled, bool? isAutomaticUpgradeEnabled, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Order = order; + PackageReferenceId = packageReferenceId; + ConfigurationReference = configurationReference; + IsTreatFailureAsDeploymentFailureEnabled = isTreatFailureAsDeploymentFailureEnabled; + IsAutomaticUpgradeEnabled = isAutomaticUpgradeEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmGalleryApplication() + { + } + + /// Optional, Specifies a passthrough value for more generic context. + public string Tags { get; set; } + /// Optional, Specifies the order in which the packages have to be installed. + public int? Order { get; set; } + /// + /// Specifies the GalleryApplicationVersion resource id on the form of + /// /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{application}/versions/{version} + /// + public ResourceIdentifier PackageReferenceId { get; set; } + /// + /// Optional, Specifies the uri to an azure blob that will replace the default + /// configuration for the package if provided + /// + public string ConfigurationReference { get; set; } + /// + /// Optional, If true, any failure for any operation in the VmApplication will fail + /// the deployment + /// + public bool? IsTreatFailureAsDeploymentFailureEnabled { get; set; } + /// + /// If set to true, when a new Gallery Application version is available in PIR/SIG, + /// it will be automatically updated for the VM/VMSS + /// + public bool? IsAutomaticUpgradeEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs new file mode 100644 index 000000000000..66632f12580c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmGuestPatchSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmGuestPatchSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PatchMode)) + { + writer.WritePropertyName("patchMode"u8); + writer.WriteStringValue(PatchMode.Value.ToString()); + } + if (Optional.IsDefined(IsHotPatchingEnabled)) + { + writer.WritePropertyName("enableHotpatching"u8); + writer.WriteBooleanValue(IsHotPatchingEnabled.Value); + } + if (Optional.IsDefined(AssessmentMode)) + { + writer.WritePropertyName("assessmentMode"u8); + writer.WriteStringValue(AssessmentMode.Value.ToString()); + } + if (Optional.IsDefined(AutomaticByPlatformSettings)) + { + writer.WritePropertyName("automaticByPlatformSettings"u8); + writer.WriteObjectValue(AutomaticByPlatformSettings, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmGuestPatchSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmGuestPatchSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmGuestPatchSettings(document.RootElement, options); + } + + internal static ComputeFleetVmGuestPatchSettings DeserializeComputeFleetVmGuestPatchSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetWindowsVmGuestPatchMode? patchMode = default; + bool? enableHotpatching = default; + ComputeFleetWindowsPatchAssessmentMode? assessmentMode = default; + ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patchMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchMode = new ComputeFleetWindowsVmGuestPatchMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("enableHotpatching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableHotpatching = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("assessmentMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessmentMode = new ComputeFleetWindowsPatchAssessmentMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("automaticByPlatformSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + automaticByPlatformSettings = ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.DeserializeComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmGuestPatchSettings(patchMode, enableHotpatching, assessmentMode, automaticByPlatformSettings, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmGuestPatchSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmGuestPatchSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmGuestPatchSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmGuestPatchSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.cs new file mode 100644 index 000000000000..1f8da7ab1d0f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmGuestPatchSettings.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies settings related to VM Guest Patching on Windows. + public partial class ComputeFleetVmGuestPatchSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmGuestPatchSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible.<br /><br /> Possible values are:<br /><br /> **Manual** - You + /// control the application of patches to a virtual machine. You do this by + /// applying patches manually inside the VM. In this mode, automatic updates are + /// disabled; the property WindowsConfiguration.enableAutomaticUpdates must be + /// false<br /><br /> **AutomaticByOS** - The virtual machine will automatically be + /// updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates + /// must be true. <br /><br /> **AutomaticByPlatform** - the virtual machine will + /// automatically updated by the platform. The properties provisionVMAgent and + /// WindowsConfiguration.enableAutomaticUpdates must be true + /// + /// + /// Enables customers to patch their Azure VMs without requiring a reboot. For + /// enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' + /// must be set to 'AutomaticByPlatform'. + /// + /// + /// Specifies the mode of VM Guest patch assessment for the IaaS virtual + /// machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You + /// control the timing of patch assessments on a virtual machine.<br /><br /> + /// **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + /// The property provisionVMAgent must be true. + /// + /// + /// Specifies additional settings for patch mode AutomaticByPlatform in VM Guest + /// Patching on Windows. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmGuestPatchSettings(ComputeFleetWindowsVmGuestPatchMode? patchMode, bool? isHotPatchingEnabled, ComputeFleetWindowsPatchAssessmentMode? assessmentMode, ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings automaticByPlatformSettings, IDictionary serializedAdditionalRawData) + { + PatchMode = patchMode; + IsHotPatchingEnabled = isHotPatchingEnabled; + AssessmentMode = assessmentMode; + AutomaticByPlatformSettings = automaticByPlatformSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible.<br /><br /> Possible values are:<br /><br /> **Manual** - You + /// control the application of patches to a virtual machine. You do this by + /// applying patches manually inside the VM. In this mode, automatic updates are + /// disabled; the property WindowsConfiguration.enableAutomaticUpdates must be + /// false<br /><br /> **AutomaticByOS** - The virtual machine will automatically be + /// updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates + /// must be true. <br /><br /> **AutomaticByPlatform** - the virtual machine will + /// automatically updated by the platform. The properties provisionVMAgent and + /// WindowsConfiguration.enableAutomaticUpdates must be true + /// + public ComputeFleetWindowsVmGuestPatchMode? PatchMode { get; set; } + /// + /// Enables customers to patch their Azure VMs without requiring a reboot. For + /// enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' + /// must be set to 'AutomaticByPlatform'. + /// + public bool? IsHotPatchingEnabled { get; set; } + /// + /// Specifies the mode of VM Guest patch assessment for the IaaS virtual + /// machine.<br /><br /> Possible values are:<br /><br /> **ImageDefault** - You + /// control the timing of patch assessments on a virtual machine.<br /><br /> + /// **AutomaticByPlatform** - The platform will trigger periodic patch assessments. + /// The property provisionVMAgent must be true. + /// + public ComputeFleetWindowsPatchAssessmentMode? AssessmentMode { get; set; } + /// + /// Specifies additional settings for patch mode AutomaticByPlatform in VM Guest + /// Patching on Windows. + /// + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings AutomaticByPlatformSettings { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs new file mode 100644 index 000000000000..71dbc4f83748 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.Serialization.cs @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(OSProfile)) + { + writer.WritePropertyName("osProfile"u8); + writer.WriteObjectValue(OSProfile, options); + } + if (Optional.IsDefined(StorageProfile)) + { + writer.WritePropertyName("storageProfile"u8); + writer.WriteObjectValue(StorageProfile, options); + } + if (Optional.IsDefined(NetworkProfile)) + { + writer.WritePropertyName("networkProfile"u8); + writer.WriteObjectValue(NetworkProfile, options); + } + if (Optional.IsDefined(SecurityProfile)) + { + writer.WritePropertyName("securityProfile"u8); + writer.WriteObjectValue(SecurityProfile, options); + } + if (Optional.IsDefined(DiagnosticsProfile)) + { + writer.WritePropertyName("diagnosticsProfile"u8); + writer.WriteObjectValue(DiagnosticsProfile, options); + } + if (Optional.IsDefined(ExtensionProfile)) + { + writer.WritePropertyName("extensionProfile"u8); + writer.WriteObjectValue(ExtensionProfile, options); + } + if (Optional.IsDefined(LicenseType)) + { + writer.WritePropertyName("licenseType"u8); + writer.WriteStringValue(LicenseType); + } + if (Optional.IsDefined(ScheduledEventsProfile)) + { + writer.WritePropertyName("scheduledEventsProfile"u8); + writer.WriteObjectValue(ScheduledEventsProfile, options); + } + if (Optional.IsDefined(UserData)) + { + writer.WritePropertyName("userData"u8); + writer.WriteStringValue(UserData); + } + if (Optional.IsDefined(CapacityReservation)) + { + writer.WritePropertyName("capacityReservation"u8); + writer.WriteObjectValue(CapacityReservation, options); + } + if (Optional.IsDefined(ApplicationProfile)) + { + writer.WritePropertyName("applicationProfile"u8); + writer.WriteObjectValue(ApplicationProfile, options); + } + if (Optional.IsDefined(HardwareProfile)) + { + writer.WritePropertyName("hardwareProfile"u8); + writer.WriteObjectValue(HardwareProfile, options); + } + if (Optional.IsDefined(ServiceArtifactReference)) + { + writer.WritePropertyName("serviceArtifactReference"u8); + JsonSerializer.Serialize(writer, ServiceArtifactReference); + } + if (Optional.IsDefined(SecurityPostureReference)) + { + writer.WritePropertyName("securityPostureReference"u8); + writer.WriteObjectValue(SecurityPostureReference, options); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("timeCreated"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmProfile(document.RootElement, options); + } + + internal static ComputeFleetVmProfile DeserializeComputeFleetVmProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetVmssOSProfile osProfile = default; + ComputeFleetVmssStorageProfile storageProfile = default; + ComputeFleetVmssNetworkProfile networkProfile = default; + ComputeFleetSecurityProfile securityProfile = default; + ComputeFleetDiagnosticsProfile diagnosticsProfile = default; + ComputeFleetVmssExtensionProfile extensionProfile = default; + string licenseType = default; + ComputeFleetScheduledEventsProfile scheduledEventsProfile = default; + string userData = default; + CapacityReservationProfile capacityReservation = default; + ComputeFleetApplicationProfile applicationProfile = default; + ComputeFleetVmssHardwareProfile hardwareProfile = default; + WritableSubResource serviceArtifactReference = default; + ComputeFleetSecurityPostureReference securityPostureReference = default; + DateTimeOffset? timeCreated = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("osProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osProfile = ComputeFleetVmssOSProfile.DeserializeComputeFleetVmssOSProfile(property.Value, options); + continue; + } + if (property.NameEquals("storageProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageProfile = ComputeFleetVmssStorageProfile.DeserializeComputeFleetVmssStorageProfile(property.Value, options); + continue; + } + if (property.NameEquals("networkProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkProfile = ComputeFleetVmssNetworkProfile.DeserializeComputeFleetVmssNetworkProfile(property.Value, options); + continue; + } + if (property.NameEquals("securityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = ComputeFleetSecurityProfile.DeserializeComputeFleetSecurityProfile(property.Value, options); + continue; + } + if (property.NameEquals("diagnosticsProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diagnosticsProfile = ComputeFleetDiagnosticsProfile.DeserializeComputeFleetDiagnosticsProfile(property.Value, options); + continue; + } + if (property.NameEquals("extensionProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extensionProfile = ComputeFleetVmssExtensionProfile.DeserializeComputeFleetVmssExtensionProfile(property.Value, options); + continue; + } + if (property.NameEquals("licenseType"u8)) + { + licenseType = property.Value.GetString(); + continue; + } + if (property.NameEquals("scheduledEventsProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledEventsProfile = ComputeFleetScheduledEventsProfile.DeserializeComputeFleetScheduledEventsProfile(property.Value, options); + continue; + } + if (property.NameEquals("userData"u8)) + { + userData = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacityReservation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityReservation = CapacityReservationProfile.DeserializeCapacityReservationProfile(property.Value, options); + continue; + } + if (property.NameEquals("applicationProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applicationProfile = ComputeFleetApplicationProfile.DeserializeComputeFleetApplicationProfile(property.Value, options); + continue; + } + if (property.NameEquals("hardwareProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hardwareProfile = ComputeFleetVmssHardwareProfile.DeserializeComputeFleetVmssHardwareProfile(property.Value, options); + continue; + } + if (property.NameEquals("serviceArtifactReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceArtifactReference = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("securityPostureReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityPostureReference = ComputeFleetSecurityPostureReference.DeserializeComputeFleetSecurityPostureReference(property.Value, options); + continue; + } + if (property.NameEquals("timeCreated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeCreated = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmProfile( + osProfile, + storageProfile, + networkProfile, + securityProfile, + diagnosticsProfile, + extensionProfile, + licenseType, + scheduledEventsProfile, + userData, + capacityReservation, + applicationProfile, + hardwareProfile, + serviceArtifactReference, + securityPostureReference, + timeCreated, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.cs new file mode 100644 index 000000000000..af10579b88ab --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmProfile.cs @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes the base virtual machine profile for fleet. + public partial class ComputeFleetVmProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmProfile() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the operating system settings for the virtual machines in the scale + /// set. + /// + /// Specifies the storage settings for the virtual machine disks. + /// + /// Specifies properties of the network interfaces of the virtual machines in the + /// scale set. + /// + /// + /// Specifies the Security related profile settings for the virtual machines in the + /// scale set. + /// + /// Specifies the boot diagnostic settings state. + /// + /// Specifies a collection of settings for extensions installed on virtual machines + /// in the scale set. + /// + /// + /// Specifies that the image or disk that is being used was licensed on-premises. + /// <br><br> Possible values for Windows Server operating system are: <br><br> + /// Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS + /// (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for + /// Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// + /// Specifies Scheduled Event related configurations. + /// + /// UserData for the virtual machines in the scale set, which must be base-64 + /// encoded. Customer should not pass any secrets in here. Minimum api-version: + /// 2021-03-01. + /// + /// + /// Specifies the capacity reservation related details of a scale set. Minimum + /// api-version: 2021-04-01. + /// + /// Specifies the gallery applications that should be made available to the VM/VMSS. + /// + /// Specifies the hardware profile related details of a scale set. Minimum + /// api-version: 2021-11-01. + /// + /// + /// Specifies the service artifact reference id used to set same image version for + /// all virtual machines in the scale set when using 'latest' image version. + /// Minimum api-version: 2022-11-01 + /// + /// + /// Specifies the security posture to be used for all virtual machines in the scale + /// set. Minimum api-version: 2023-03-01 + /// + /// + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set + /// was created. Minimum API version for this property is 2023-09-01. This value + /// will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile + /// with minimum api-version 2023-09-01. Examples: "2024-07-01T00:00:01.1234567+00:00" + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmProfile(ComputeFleetVmssOSProfile osProfile, ComputeFleetVmssStorageProfile storageProfile, ComputeFleetVmssNetworkProfile networkProfile, ComputeFleetSecurityProfile securityProfile, ComputeFleetDiagnosticsProfile diagnosticsProfile, ComputeFleetVmssExtensionProfile extensionProfile, string licenseType, ComputeFleetScheduledEventsProfile scheduledEventsProfile, string userData, CapacityReservationProfile capacityReservation, ComputeFleetApplicationProfile applicationProfile, ComputeFleetVmssHardwareProfile hardwareProfile, WritableSubResource serviceArtifactReference, ComputeFleetSecurityPostureReference securityPostureReference, DateTimeOffset? createdOn, IDictionary serializedAdditionalRawData) + { + OSProfile = osProfile; + StorageProfile = storageProfile; + NetworkProfile = networkProfile; + SecurityProfile = securityProfile; + DiagnosticsProfile = diagnosticsProfile; + ExtensionProfile = extensionProfile; + LicenseType = licenseType; + ScheduledEventsProfile = scheduledEventsProfile; + UserData = userData; + CapacityReservation = capacityReservation; + ApplicationProfile = applicationProfile; + HardwareProfile = hardwareProfile; + ServiceArtifactReference = serviceArtifactReference; + SecurityPostureReference = securityPostureReference; + CreatedOn = createdOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the operating system settings for the virtual machines in the scale + /// set. + /// + public ComputeFleetVmssOSProfile OSProfile { get; set; } + /// Specifies the storage settings for the virtual machine disks. + public ComputeFleetVmssStorageProfile StorageProfile { get; set; } + /// + /// Specifies properties of the network interfaces of the virtual machines in the + /// scale set. + /// + public ComputeFleetVmssNetworkProfile NetworkProfile { get; set; } + /// + /// Specifies the Security related profile settings for the virtual machines in the + /// scale set. + /// + public ComputeFleetSecurityProfile SecurityProfile { get; set; } + /// Specifies the boot diagnostic settings state. + internal ComputeFleetDiagnosticsProfile DiagnosticsProfile { get; set; } + /// + /// Boot Diagnostics is a debugging feature which allows you to view Console Output + /// and Screenshot to diagnose VM status. **NOTE**: If storageUri is being + /// specified then ensure that the storage account is in the same region and + /// subscription as the VM. You can easily view the output of your console log. + /// Azure also enables you to see a screenshot of the VM from the hypervisor. + /// + public ComputeFleetBootDiagnostics BootDiagnostics + { + get => DiagnosticsProfile is null ? default : DiagnosticsProfile.BootDiagnostics; + set + { + if (DiagnosticsProfile is null) + DiagnosticsProfile = new ComputeFleetDiagnosticsProfile(); + DiagnosticsProfile.BootDiagnostics = value; + } + } + + /// + /// Specifies a collection of settings for extensions installed on virtual machines + /// in the scale set. + /// + public ComputeFleetVmssExtensionProfile ExtensionProfile { get; set; } + /// + /// Specifies that the image or disk that is being used was licensed on-premises. + /// <br><br> Possible values for Windows Server operating system are: <br><br> + /// Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux + /// Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS + /// (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for + /// Windows + /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) + /// <br><br> [Azure Hybrid Use Benefit for Linux + /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) + /// <br><br> Minimum api-version: 2015-06-15 + /// + public string LicenseType { get; set; } + /// Specifies Scheduled Event related configurations. + public ComputeFleetScheduledEventsProfile ScheduledEventsProfile { get; set; } + /// + /// UserData for the virtual machines in the scale set, which must be base-64 + /// encoded. Customer should not pass any secrets in here. Minimum api-version: + /// 2021-03-01. + /// + public string UserData { get; set; } + /// + /// Specifies the capacity reservation related details of a scale set. Minimum + /// api-version: 2021-04-01. + /// + internal CapacityReservationProfile CapacityReservation { get; set; } + /// Gets or sets Id. + public ResourceIdentifier CapacityReservationGroupId + { + get => CapacityReservation is null ? default : CapacityReservation.CapacityReservationGroupId; + set + { + if (CapacityReservation is null) + CapacityReservation = new CapacityReservationProfile(); + CapacityReservation.CapacityReservationGroupId = value; + } + } + + /// Specifies the gallery applications that should be made available to the VM/VMSS. + internal ComputeFleetApplicationProfile ApplicationProfile { get; set; } + /// Specifies the gallery applications that should be made available to the VM/VMSS. + public IList GalleryApplications + { + get + { + if (ApplicationProfile is null) + ApplicationProfile = new ComputeFleetApplicationProfile(); + return ApplicationProfile.GalleryApplications; + } + } + + /// + /// Specifies the hardware profile related details of a scale set. Minimum + /// api-version: 2021-11-01. + /// + internal ComputeFleetVmssHardwareProfile HardwareProfile { get; set; } + /// + /// Specifies the properties for customizing the size of the virtual machine. + /// Minimum api-version: 2021-11-01. Please follow the instructions in [VM + /// Customization](https://aka.ms/vmcustomization) for more details. + /// + public ComputeFleetVmSizeProperties HardwareVmSizeProperties + { + get => HardwareProfile is null ? default : HardwareProfile.VmSizeProperties; + set + { + if (HardwareProfile is null) + HardwareProfile = new ComputeFleetVmssHardwareProfile(); + HardwareProfile.VmSizeProperties = value; + } + } + + /// + /// Specifies the service artifact reference id used to set same image version for + /// all virtual machines in the scale set when using 'latest' image version. + /// Minimum api-version: 2022-11-01 + /// + internal WritableSubResource ServiceArtifactReference { get; set; } + /// Gets or sets Id. + public ResourceIdentifier ServiceArtifactReferenceId + { + get => ServiceArtifactReference is null ? default : ServiceArtifactReference.Id; + set + { + if (ServiceArtifactReference is null) + ServiceArtifactReference = new WritableSubResource(); + ServiceArtifactReference.Id = value; + } + } + + /// + /// Specifies the security posture to be used for all virtual machines in the scale + /// set. Minimum api-version: 2023-03-01 + /// + public ComputeFleetSecurityPostureReference SecurityPostureReference { get; set; } + /// + /// Specifies the time in which this VM profile for the Virtual Machine Scale Set + /// was created. Minimum API version for this property is 2023-09-01. This value + /// will be added to VMSS Flex VM tags when creating/updating the VMSS VM Profile + /// with minimum api-version 2023-09-01. Examples: "2024-07-01T00:00:01.1234567+00:00" + /// + public DateTimeOffset? CreatedOn { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.cs new file mode 100644 index 000000000000..64068a8203a1 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifications about a VM Size. This will also contain the corresponding rank and weight in future. + public partial class ComputeFleetVmSizeProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Sku name (e.g. 'Standard_DS1_v2'). + /// is null. + public ComputeFleetVmSizeProfile(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The Sku name (e.g. 'Standard_DS1_v2'). + /// + /// The rank of the VM size. This is used with 'RegularPriorityAllocationStrategy.Prioritized' + /// The lower the number, the higher the priority. Starting with 0. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmSizeProfile(string name, int? rank, IDictionary serializedAdditionalRawData) + { + Name = name; + Rank = rank; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmSizeProfile() + { + } + + /// The Sku name (e.g. 'Standard_DS1_v2'). + public string Name { get; set; } + /// + /// The rank of the VM size. This is used with 'RegularPriorityAllocationStrategy.Prioritized' + /// The lower the number, the higher the priority. Starting with 0. + /// + public int? Rank { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs new file mode 100644 index 000000000000..643ede08cf19 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmSizeProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(VCPUsAvailable)) + { + writer.WritePropertyName("vCPUsAvailable"u8); + writer.WriteNumberValue(VCPUsAvailable.Value); + } + if (Optional.IsDefined(VCPUsPerCore)) + { + writer.WritePropertyName("vCPUsPerCore"u8); + writer.WriteNumberValue(VCPUsPerCore.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmSizeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmSizeProperties(document.RootElement, options); + } + + internal static ComputeFleetVmSizeProperties DeserializeComputeFleetVmSizeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? vcpUsAvailable = default; + int? vcpUsPerCore = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vCPUsAvailable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vcpUsAvailable = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("vCPUsPerCore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vcpUsPerCore = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmSizeProperties(vcpUsAvailable, vcpUsPerCore, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmSizeProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmSizeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.cs new file mode 100644 index 000000000000..cfa5b1c6b371 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProperties.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies VM Size Property settings on the virtual machine. + public partial class ComputeFleetVmSizeProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmSizeProperties() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the number of vCPUs available for the VM. When this property is not + /// specified in the request body the default behavior is to set it to the value of + /// vCPUs available for that VM size exposed in api response of [List all available + /// virtual machine sizes in a + /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + /// + /// + /// Specifies the vCPU to physical core ratio. When this property is not specified + /// in the request body the default behavior is set to the value of vCPUsPerCore + /// for the VM Size exposed in api response of [List all available virtual machine + /// sizes in a + /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + /// **Setting this property to 1 also means that hyper-threading is disabled.** + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmSizeProperties(int? vcpUsAvailable, int? vcpUsPerCore, IDictionary serializedAdditionalRawData) + { + VCPUsAvailable = vcpUsAvailable; + VCPUsPerCore = vcpUsPerCore; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the number of vCPUs available for the VM. When this property is not + /// specified in the request body the default behavior is to set it to the value of + /// vCPUs available for that VM size exposed in api response of [List all available + /// virtual machine sizes in a + /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + /// + public int? VCPUsAvailable { get; set; } + /// + /// Specifies the vCPU to physical core ratio. When this property is not specified + /// in the request body the default behavior is set to the value of vCPUsPerCore + /// for the VM Size exposed in api response of [List all available virtual machine + /// sizes in a + /// region](https://docs.microsoft.com/en-us/rest/api/compute/resource-skus/list). + /// **Setting this property to 1 also means that hyper-threading is disabled.** + /// + public int? VCPUsPerCore { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs new file mode 100644 index 000000000000..37a95a7c2479 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// An AzureFleet's virtualMachineScaleSet. + public partial class ComputeFleetVmss + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The compute RP resource id of the virtualMachineScaleSet + /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" + /// + /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. + internal ComputeFleetVmss(string id, ComputeFleetProvisioningState operationStatus) + { + Id = id; + OperationStatus = operationStatus; + } + + /// Initializes a new instance of . + /// + /// The compute RP resource id of the virtualMachineScaleSet + /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" + /// + /// Type of the virtualMachineScaleSet. + /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. + /// Error Information when `operationStatus` is `Failed`. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmss(string id, string type, ComputeFleetProvisioningState operationStatus, ComputeFleetApiError error, IDictionary serializedAdditionalRawData) + { + Id = id; + Type = type; + OperationStatus = operationStatus; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmss() + { + } + + /// + /// The compute RP resource id of the virtualMachineScaleSet + /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" + /// + public string Id { get; } + /// Type of the virtualMachineScaleSet. + public string Type { get; } + /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. + public ComputeFleetProvisioningState OperationStatus { get; } + /// Error Information when `operationStatus` is `Failed`. + public ComputeFleetApiError Error { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs new file mode 100644 index 000000000000..56ce2107147e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.Serialization.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssDataDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssDataDisk)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WritePropertyName("lun"u8); + writer.WriteNumberValue(Lun); + if (Optional.IsDefined(Caching)) + { + writer.WritePropertyName("caching"u8); + writer.WriteStringValue(Caching.Value.ToString()); + } + if (Optional.IsDefined(IsWriteAcceleratorEnabled)) + { + writer.WritePropertyName("writeAcceleratorEnabled"u8); + writer.WriteBooleanValue(IsWriteAcceleratorEnabled.Value); + } + writer.WritePropertyName("createOption"u8); + writer.WriteStringValue(CreateOption.ToString()); + if (Optional.IsDefined(DiskSizeGB)) + { + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB.Value); + } + if (Optional.IsDefined(ManagedDisk)) + { + writer.WritePropertyName("managedDisk"u8); + writer.WriteObjectValue(ManagedDisk, options); + } + if (Optional.IsDefined(DiskIopsReadWrite)) + { + writer.WritePropertyName("diskIOPSReadWrite"u8); + writer.WriteNumberValue(DiskIopsReadWrite.Value); + } + if (Optional.IsDefined(DiskMbpsReadWrite)) + { + writer.WritePropertyName("diskMBpsReadWrite"u8); + writer.WriteNumberValue(DiskMbpsReadWrite.Value); + } + if (Optional.IsDefined(DeleteOption)) + { + writer.WritePropertyName("deleteOption"u8); + writer.WriteStringValue(DeleteOption.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssDataDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssDataDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssDataDisk(document.RootElement, options); + } + + internal static ComputeFleetVmssDataDisk DeserializeComputeFleetVmssDataDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + int lun = default; + ComputeFleetCachingType? caching = default; + bool? writeAcceleratorEnabled = default; + ComputeFleetDiskCreateOptionType createOption = default; + int? diskSizeGB = default; + ComputeFleetVmssManagedDisk managedDisk = default; + long? diskIOPSReadWrite = default; + long? diskMBpsReadWrite = default; + ComputeFleetDiskDeleteOptionType? deleteOption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("lun"u8)) + { + lun = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("caching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + caching = new ComputeFleetCachingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("writeAcceleratorEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + writeAcceleratorEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("createOption"u8)) + { + createOption = new ComputeFleetDiskCreateOptionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeGB = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("managedDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedDisk = ComputeFleetVmssManagedDisk.DeserializeComputeFleetVmssManagedDisk(property.Value, options); + continue; + } + if (property.NameEquals("diskIOPSReadWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskIOPSReadWrite = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskMBpsReadWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskMBpsReadWrite = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("deleteOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOption = new ComputeFleetDiskDeleteOptionType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssDataDisk( + name, + lun, + caching, + writeAcceleratorEnabled, + createOption, + diskSizeGB, + managedDisk, + diskIOPSReadWrite, + diskMBpsReadWrite, + deleteOption, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssDataDisk)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssDataDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssDataDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssDataDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.cs new file mode 100644 index 000000000000..fab909717cda --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssDataDisk.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set data disk. + public partial class ComputeFleetVmssDataDisk + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Specifies the logical unit number of the data disk. This value is used to + /// identify data disks within the VM and therefore must be unique for each data + /// disk attached to a VM. + /// + /// The create option. + public ComputeFleetVmssDataDisk(int lun, ComputeFleetDiskCreateOptionType createOption) + { + Lun = lun; + CreateOption = createOption; + } + + /// Initializes a new instance of . + /// The disk name. + /// + /// Specifies the logical unit number of the data disk. This value is used to + /// identify data disks within the VM and therefore must be unique for each data + /// disk attached to a VM. + /// + /// + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// + /// Specifies whether writeAccelerator should be enabled or disabled on the disk. + /// The create option. + /// + /// Specifies the size of an empty data disk in gigabytes. This element can be used + /// to overwrite the size of the disk in a virtual machine image. The property + /// diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be + /// larger than 1023. + /// + /// The managed disk parameters. + /// + /// Specifies the Read-Write IOPS for the managed disk. Should be used only when + /// StorageAccountType is UltraSSD_LRS. If not specified, a default value would be + /// assigned based on diskSizeGB. + /// + /// + /// Specifies the bandwidth in MB per second for the managed disk. Should be used + /// only when StorageAccountType is UltraSSD_LRS. If not specified, a default value + /// would be assigned based on diskSizeGB. + /// + /// + /// Specifies whether data disk should be deleted or detached upon VMSS Flex + /// deletion (This feature is available for VMSS with Flexible OrchestrationMode + /// only).<br><br> Possible values: <br><br> **Delete** If this value is used, the + /// data disk is deleted when the VMSS Flex VM is deleted.<br><br> **Detach** If + /// this value is used, the data disk is retained after VMSS Flex VM is + /// deleted.<br><br> The default value is set to **Delete**. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssDataDisk(string name, int lun, ComputeFleetCachingType? caching, bool? isWriteAcceleratorEnabled, ComputeFleetDiskCreateOptionType createOption, int? diskSizeGB, ComputeFleetVmssManagedDisk managedDisk, long? diskIopsReadWrite, long? diskMbpsReadWrite, ComputeFleetDiskDeleteOptionType? deleteOption, IDictionary serializedAdditionalRawData) + { + Name = name; + Lun = lun; + Caching = caching; + IsWriteAcceleratorEnabled = isWriteAcceleratorEnabled; + CreateOption = createOption; + DiskSizeGB = diskSizeGB; + ManagedDisk = managedDisk; + DiskIopsReadWrite = diskIopsReadWrite; + DiskMbpsReadWrite = diskMbpsReadWrite; + DeleteOption = deleteOption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssDataDisk() + { + } + + /// The disk name. + public string Name { get; set; } + /// + /// Specifies the logical unit number of the data disk. This value is used to + /// identify data disks within the VM and therefore must be unique for each data + /// disk attached to a VM. + /// + public int Lun { get; set; } + /// + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// + public ComputeFleetCachingType? Caching { get; set; } + /// Specifies whether writeAccelerator should be enabled or disabled on the disk. + public bool? IsWriteAcceleratorEnabled { get; set; } + /// The create option. + public ComputeFleetDiskCreateOptionType CreateOption { get; set; } + /// + /// Specifies the size of an empty data disk in gigabytes. This element can be used + /// to overwrite the size of the disk in a virtual machine image. The property + /// diskSizeGB is the number of bytes x 1024^3 for the disk and the value cannot be + /// larger than 1023. + /// + public int? DiskSizeGB { get; set; } + /// The managed disk parameters. + public ComputeFleetVmssManagedDisk ManagedDisk { get; set; } + /// + /// Specifies the Read-Write IOPS for the managed disk. Should be used only when + /// StorageAccountType is UltraSSD_LRS. If not specified, a default value would be + /// assigned based on diskSizeGB. + /// + public long? DiskIopsReadWrite { get; set; } + /// + /// Specifies the bandwidth in MB per second for the managed disk. Should be used + /// only when StorageAccountType is UltraSSD_LRS. If not specified, a default value + /// would be assigned based on diskSizeGB. + /// + public long? DiskMbpsReadWrite { get; set; } + /// + /// Specifies whether data disk should be deleted or detached upon VMSS Flex + /// deletion (This feature is available for VMSS with Flexible OrchestrationMode + /// only).<br><br> Possible values: <br><br> **Delete** If this value is used, the + /// data disk is deleted when the VMSS Flex VM is deleted.<br><br> **Detach** If + /// this value is used, the data disk is retained after VMSS Flex VM is + /// deleted.<br><br> The default value is set to **Delete**. + /// + public ComputeFleetDiskDeleteOptionType? DeleteOption { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs new file mode 100644 index 000000000000..362baba23210 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssExtension : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssExtension)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ExtensionType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ExtensionType); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssExtension IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssExtension)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssExtension(document.RootElement, options); + } + + internal static ComputeFleetVmssExtension DeserializeComputeFleetVmssExtension(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + string type = default; + ComputeFleetVmssExtensionProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetVmssExtensionProperties.DeserializeComputeFleetVmssExtensionProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssExtension(id, name, type, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtension)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssExtension IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssExtension(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtension)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.cs new file mode 100644 index 000000000000..7a3b11a39859 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtension.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a Virtual Machine Scale Set Extension. + public partial class ComputeFleetVmssExtension + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssExtension() + { + } + + /// Initializes a new instance of . + /// Resource Id. + /// The name of the extension. + /// Resource type. + /// Describes the properties of a Virtual Machine Scale Set Extension. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssExtension(ResourceIdentifier id, string name, string extensionType, ComputeFleetVmssExtensionProperties properties, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + ExtensionType = extensionType; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource Id. + public ResourceIdentifier Id { get; } + /// The name of the extension. + public string Name { get; set; } + /// Resource type. + public string ExtensionType { get; } + /// Describes the properties of a Virtual Machine Scale Set Extension. + public ComputeFleetVmssExtensionProperties Properties { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs new file mode 100644 index 000000000000..cb116c538522 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssExtensionProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Extensions)) + { + writer.WritePropertyName("extensions"u8); + writer.WriteStartArray(); + foreach (var item in Extensions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ExtensionsTimeBudget)) + { + writer.WritePropertyName("extensionsTimeBudget"u8); + writer.WriteStringValue(ExtensionsTimeBudget); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssExtensionProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssExtensionProfile(document.RootElement, options); + } + + internal static ComputeFleetVmssExtensionProfile DeserializeComputeFleetVmssExtensionProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList extensions = default; + string extensionsTimeBudget = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("extensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmssExtension.DeserializeComputeFleetVmssExtension(item, options)); + } + extensions = array; + continue; + } + if (property.NameEquals("extensionsTimeBudget"u8)) + { + extensionsTimeBudget = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssExtensionProfile(extensions ?? new ChangeTrackingList(), extensionsTimeBudget, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssExtensionProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssExtensionProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.cs new file mode 100644 index 000000000000..27d4e0d3e410 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProfile.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set extension profile. + public partial class ComputeFleetVmssExtensionProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssExtensionProfile() + { + Extensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The virtual machine scale set child extension resources. + /// + /// Specifies the time alloted for all extensions to start. The time duration + /// should be between 15 minutes and 120 minutes (inclusive) and should be + /// specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). + /// Minimum api-version: 2020-06-01. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssExtensionProfile(IList extensions, string extensionsTimeBudget, IDictionary serializedAdditionalRawData) + { + Extensions = extensions; + ExtensionsTimeBudget = extensionsTimeBudget; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The virtual machine scale set child extension resources. + public IList Extensions { get; } + /// + /// Specifies the time alloted for all extensions to start. The time duration + /// should be between 15 minutes and 120 minutes (inclusive) and should be + /// specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). + /// Minimum api-version: 2020-06-01. + /// + public string ExtensionsTimeBudget { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs new file mode 100644 index 000000000000..932366bdb235 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.Serialization.cs @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssExtensionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ForceUpdateTag)) + { + writer.WritePropertyName("forceUpdateTag"u8); + writer.WriteStringValue(ForceUpdateTag); + } + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(ExtensionType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ExtensionType); + } + if (Optional.IsDefined(TypeHandlerVersion)) + { + writer.WritePropertyName("typeHandlerVersion"u8); + writer.WriteStringValue(TypeHandlerVersion); + } + if (Optional.IsDefined(ShouldAutoUpgradeMinorVersion)) + { + writer.WritePropertyName("autoUpgradeMinorVersion"u8); + writer.WriteBooleanValue(ShouldAutoUpgradeMinorVersion.Value); + } + if (Optional.IsDefined(IsAutomaticUpgradeEnabled)) + { + writer.WritePropertyName("enableAutomaticUpgrade"u8); + writer.WriteBooleanValue(IsAutomaticUpgradeEnabled.Value); + } + if (Optional.IsCollectionDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(ProtectedSettings)) + { + writer.WritePropertyName("protectedSettings"u8); + writer.WriteStartObject(); + foreach (var item in ProtectedSettings) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState); + } + if (Optional.IsCollectionDefined(ProvisionAfterExtensions)) + { + writer.WritePropertyName("provisionAfterExtensions"u8); + writer.WriteStartArray(); + foreach (var item in ProvisionAfterExtensions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsSuppressFailuresEnabled)) + { + writer.WritePropertyName("suppressFailures"u8); + writer.WriteBooleanValue(IsSuppressFailuresEnabled.Value); + } + if (Optional.IsDefined(ProtectedSettingsFromKeyVault)) + { + writer.WritePropertyName("protectedSettingsFromKeyVault"u8); + writer.WriteObjectValue(ProtectedSettingsFromKeyVault, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssExtensionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssExtensionProperties(document.RootElement, options); + } + + internal static ComputeFleetVmssExtensionProperties DeserializeComputeFleetVmssExtensionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string forceUpdateTag = default; + string publisher = default; + string type = default; + string typeHandlerVersion = default; + bool? autoUpgradeMinorVersion = default; + bool? enableAutomaticUpgrade = default; + IDictionary settings = default; + IDictionary protectedSettings = default; + string provisioningState = default; + IList provisionAfterExtensions = default; + bool? suppressFailures = default; + ComputeFleetKeyVaultSecretReference protectedSettingsFromKeyVault = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("forceUpdateTag"u8)) + { + forceUpdateTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("typeHandlerVersion"u8)) + { + typeHandlerVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("autoUpgradeMinorVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpgradeMinorVersion = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableAutomaticUpgrade"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutomaticUpgrade = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + settings = dictionary; + continue; + } + if (property.NameEquals("protectedSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + protectedSettings = dictionary; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + provisioningState = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisionAfterExtensions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + provisionAfterExtensions = array; + continue; + } + if (property.NameEquals("suppressFailures"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + suppressFailures = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("protectedSettingsFromKeyVault"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protectedSettingsFromKeyVault = ComputeFleetKeyVaultSecretReference.DeserializeComputeFleetKeyVaultSecretReference(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssExtensionProperties( + forceUpdateTag, + publisher, + type, + typeHandlerVersion, + autoUpgradeMinorVersion, + enableAutomaticUpgrade, + settings ?? new ChangeTrackingDictionary(), + protectedSettings ?? new ChangeTrackingDictionary(), + provisioningState, + provisionAfterExtensions ?? new ChangeTrackingList(), + suppressFailures, + protectedSettingsFromKeyVault, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssExtensionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssExtensionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssExtensionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.cs new file mode 100644 index 000000000000..3c01f85a9b28 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssExtensionProperties.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes the properties of a Virtual Machine Scale Set Extension. + public partial class ComputeFleetVmssExtensionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssExtensionProperties() + { + Settings = new ChangeTrackingDictionary(); + ProtectedSettings = new ChangeTrackingDictionary(); + ProvisionAfterExtensions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// If a value is provided and is different from the previous value, the extension + /// handler will be forced to update even if the extension configuration has not + /// changed. + /// + /// The name of the extension handler publisher. + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the version of the script handler. + /// + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will not + /// upgrade minor versions unless redeployed, even with this property set to true. + /// + /// + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + /// Json formatted public settings for the extension. + /// + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + /// The provisioning state, which only appears in the response. + /// + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + /// + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be suppressed + /// regardless of this value). The default is false. + /// + /// + /// The extensions protected settings that are passed by reference, and consumed + /// from key vault + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssExtensionProperties(string forceUpdateTag, string publisher, string extensionType, string typeHandlerVersion, bool? shouldAutoUpgradeMinorVersion, bool? isAutomaticUpgradeEnabled, IDictionary settings, IDictionary protectedSettings, string provisioningState, IList provisionAfterExtensions, bool? isSuppressFailuresEnabled, ComputeFleetKeyVaultSecretReference protectedSettingsFromKeyVault, IDictionary serializedAdditionalRawData) + { + ForceUpdateTag = forceUpdateTag; + Publisher = publisher; + ExtensionType = extensionType; + TypeHandlerVersion = typeHandlerVersion; + ShouldAutoUpgradeMinorVersion = shouldAutoUpgradeMinorVersion; + IsAutomaticUpgradeEnabled = isAutomaticUpgradeEnabled; + Settings = settings; + ProtectedSettings = protectedSettings; + ProvisioningState = provisioningState; + ProvisionAfterExtensions = provisionAfterExtensions; + IsSuppressFailuresEnabled = isSuppressFailuresEnabled; + ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// If a value is provided and is different from the previous value, the extension + /// handler will be forced to update even if the extension configuration has not + /// changed. + /// + public string ForceUpdateTag { get; set; } + /// The name of the extension handler publisher. + public string Publisher { get; set; } + /// Specifies the type of the extension; an example is "CustomScriptExtension". + public string ExtensionType { get; set; } + /// Specifies the version of the script handler. + public string TypeHandlerVersion { get; set; } + /// + /// Indicates whether the extension should use a newer minor version if one is + /// available at deployment time. Once deployed, however, the extension will not + /// upgrade minor versions unless redeployed, even with this property set to true. + /// + public bool? ShouldAutoUpgradeMinorVersion { get; set; } + /// + /// Indicates whether the extension should be automatically upgraded by the + /// platform if there is a newer version of the extension available. + /// + public bool? IsAutomaticUpgradeEnabled { get; set; } + /// + /// Json formatted public settings for the extension. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary Settings { get; } + /// + /// The extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary ProtectedSettings { get; } + /// The provisioning state, which only appears in the response. + public string ProvisioningState { get; } + /// + /// Collection of extension names after which this extension needs to be + /// provisioned. + /// + public IList ProvisionAfterExtensions { get; } + /// + /// Indicates whether failures stemming from the extension will be suppressed + /// (Operational failures such as not connecting to the VM will not be suppressed + /// regardless of this value). The default is false. + /// + public bool? IsSuppressFailuresEnabled { get; set; } + /// + /// The extensions protected settings that are passed by reference, and consumed + /// from key vault + /// + public ComputeFleetKeyVaultSecretReference ProtectedSettingsFromKeyVault { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs new file mode 100644 index 000000000000..b423855e93aa --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetVmssHardwareProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssHardwareProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(VmSizeProperties)) + { + writer.WritePropertyName("vmSizeProperties"u8); + writer.WriteObjectValue(VmSizeProperties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssHardwareProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssHardwareProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssHardwareProfile(document.RootElement, options); + } + + internal static ComputeFleetVmssHardwareProfile DeserializeComputeFleetVmssHardwareProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetVmSizeProperties vmSizeProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmSizeProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmSizeProperties = ComputeFleetVmSizeProperties.DeserializeComputeFleetVmSizeProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssHardwareProfile(vmSizeProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssHardwareProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssHardwareProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssHardwareProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssHardwareProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.cs new file mode 100644 index 000000000000..e785f95b4fc0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssHardwareProfile.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the hardware settings for the virtual machine scale set. + internal partial class ComputeFleetVmssHardwareProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssHardwareProfile() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the properties for customizing the size of the virtual machine. + /// Minimum api-version: 2021-11-01. Please follow the instructions in [VM + /// Customization](https://aka.ms/vmcustomization) for more details. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssHardwareProfile(ComputeFleetVmSizeProperties vmSizeProperties, IDictionary serializedAdditionalRawData) + { + VmSizeProperties = vmSizeProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the properties for customizing the size of the virtual machine. + /// Minimum api-version: 2021-11-01. Please follow the instructions in [VM + /// Customization](https://aka.ms/vmcustomization) for more details. + /// + public ComputeFleetVmSizeProperties VmSizeProperties { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs new file mode 100644 index 000000000000..226c64d6585c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssIPConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssIPConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssIPConfiguration(document.RootElement, options); + } + + internal static ComputeFleetVmssIPConfiguration DeserializeComputeFleetVmssIPConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ComputeFleetVmssIPConfigurationProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetVmssIPConfigurationProperties.DeserializeComputeFleetVmssIPConfigurationProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssIPConfiguration(name, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssIPConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssIPConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.cs new file mode 100644 index 000000000000..f7e3e700acb8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfiguration.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set network profile's IP configuration. + public partial class ComputeFleetVmssIPConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The IP configuration name. + /// is null. + public ComputeFleetVmssIPConfiguration(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The IP configuration name. + /// + /// Describes a virtual machine scale set network profile's IP configuration + /// properties. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssIPConfiguration(string name, ComputeFleetVmssIPConfigurationProperties properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssIPConfiguration() + { + } + + /// The IP configuration name. + public string Name { get; set; } + /// + /// Describes a virtual machine scale set network profile's IP configuration + /// properties. + /// + public ComputeFleetVmssIPConfigurationProperties Properties { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs new file mode 100644 index 000000000000..9156cf8a3db6 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.Serialization.cs @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssIPConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfigurationProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + JsonSerializer.Serialize(writer, Subnet); + } + if (Optional.IsDefined(IsPrimary)) + { + writer.WritePropertyName("primary"u8); + writer.WriteBooleanValue(IsPrimary.Value); + } + if (Optional.IsDefined(PublicIPAddressConfiguration)) + { + writer.WritePropertyName("publicIPAddressConfiguration"u8); + writer.WriteObjectValue(PublicIPAddressConfiguration, options); + } + if (Optional.IsDefined(PrivateIPAddressVersion)) + { + writer.WritePropertyName("privateIPAddressVersion"u8); + writer.WriteStringValue(PrivateIPAddressVersion.Value.ToString()); + } + if (Optional.IsCollectionDefined(ApplicationGatewayBackendAddressPools)) + { + writer.WritePropertyName("applicationGatewayBackendAddressPools"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationGatewayBackendAddressPools) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ApplicationSecurityGroups)) + { + writer.WritePropertyName("applicationSecurityGroups"u8); + writer.WriteStartArray(); + foreach (var item in ApplicationSecurityGroups) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(LoadBalancerBackendAddressPools)) + { + writer.WritePropertyName("loadBalancerBackendAddressPools"u8); + writer.WriteStartArray(); + foreach (var item in LoadBalancerBackendAddressPools) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(LoadBalancerInboundNatPools)) + { + writer.WritePropertyName("loadBalancerInboundNatPools"u8); + writer.WriteStartArray(); + foreach (var item in LoadBalancerInboundNatPools) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssIPConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssIPConfigurationProperties(document.RootElement, options); + } + + internal static ComputeFleetVmssIPConfigurationProperties DeserializeComputeFleetVmssIPConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource subnet = default; + bool? primary = default; + ComputeFleetVmssPublicIPAddressConfiguration publicIPAddressConfiguration = default; + ComputeFleetIPVersion? privateIPAddressVersion = default; + IList applicationGatewayBackendAddressPools = default; + IList applicationSecurityGroups = default; + IList loadBalancerBackendAddressPools = default; + IList loadBalancerInboundNatPools = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnet = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("primary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + primary = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("publicIPAddressConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicIPAddressConfiguration = ComputeFleetVmssPublicIPAddressConfiguration.DeserializeComputeFleetVmssPublicIPAddressConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("privateIPAddressVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateIPAddressVersion = new ComputeFleetIPVersion(property.Value.GetString()); + continue; + } + if (property.NameEquals("applicationGatewayBackendAddressPools"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + applicationGatewayBackendAddressPools = array; + continue; + } + if (property.NameEquals("applicationSecurityGroups"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + applicationSecurityGroups = array; + continue; + } + if (property.NameEquals("loadBalancerBackendAddressPools"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + loadBalancerBackendAddressPools = array; + continue; + } + if (property.NameEquals("loadBalancerInboundNatPools"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + loadBalancerInboundNatPools = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssIPConfigurationProperties( + subnet, + primary, + publicIPAddressConfiguration, + privateIPAddressVersion, + applicationGatewayBackendAddressPools ?? new ChangeTrackingList(), + applicationSecurityGroups ?? new ChangeTrackingList(), + loadBalancerBackendAddressPools ?? new ChangeTrackingList(), + loadBalancerInboundNatPools ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssIPConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssIPConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssIPConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.cs new file mode 100644 index 000000000000..bbbb8e11a4ae --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPConfigurationProperties.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes a virtual machine scale set network profile's IP configuration + /// properties. + /// + public partial class ComputeFleetVmssIPConfigurationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssIPConfigurationProperties() + { + ApplicationGatewayBackendAddressPools = new ChangeTrackingList(); + ApplicationSecurityGroups = new ChangeTrackingList(); + LoadBalancerBackendAddressPools = new ChangeTrackingList(); + LoadBalancerInboundNatPools = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Specifies the identifier of the subnet. + /// + /// Specifies the primary network interface in case the virtual machine has more + /// than 1 network interface. + /// + /// The publicIPAddressConfiguration. + /// + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + /// values are: 'IPv4' and 'IPv6'. + /// + /// + /// Specifies an array of references to backend address pools of application + /// gateways. A scale set can reference backend address pools of multiple + /// application gateways. Multiple scale sets cannot use the same application + /// gateway. + /// + /// Specifies an array of references to application security group. + /// + /// Specifies an array of references to backend address pools of load balancers. A + /// scale set can reference backend address pools of one public and one internal + /// load balancer. Multiple scale sets cannot use the same basic sku load balancer. + /// + /// + /// Specifies an array of references to inbound Nat pools of the load balancers. A + /// scale set can reference inbound nat pools of one public and one internal load + /// balancer. Multiple scale sets cannot use the same basic sku load balancer. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssIPConfigurationProperties(WritableSubResource subnet, bool? isPrimary, ComputeFleetVmssPublicIPAddressConfiguration publicIPAddressConfiguration, ComputeFleetIPVersion? privateIPAddressVersion, IList applicationGatewayBackendAddressPools, IList applicationSecurityGroups, IList loadBalancerBackendAddressPools, IList loadBalancerInboundNatPools, IDictionary serializedAdditionalRawData) + { + Subnet = subnet; + IsPrimary = isPrimary; + PublicIPAddressConfiguration = publicIPAddressConfiguration; + PrivateIPAddressVersion = privateIPAddressVersion; + ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; + ApplicationSecurityGroups = applicationSecurityGroups; + LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; + LoadBalancerInboundNatPools = loadBalancerInboundNatPools; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the identifier of the subnet. + internal WritableSubResource Subnet { get; set; } + /// Gets or sets Id. + public ResourceIdentifier SubnetId + { + get => Subnet is null ? default : Subnet.Id; + set + { + if (Subnet is null) + Subnet = new WritableSubResource(); + Subnet.Id = value; + } + } + + /// + /// Specifies the primary network interface in case the virtual machine has more + /// than 1 network interface. + /// + public bool? IsPrimary { get; set; } + /// The publicIPAddressConfiguration. + public ComputeFleetVmssPublicIPAddressConfiguration PublicIPAddressConfiguration { get; set; } + /// + /// Available from Api-Version 2017-03-30 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + /// values are: 'IPv4' and 'IPv6'. + /// + public ComputeFleetIPVersion? PrivateIPAddressVersion { get; set; } + /// + /// Specifies an array of references to backend address pools of application + /// gateways. A scale set can reference backend address pools of multiple + /// application gateways. Multiple scale sets cannot use the same application + /// gateway. + /// + public IList ApplicationGatewayBackendAddressPools { get; } + /// Specifies an array of references to application security group. + public IList ApplicationSecurityGroups { get; } + /// + /// Specifies an array of references to backend address pools of load balancers. A + /// scale set can reference backend address pools of one public and one internal + /// load balancer. Multiple scale sets cannot use the same basic sku load balancer. + /// + public IList LoadBalancerBackendAddressPools { get; } + /// + /// Specifies an array of references to inbound Nat pools of the load balancers. A + /// scale set can reference inbound nat pools of one public and one internal load + /// balancer. Multiple scale sets cannot use the same basic sku load balancer. + /// + public IList LoadBalancerInboundNatPools { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.cs new file mode 100644 index 000000000000..a7ea57f6da10 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssIPTag.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Contains the IP tag associated with the public IP address. + public partial class ComputeFleetVmssIPTag + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssIPTag() + { + } + + /// Initializes a new instance of . + /// IP tag type. Example: FirstPartyUsage. + /// IP tag associated with the public IP. Example: SQL, Storage etc. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssIPTag(string ipTagType, string tag, IDictionary serializedAdditionalRawData) + { + IPTagType = ipTagType; + Tag = tag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// IP tag type. Example: FirstPartyUsage. + public string IPTagType { get; set; } + /// IP tag associated with the public IP. Example: SQL, Storage etc. + public string Tag { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.Serialization.cs new file mode 100644 index 000000000000..30355dc68eb1 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssManagedDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssManagedDisk)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(StorageAccountType)) + { + writer.WritePropertyName("storageAccountType"u8); + writer.WriteStringValue(StorageAccountType.Value.ToString()); + } + if (Optional.IsDefined(DiskEncryptionSet)) + { + writer.WritePropertyName("diskEncryptionSet"u8); + JsonSerializer.Serialize(writer, DiskEncryptionSet); + } + if (Optional.IsDefined(SecurityProfile)) + { + writer.WritePropertyName("securityProfile"u8); + writer.WriteObjectValue(SecurityProfile, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssManagedDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssManagedDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssManagedDisk(document.RootElement, options); + } + + internal static ComputeFleetVmssManagedDisk DeserializeComputeFleetVmssManagedDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetStorageAccountType? storageAccountType = default; + WritableSubResource diskEncryptionSet = default; + ComputeFleetVmDiskSecurityProfile securityProfile = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageAccountType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageAccountType = new ComputeFleetStorageAccountType(property.Value.GetString()); + continue; + } + if (property.NameEquals("diskEncryptionSet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskEncryptionSet = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("securityProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityProfile = ComputeFleetVmDiskSecurityProfile.DeserializeComputeFleetVmDiskSecurityProfile(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssManagedDisk(storageAccountType, diskEncryptionSet, securityProfile, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssManagedDisk)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssManagedDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssManagedDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssManagedDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.cs new file mode 100644 index 000000000000..8136c5f08856 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssManagedDisk.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes the parameters of a ScaleSet managed disk. + public partial class ComputeFleetVmssManagedDisk + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssManagedDisk() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can + /// only be used with data disks, it cannot be used with OS Disk. + /// + /// + /// Specifies the customer managed disk encryption set resource id for the managed + /// disk. + /// + /// Specifies the security profile for the managed disk. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssManagedDisk(ComputeFleetStorageAccountType? storageAccountType, WritableSubResource diskEncryptionSet, ComputeFleetVmDiskSecurityProfile securityProfile, IDictionary serializedAdditionalRawData) + { + StorageAccountType = storageAccountType; + DiskEncryptionSet = diskEncryptionSet; + SecurityProfile = securityProfile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can + /// only be used with data disks, it cannot be used with OS Disk. + /// + public ComputeFleetStorageAccountType? StorageAccountType { get; set; } + /// + /// Specifies the customer managed disk encryption set resource id for the managed + /// disk. + /// + internal WritableSubResource DiskEncryptionSet { get; set; } + /// Gets or sets Id. + public ResourceIdentifier DiskEncryptionSetId + { + get => DiskEncryptionSet is null ? default : DiskEncryptionSet.Id; + set + { + if (DiskEncryptionSet is null) + DiskEncryptionSet = new WritableSubResource(); + DiskEncryptionSet.Id = value; + } + } + + /// Specifies the security profile for the managed disk. + public ComputeFleetVmDiskSecurityProfile SecurityProfile { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs new file mode 100644 index 000000000000..68b09bc5b947 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssNetworkConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssNetworkConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssNetworkConfiguration(document.RootElement, options); + } + + internal static ComputeFleetVmssNetworkConfiguration DeserializeComputeFleetVmssNetworkConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ComputeFleetVmssNetworkConfigurationProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetVmssNetworkConfigurationProperties.DeserializeComputeFleetVmssNetworkConfigurationProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssNetworkConfiguration(name, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssNetworkConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssNetworkConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.cs new file mode 100644 index 000000000000..c850099199d4 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfiguration.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set network profile's network configurations. + public partial class ComputeFleetVmssNetworkConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The network configuration name. + /// is null. + public ComputeFleetVmssNetworkConfiguration(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The network configuration name. + /// Describes a virtual machine scale set network profile's IP configuration. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssNetworkConfiguration(string name, ComputeFleetVmssNetworkConfigurationProperties properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssNetworkConfiguration() + { + } + + /// The network configuration name. + public string Name { get; set; } + /// Describes a virtual machine scale set network profile's IP configuration. + public ComputeFleetVmssNetworkConfigurationProperties Properties { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs new file mode 100644 index 000000000000..a57d4babc99b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.Serialization.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssNetworkConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfigurationProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsPrimary)) + { + writer.WritePropertyName("primary"u8); + writer.WriteBooleanValue(IsPrimary.Value); + } + if (Optional.IsDefined(IsAcceleratedNetworkingEnabled)) + { + writer.WritePropertyName("enableAcceleratedNetworking"u8); + writer.WriteBooleanValue(IsAcceleratedNetworkingEnabled.Value); + } + if (Optional.IsDefined(IsTcpStateTrackingDisabled)) + { + writer.WritePropertyName("disableTcpStateTracking"u8); + writer.WriteBooleanValue(IsTcpStateTrackingDisabled.Value); + } + if (Optional.IsDefined(IsFpgaEnabled)) + { + writer.WritePropertyName("enableFpga"u8); + writer.WriteBooleanValue(IsFpgaEnabled.Value); + } + if (Optional.IsDefined(NetworkSecurityGroup)) + { + writer.WritePropertyName("networkSecurityGroup"u8); + JsonSerializer.Serialize(writer, NetworkSecurityGroup); + } + if (Optional.IsDefined(DnsSettings)) + { + writer.WritePropertyName("dnsSettings"u8); + writer.WriteObjectValue(DnsSettings, options); + } + writer.WritePropertyName("ipConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in IPConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(IsIPForwardingEnabled)) + { + writer.WritePropertyName("enableIPForwarding"u8); + writer.WriteBooleanValue(IsIPForwardingEnabled.Value); + } + if (Optional.IsDefined(DeleteOption)) + { + writer.WritePropertyName("deleteOption"u8); + writer.WriteStringValue(DeleteOption.Value.ToString()); + } + if (Optional.IsDefined(AuxiliaryMode)) + { + writer.WritePropertyName("auxiliaryMode"u8); + writer.WriteStringValue(AuxiliaryMode.Value.ToString()); + } + if (Optional.IsDefined(AuxiliarySku)) + { + writer.WritePropertyName("auxiliarySku"u8); + writer.WriteStringValue(AuxiliarySku.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssNetworkConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssNetworkConfigurationProperties(document.RootElement, options); + } + + internal static ComputeFleetVmssNetworkConfigurationProperties DeserializeComputeFleetVmssNetworkConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? primary = default; + bool? enableAcceleratedNetworking = default; + bool? disableTcpStateTracking = default; + bool? enableFpga = default; + WritableSubResource networkSecurityGroup = default; + ComputeFleetVmssNetworkDnsSettings dnsSettings = default; + IList ipConfigurations = default; + bool? enableIPForwarding = default; + ComputeFleetVmDeleteOption? deleteOption = default; + ComputeFleetNetworkInterfaceAuxiliaryMode? auxiliaryMode = default; + ComputeFleetNetworkInterfaceAuxiliarySku? auxiliarySku = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("primary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + primary = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableAcceleratedNetworking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAcceleratedNetworking = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("disableTcpStateTracking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disableTcpStateTracking = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableFpga"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableFpga = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("networkSecurityGroup"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkSecurityGroup = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("dnsSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dnsSettings = ComputeFleetVmssNetworkDnsSettings.DeserializeComputeFleetVmssNetworkDnsSettings(property.Value, options); + continue; + } + if (property.NameEquals("ipConfigurations"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmssIPConfiguration.DeserializeComputeFleetVmssIPConfiguration(item, options)); + } + ipConfigurations = array; + continue; + } + if (property.NameEquals("enableIPForwarding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableIPForwarding = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("deleteOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOption = new ComputeFleetVmDeleteOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("auxiliaryMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + auxiliaryMode = new ComputeFleetNetworkInterfaceAuxiliaryMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("auxiliarySku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + auxiliarySku = new ComputeFleetNetworkInterfaceAuxiliarySku(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssNetworkConfigurationProperties( + primary, + enableAcceleratedNetworking, + disableTcpStateTracking, + enableFpga, + networkSecurityGroup, + dnsSettings, + ipConfigurations, + enableIPForwarding, + deleteOption, + auxiliaryMode, + auxiliarySku, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssNetworkConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssNetworkConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.cs new file mode 100644 index 000000000000..d1d5b885c2f4 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkConfigurationProperties.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set network profile's IP configuration. + public partial class ComputeFleetVmssNetworkConfigurationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Specifies the IP configurations of the network interface. + /// is null. + public ComputeFleetVmssNetworkConfigurationProperties(IEnumerable ipConfigurations) + { + Argument.AssertNotNull(ipConfigurations, nameof(ipConfigurations)); + + IPConfigurations = ipConfigurations.ToList(); + } + + /// Initializes a new instance of . + /// + /// Specifies the primary network interface in case the virtual machine has more + /// than 1 network interface. + /// + /// Specifies whether the network interface is accelerated networking-enabled. + /// Specifies whether the network interface is disabled for tcp state tracking. + /// Specifies whether the network interface is FPGA networking-enabled. + /// The network security group. + /// The dns settings to be applied on the network interfaces. + /// Specifies the IP configurations of the network interface. + /// Whether IP forwarding enabled on this NIC. + /// Specify what happens to the network interface when the VM is deleted. + /// + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// + /// + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssNetworkConfigurationProperties(bool? isPrimary, bool? isAcceleratedNetworkingEnabled, bool? isTcpStateTrackingDisabled, bool? isFpgaEnabled, WritableSubResource networkSecurityGroup, ComputeFleetVmssNetworkDnsSettings dnsSettings, IList ipConfigurations, bool? isIPForwardingEnabled, ComputeFleetVmDeleteOption? deleteOption, ComputeFleetNetworkInterfaceAuxiliaryMode? auxiliaryMode, ComputeFleetNetworkInterfaceAuxiliarySku? auxiliarySku, IDictionary serializedAdditionalRawData) + { + IsPrimary = isPrimary; + IsAcceleratedNetworkingEnabled = isAcceleratedNetworkingEnabled; + IsTcpStateTrackingDisabled = isTcpStateTrackingDisabled; + IsFpgaEnabled = isFpgaEnabled; + NetworkSecurityGroup = networkSecurityGroup; + DnsSettings = dnsSettings; + IPConfigurations = ipConfigurations; + IsIPForwardingEnabled = isIPForwardingEnabled; + DeleteOption = deleteOption; + AuxiliaryMode = auxiliaryMode; + AuxiliarySku = auxiliarySku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssNetworkConfigurationProperties() + { + } + + /// + /// Specifies the primary network interface in case the virtual machine has more + /// than 1 network interface. + /// + public bool? IsPrimary { get; set; } + /// Specifies whether the network interface is accelerated networking-enabled. + public bool? IsAcceleratedNetworkingEnabled { get; set; } + /// Specifies whether the network interface is disabled for tcp state tracking. + public bool? IsTcpStateTrackingDisabled { get; set; } + /// Specifies whether the network interface is FPGA networking-enabled. + public bool? IsFpgaEnabled { get; set; } + /// The network security group. + internal WritableSubResource NetworkSecurityGroup { get; set; } + /// Gets or sets Id. + public ResourceIdentifier NetworkSecurityGroupId + { + get => NetworkSecurityGroup is null ? default : NetworkSecurityGroup.Id; + set + { + if (NetworkSecurityGroup is null) + NetworkSecurityGroup = new WritableSubResource(); + NetworkSecurityGroup.Id = value; + } + } + + /// The dns settings to be applied on the network interfaces. + internal ComputeFleetVmssNetworkDnsSettings DnsSettings { get; set; } + /// List of DNS servers IP addresses. + public IList DnsServers + { + get + { + if (DnsSettings is null) + DnsSettings = new ComputeFleetVmssNetworkDnsSettings(); + return DnsSettings.DnsServers; + } + } + + /// Specifies the IP configurations of the network interface. + public IList IPConfigurations { get; } + /// Whether IP forwarding enabled on this NIC. + public bool? IsIPForwardingEnabled { get; set; } + /// Specify what happens to the network interface when the VM is deleted. + public ComputeFleetVmDeleteOption? DeleteOption { get; set; } + /// + /// Specifies whether the Auxiliary mode is enabled for the Network Interface + /// resource. + /// + public ComputeFleetNetworkInterfaceAuxiliaryMode? AuxiliaryMode { get; set; } + /// + /// Specifies whether the Auxiliary sku is enabled for the Network Interface + /// resource. + /// + public ComputeFleetNetworkInterfaceAuxiliarySku? AuxiliarySku { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs new file mode 100644 index 000000000000..5282bc5a80df --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class ComputeFleetVmssNetworkDnsSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkDnsSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(DnsServers)) + { + writer.WritePropertyName("dnsServers"u8); + writer.WriteStartArray(); + foreach (var item in DnsServers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssNetworkDnsSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkDnsSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssNetworkDnsSettings(document.RootElement, options); + } + + internal static ComputeFleetVmssNetworkDnsSettings DeserializeComputeFleetVmssNetworkDnsSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList dnsServers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dnsServers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dnsServers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssNetworkDnsSettings(dnsServers ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkDnsSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssNetworkDnsSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssNetworkDnsSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkDnsSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.cs new file mode 100644 index 000000000000..2072d5073cba --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkDnsSettings.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machines scale sets network configuration's DNS settings. + internal partial class ComputeFleetVmssNetworkDnsSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssNetworkDnsSettings() + { + DnsServers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of DNS servers IP addresses. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssNetworkDnsSettings(IList dnsServers, IDictionary serializedAdditionalRawData) + { + DnsServers = dnsServers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of DNS servers IP addresses. + public IList DnsServers { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.Serialization.cs new file mode 100644 index 000000000000..87f624243d6a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssNetworkProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(HealthProbe)) + { + writer.WritePropertyName("healthProbe"u8); + JsonSerializer.Serialize(writer, HealthProbe); + } + if (Optional.IsCollectionDefined(NetworkInterfaceConfigurations)) + { + writer.WritePropertyName("networkInterfaceConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in NetworkInterfaceConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NetworkApiVersion)) + { + writer.WritePropertyName("networkApiVersion"u8); + writer.WriteStringValue(NetworkApiVersion.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssNetworkProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssNetworkProfile(document.RootElement, options); + } + + internal static ComputeFleetVmssNetworkProfile DeserializeComputeFleetVmssNetworkProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WritableSubResource healthProbe = default; + IList networkInterfaceConfigurations = default; + ComputeFleetNetworkApiVersion? networkApiVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("healthProbe"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + healthProbe = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("networkInterfaceConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmssNetworkConfiguration.DeserializeComputeFleetVmssNetworkConfiguration(item, options)); + } + networkInterfaceConfigurations = array; + continue; + } + if (property.NameEquals("networkApiVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkApiVersion = new ComputeFleetNetworkApiVersion(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssNetworkProfile(healthProbe, networkInterfaceConfigurations ?? new ChangeTrackingList(), networkApiVersion, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssNetworkProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssNetworkProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssNetworkProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.cs new file mode 100644 index 000000000000..be081abe9446 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssNetworkProfile.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set network profile. + public partial class ComputeFleetVmssNetworkProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssNetworkProfile() + { + NetworkInterfaceConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// A reference to a load balancer probe used to determine the health of an + /// instance in the virtual machine scale set. The reference will be in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + /// + /// The list of network configurations. + /// + /// specifies the Microsoft.Network API version used when creating networking + /// resources in the Network Interface Configurations for Virtual Machine Scale Set + /// with orchestration mode 'Flexible' + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssNetworkProfile(WritableSubResource healthProbe, IList networkInterfaceConfigurations, ComputeFleetNetworkApiVersion? networkApiVersion, IDictionary serializedAdditionalRawData) + { + HealthProbe = healthProbe; + NetworkInterfaceConfigurations = networkInterfaceConfigurations; + NetworkApiVersion = networkApiVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// A reference to a load balancer probe used to determine the health of an + /// instance in the virtual machine scale set. The reference will be in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. + /// + internal WritableSubResource HealthProbe { get; set; } + /// Gets or sets Id. + public ResourceIdentifier HealthProbeId + { + get => HealthProbe is null ? default : HealthProbe.Id; + set + { + if (HealthProbe is null) + HealthProbe = new WritableSubResource(); + HealthProbe.Id = value; + } + } + + /// The list of network configurations. + public IList NetworkInterfaceConfigurations { get; } + /// + /// specifies the Microsoft.Network API version used when creating networking + /// resources in the Network Interface Configurations for Virtual Machine Scale Set + /// with orchestration mode 'Flexible' + /// + public ComputeFleetNetworkApiVersion? NetworkApiVersion { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs new file mode 100644 index 000000000000..4f726e12f929 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.Serialization.cs @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssOSDisk : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssOSDisk)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Caching)) + { + writer.WritePropertyName("caching"u8); + writer.WriteStringValue(Caching.Value.ToString()); + } + if (Optional.IsDefined(IsWriteAcceleratorEnabled)) + { + writer.WritePropertyName("writeAcceleratorEnabled"u8); + writer.WriteBooleanValue(IsWriteAcceleratorEnabled.Value); + } + writer.WritePropertyName("createOption"u8); + writer.WriteStringValue(CreateOption.ToString()); + if (Optional.IsDefined(DiffDiskSettings)) + { + writer.WritePropertyName("diffDiskSettings"u8); + writer.WriteObjectValue(DiffDiskSettings, options); + } + if (Optional.IsDefined(DiskSizeGB)) + { + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB.Value); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType.Value.ToString()); + } + if (Optional.IsDefined(Image)) + { + writer.WritePropertyName("image"u8); + writer.WriteObjectValue(Image, options); + } + if (Optional.IsCollectionDefined(VhdContainers)) + { + writer.WritePropertyName("vhdContainers"u8); + writer.WriteStartArray(); + foreach (var item in VhdContainers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ManagedDisk)) + { + writer.WritePropertyName("managedDisk"u8); + writer.WriteObjectValue(ManagedDisk, options); + } + if (Optional.IsDefined(DeleteOption)) + { + writer.WritePropertyName("deleteOption"u8); + writer.WriteStringValue(DeleteOption.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssOSDisk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssOSDisk)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssOSDisk(document.RootElement, options); + } + + internal static ComputeFleetVmssOSDisk DeserializeComputeFleetVmssOSDisk(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ComputeFleetCachingType? caching = default; + bool? writeAcceleratorEnabled = default; + ComputeFleetDiskCreateOptionType createOption = default; + ComputeFleetDiffDiskSettings diffDiskSettings = default; + int? diskSizeGB = default; + ComputeFleetOperatingSystemType? osType = default; + ComputeFleetVirtualHardDisk image = default; + IList vhdContainers = default; + ComputeFleetVmssManagedDisk managedDisk = default; + ComputeFleetDiskDeleteOptionType? deleteOption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("caching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + caching = new ComputeFleetCachingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("writeAcceleratorEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + writeAcceleratorEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("createOption"u8)) + { + createOption = new ComputeFleetDiskCreateOptionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("diffDiskSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diffDiskSettings = ComputeFleetDiffDiskSettings.DeserializeComputeFleetDiffDiskSettings(property.Value, options); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeGB = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("osType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osType = new ComputeFleetOperatingSystemType(property.Value.GetString()); + continue; + } + if (property.NameEquals("image"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + image = ComputeFleetVirtualHardDisk.DeserializeComputeFleetVirtualHardDisk(property.Value, options); + continue; + } + if (property.NameEquals("vhdContainers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + vhdContainers = array; + continue; + } + if (property.NameEquals("managedDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedDisk = ComputeFleetVmssManagedDisk.DeserializeComputeFleetVmssManagedDisk(property.Value, options); + continue; + } + if (property.NameEquals("deleteOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOption = new ComputeFleetDiskDeleteOptionType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssOSDisk( + name, + caching, + writeAcceleratorEnabled, + createOption, + diffDiskSettings, + diskSizeGB, + osType, + image, + vhdContainers ?? new ChangeTrackingList(), + managedDisk, + deleteOption, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssOSDisk)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssOSDisk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssOSDisk(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssOSDisk)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.cs new file mode 100644 index 000000000000..4509a4404fcf --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSDisk.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set operating system disk. + public partial class ComputeFleetVmssOSDisk + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Specifies how the virtual machines in the scale set should be created. The only + /// allowed value is: **FromImage.** This value is used when you are using an image + /// to create the virtual machine. If you are using a platform image, you also use + /// the imageReference element described above. If you are using a marketplace + /// image, you also use the plan element previously described. + /// + public ComputeFleetVmssOSDisk(ComputeFleetDiskCreateOptionType createOption) + { + CreateOption = createOption; + VhdContainers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The disk name. + /// + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// + /// Specifies whether writeAccelerator should be enabled or disabled on the disk. + /// + /// Specifies how the virtual machines in the scale set should be created. The only + /// allowed value is: **FromImage.** This value is used when you are using an image + /// to create the virtual machine. If you are using a platform image, you also use + /// the imageReference element described above. If you are using a marketplace + /// image, you also use the plan element previously described. + /// + /// + /// Specifies the ephemeral disk Settings for the operating system disk used by the + /// virtual machine scale set. + /// + /// + /// Specifies the size of an empty data disk in gigabytes. This element can be used + /// to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' + /// is the number of bytes x 1024^3 for the disk and the value cannot + /// be larger than 1023. + /// + /// + /// This property allows you to specify the type of the OS that is included in the + /// disk if creating a VM from user-image or a specialized VHD. Possible values + /// are: **Windows,** **Linux.** + /// + /// Specifies information about the unmanaged user image to base the scale set on. + /// + /// Specifies the container urls that are used to store operating system disks for + /// the scale set. + /// + /// The managed disk parameters. + /// + /// Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion + /// (This feature is available for VMSS with Flexible OrchestrationMode only). + /// <br><br> Possible values: <br><br> **Delete** If this value is used, the OS + /// disk is deleted when VMSS Flex VM is deleted.<br><br> **Detach** If this value + /// is used, the OS disk is retained after VMSS Flex VM is deleted. <br><br> The + /// default value is set to **Delete**. For an Ephemeral OS Disk, the default value + /// is set to **Delete**. User cannot change the delete option for Ephemeral OS + /// Disk. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssOSDisk(string name, ComputeFleetCachingType? caching, bool? isWriteAcceleratorEnabled, ComputeFleetDiskCreateOptionType createOption, ComputeFleetDiffDiskSettings diffDiskSettings, int? diskSizeGB, ComputeFleetOperatingSystemType? osType, ComputeFleetVirtualHardDisk image, IList vhdContainers, ComputeFleetVmssManagedDisk managedDisk, ComputeFleetDiskDeleteOptionType? deleteOption, IDictionary serializedAdditionalRawData) + { + Name = name; + Caching = caching; + IsWriteAcceleratorEnabled = isWriteAcceleratorEnabled; + CreateOption = createOption; + DiffDiskSettings = diffDiskSettings; + DiskSizeGB = diskSizeGB; + OSType = osType; + Image = image; + VhdContainers = vhdContainers; + ManagedDisk = managedDisk; + DeleteOption = deleteOption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssOSDisk() + { + } + + /// The disk name. + public string Name { get; set; } + /// + /// Specifies the caching requirements. Possible values are: **None,** + /// **ReadOnly,** **ReadWrite.** The default values are: **None for Standard + /// storage. ReadOnly for Premium storage.** + /// + public ComputeFleetCachingType? Caching { get; set; } + /// Specifies whether writeAccelerator should be enabled or disabled on the disk. + public bool? IsWriteAcceleratorEnabled { get; set; } + /// + /// Specifies how the virtual machines in the scale set should be created. The only + /// allowed value is: **FromImage.** This value is used when you are using an image + /// to create the virtual machine. If you are using a platform image, you also use + /// the imageReference element described above. If you are using a marketplace + /// image, you also use the plan element previously described. + /// + public ComputeFleetDiskCreateOptionType CreateOption { get; set; } + /// + /// Specifies the ephemeral disk Settings for the operating system disk used by the + /// virtual machine scale set. + /// + public ComputeFleetDiffDiskSettings DiffDiskSettings { get; set; } + /// + /// Specifies the size of an empty data disk in gigabytes. This element can be used + /// to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' + /// is the number of bytes x 1024^3 for the disk and the value cannot + /// be larger than 1023. + /// + public int? DiskSizeGB { get; set; } + /// + /// This property allows you to specify the type of the OS that is included in the + /// disk if creating a VM from user-image or a specialized VHD. Possible values + /// are: **Windows,** **Linux.** + /// + public ComputeFleetOperatingSystemType? OSType { get; set; } + /// Specifies information about the unmanaged user image to base the scale set on. + internal ComputeFleetVirtualHardDisk Image { get; set; } + /// Specifies the virtual hard disk's uri. + public Uri ImageUri + { + get => Image is null ? default : Image.Uri; + set + { + if (Image is null) + Image = new ComputeFleetVirtualHardDisk(); + Image.Uri = value; + } + } + + /// + /// Specifies the container urls that are used to store operating system disks for + /// the scale set. + /// + public IList VhdContainers { get; } + /// The managed disk parameters. + public ComputeFleetVmssManagedDisk ManagedDisk { get; set; } + /// + /// Specifies whether OS Disk should be deleted or detached upon VMSS Flex deletion + /// (This feature is available for VMSS with Flexible OrchestrationMode only). + /// <br><br> Possible values: <br><br> **Delete** If this value is used, the OS + /// disk is deleted when VMSS Flex VM is deleted.<br><br> **Detach** If this value + /// is used, the OS disk is retained after VMSS Flex VM is deleted. <br><br> The + /// default value is set to **Delete**. For an Ephemeral OS Disk, the default value + /// is set to **Delete**. User cannot change the delete option for Ephemeral OS + /// Disk. + /// + public ComputeFleetDiskDeleteOptionType? DeleteOption { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs new file mode 100644 index 000000000000..f698a839b3c8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.Serialization.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssOSProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssOSProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ComputerNamePrefix)) + { + writer.WritePropertyName("computerNamePrefix"u8); + writer.WriteStringValue(ComputerNamePrefix); + } + if (Optional.IsDefined(AdminUsername)) + { + writer.WritePropertyName("adminUsername"u8); + writer.WriteStringValue(AdminUsername); + } + if (Optional.IsDefined(AdminPassword)) + { + writer.WritePropertyName("adminPassword"u8); + writer.WriteStringValue(AdminPassword); + } + if (Optional.IsDefined(CustomData)) + { + writer.WritePropertyName("customData"u8); + writer.WriteStringValue(CustomData); + } + if (Optional.IsDefined(WindowsConfiguration)) + { + writer.WritePropertyName("windowsConfiguration"u8); + writer.WriteObjectValue(WindowsConfiguration, options); + } + if (Optional.IsDefined(LinuxConfiguration)) + { + writer.WritePropertyName("linuxConfiguration"u8); + writer.WriteObjectValue(LinuxConfiguration, options); + } + if (Optional.IsCollectionDefined(Secrets)) + { + writer.WritePropertyName("secrets"u8); + writer.WriteStartArray(); + foreach (var item in Secrets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AreExtensionOperationsAllowed)) + { + writer.WritePropertyName("allowExtensionOperations"u8); + writer.WriteBooleanValue(AreExtensionOperationsAllowed.Value); + } + if (Optional.IsDefined(IsGuestProvisionSignalRequired)) + { + writer.WritePropertyName("requireGuestProvisionSignal"u8); + writer.WriteBooleanValue(IsGuestProvisionSignalRequired.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssOSProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssOSProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssOSProfile(document.RootElement, options); + } + + internal static ComputeFleetVmssOSProfile DeserializeComputeFleetVmssOSProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string computerNamePrefix = default; + string adminUsername = default; + string adminPassword = default; + string customData = default; + ComputeFleetWindowsConfiguration windowsConfiguration = default; + ComputeFleetLinuxConfiguration linuxConfiguration = default; + IList secrets = default; + bool? allowExtensionOperations = default; + bool? requireGuestProvisionSignal = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("computerNamePrefix"u8)) + { + computerNamePrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("adminUsername"u8)) + { + adminUsername = property.Value.GetString(); + continue; + } + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("customData"u8)) + { + customData = property.Value.GetString(); + continue; + } + if (property.NameEquals("windowsConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + windowsConfiguration = ComputeFleetWindowsConfiguration.DeserializeComputeFleetWindowsConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("linuxConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + linuxConfiguration = ComputeFleetLinuxConfiguration.DeserializeComputeFleetLinuxConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("secrets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVaultSecretGroup.DeserializeComputeFleetVaultSecretGroup(item, options)); + } + secrets = array; + continue; + } + if (property.NameEquals("allowExtensionOperations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowExtensionOperations = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("requireGuestProvisionSignal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + requireGuestProvisionSignal = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssOSProfile( + computerNamePrefix, + adminUsername, + adminPassword, + customData, + windowsConfiguration, + linuxConfiguration, + secrets ?? new ChangeTrackingList(), + allowExtensionOperations, + requireGuestProvisionSignal, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssOSProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssOSProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssOSProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssOSProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.cs new file mode 100644 index 000000000000..5f6f9870f1fc --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssOSProfile.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set OS profile. + public partial class ComputeFleetVmssOSProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssOSProfile() + { + Secrets = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Specifies the computer name prefix for all of the virtual machines in the scale + /// set. Computer name prefixes must be 1 to 15 characters long. + /// + /// + /// Specifies the name of the administrator account. <br><br> **Windows-only + /// restriction:** Cannot end in "." <br><br> **Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", + /// "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", + /// "console", "david", "guest", "john", "owner", "root", "server", "sql", + /// "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + /// <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length + /// (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters + /// + /// + /// Specifies the password of the administrator account. <br><br> **Minimum-length + /// (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + /// <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length + /// (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 + /// conditions below need to be fulfilled <br> Has lower characters <br>Has upper + /// characters <br> Has a digit <br> Has a special character (Regex match [\W_]) + /// <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + /// "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", + /// "Password22", "iloveyou!" <br><br> For resetting the password, see [How to + /// reset the Remote Desktop service or its login password in a Windows + /// VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + /// <br><br> For resetting root password, see [Manage users, SSH, and check or + /// repair disks on Azure Linux VMs using the VMAccess + /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + /// + /// + /// Specifies a base-64 encoded string of custom data. The base-64 encoded string + /// is decoded to a binary array that is saved as a file on the Virtual Machine. + /// The maximum length of the binary array is 65535 bytes. For using cloud-init for + /// your VM, see [Using cloud-init to customize a Linux VM during + /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + /// + /// Specifies Windows operating system settings on the virtual machine. + /// + /// Specifies the Linux operating system settings on the virtual machine. For a + /// list of supported Linux distributions, see [Linux on Azure-Endorsed + /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + /// + /// + /// Specifies set of certificates that should be installed onto the virtual + /// machines in the scale set. To install certificates on a virtual machine it is + /// recommended to use the [Azure Key Vault virtual machine extension for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + /// + /// Specifies whether extension operations should be allowed on the virtual machine + /// scale set. This may only be set to False when no extensions are present on the + /// virtual machine scale set. + /// + /// Optional property which must either be set to True or omitted. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssOSProfile(string computerNamePrefix, string adminUsername, string adminPassword, string customData, ComputeFleetWindowsConfiguration windowsConfiguration, ComputeFleetLinuxConfiguration linuxConfiguration, IList secrets, bool? areExtensionOperationsAllowed, bool? isGuestProvisionSignalRequired, IDictionary serializedAdditionalRawData) + { + ComputerNamePrefix = computerNamePrefix; + AdminUsername = adminUsername; + AdminPassword = adminPassword; + CustomData = customData; + WindowsConfiguration = windowsConfiguration; + LinuxConfiguration = linuxConfiguration; + Secrets = secrets; + AreExtensionOperationsAllowed = areExtensionOperationsAllowed; + IsGuestProvisionSignalRequired = isGuestProvisionSignalRequired; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the computer name prefix for all of the virtual machines in the scale + /// set. Computer name prefixes must be 1 to 15 characters long. + /// + public string ComputerNamePrefix { get; set; } + /// + /// Specifies the name of the administrator account. <br><br> **Windows-only + /// restriction:** Cannot end in "." <br><br> **Disallowed values:** + /// "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", + /// "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", + /// "console", "david", "guest", "john", "owner", "root", "server", "sql", + /// "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". + /// <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length + /// (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters + /// + public string AdminUsername { get; set; } + /// + /// Specifies the password of the administrator account. <br><br> **Minimum-length + /// (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters + /// <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length + /// (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 + /// conditions below need to be fulfilled <br> Has lower characters <br>Has upper + /// characters <br> Has a digit <br> Has a special character (Regex match [\W_]) + /// <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", + /// "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", + /// "Password22", "iloveyou!" <br><br> For resetting the password, see [How to + /// reset the Remote Desktop service or its login password in a Windows + /// VM](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) + /// <br><br> For resetting root password, see [Manage users, SSH, and check or + /// repair disks on Azure Linux VMs using the VMAccess + /// Extension](https://docs.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection) + /// + public string AdminPassword { get; set; } + /// + /// Specifies a base-64 encoded string of custom data. The base-64 encoded string + /// is decoded to a binary array that is saved as a file on the Virtual Machine. + /// The maximum length of the binary array is 65535 bytes. For using cloud-init for + /// your VM, see [Using cloud-init to customize a Linux VM during + /// creation](https://docs.microsoft.com/azure/virtual-machines/linux/using-cloud-init) + /// + public string CustomData { get; set; } + /// Specifies Windows operating system settings on the virtual machine. + public ComputeFleetWindowsConfiguration WindowsConfiguration { get; set; } + /// + /// Specifies the Linux operating system settings on the virtual machine. For a + /// list of supported Linux distributions, see [Linux on Azure-Endorsed + /// Distributions](https://docs.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + /// + public ComputeFleetLinuxConfiguration LinuxConfiguration { get; set; } + /// + /// Specifies set of certificates that should be installed onto the virtual + /// machines in the scale set. To install certificates on a virtual machine it is + /// recommended to use the [Azure Key Vault virtual machine extension for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + public IList Secrets { get; } + /// + /// Specifies whether extension operations should be allowed on the virtual machine + /// scale set. This may only be set to False when no extensions are present on the + /// virtual machine scale set. + /// + public bool? AreExtensionOperationsAllowed { get; set; } + /// Optional property which must either be set to True or omitted. + public bool? IsGuestProvisionSignalRequired { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs new file mode 100644 index 000000000000..984746b71cf2 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssPublicIPAddressConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssPublicIPAddressConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssPublicIPAddressConfiguration(document.RootElement, options); + } + + internal static ComputeFleetVmssPublicIPAddressConfiguration DeserializeComputeFleetVmssPublicIPAddressConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ComputeFleetVmssPublicIPAddressConfigurationProperties properties = default; + ComputeFleetPublicIPAddressSku sku = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ComputeFleetVmssPublicIPAddressConfigurationProperties.DeserializeComputeFleetVmssPublicIPAddressConfigurationProperties(property.Value, options); + continue; + } + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = ComputeFleetPublicIPAddressSku.DeserializeComputeFleetPublicIPAddressSku(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssPublicIPAddressConfiguration(name, properties, sku, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssPublicIPAddressConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssPublicIPAddressConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.cs new file mode 100644 index 000000000000..a3372c6f0736 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfiguration.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration + /// + public partial class ComputeFleetVmssPublicIPAddressConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The publicIP address configuration name. + /// is null. + public ComputeFleetVmssPublicIPAddressConfiguration(string name) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + } + + /// Initializes a new instance of . + /// The publicIP address configuration name. + /// + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration + /// + /// + /// Describes the public IP Sku. It can only be set with OrchestrationMode as + /// Flexible. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssPublicIPAddressConfiguration(string name, ComputeFleetVmssPublicIPAddressConfigurationProperties properties, ComputeFleetPublicIPAddressSku sku, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + Sku = sku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssPublicIPAddressConfiguration() + { + } + + /// The publicIP address configuration name. + public string Name { get; set; } + /// + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration + /// + public ComputeFleetVmssPublicIPAddressConfigurationProperties Properties { get; set; } + /// + /// Describes the public IP Sku. It can only be set with OrchestrationMode as + /// Flexible. + /// + public ComputeFleetPublicIPAddressSku Sku { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs new file mode 100644 index 000000000000..9c5197c3c40b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.Serialization.cs @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssPublicIPAddressConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfigurationProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IdleTimeoutInMinutes)) + { + writer.WritePropertyName("idleTimeoutInMinutes"u8); + writer.WriteNumberValue(IdleTimeoutInMinutes.Value); + } + if (Optional.IsDefined(DnsSettings)) + { + writer.WritePropertyName("dnsSettings"u8); + writer.WriteObjectValue(DnsSettings, options); + } + if (Optional.IsCollectionDefined(IPTags)) + { + writer.WritePropertyName("ipTags"u8); + writer.WriteStartArray(); + foreach (var item in IPTags) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PublicIPPrefix)) + { + writer.WritePropertyName("publicIPPrefix"u8); + JsonSerializer.Serialize(writer, PublicIPPrefix); + } + if (Optional.IsDefined(PublicIPAddressVersion)) + { + writer.WritePropertyName("publicIPAddressVersion"u8); + writer.WriteStringValue(PublicIPAddressVersion.Value.ToString()); + } + if (Optional.IsDefined(DeleteOption)) + { + writer.WritePropertyName("deleteOption"u8); + writer.WriteStringValue(DeleteOption.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssPublicIPAddressConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssPublicIPAddressConfigurationProperties(document.RootElement, options); + } + + internal static ComputeFleetVmssPublicIPAddressConfigurationProperties DeserializeComputeFleetVmssPublicIPAddressConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? idleTimeoutInMinutes = default; + ComputeFleetVmssPublicIPAddressDnsSettings dnsSettings = default; + IList ipTags = default; + WritableSubResource publicIPPrefix = default; + ComputeFleetIPVersion? publicIPAddressVersion = default; + ComputeFleetVmDeleteOption? deleteOption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("idleTimeoutInMinutes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + idleTimeoutInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("dnsSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dnsSettings = ComputeFleetVmssPublicIPAddressDnsSettings.DeserializeComputeFleetVmssPublicIPAddressDnsSettings(property.Value, options); + continue; + } + if (property.NameEquals("ipTags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmssIPTag.DeserializeComputeFleetVmssIPTag(item, options)); + } + ipTags = array; + continue; + } + if (property.NameEquals("publicIPPrefix"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicIPPrefix = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("publicIPAddressVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicIPAddressVersion = new ComputeFleetIPVersion(property.Value.GetString()); + continue; + } + if (property.NameEquals("deleteOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deleteOption = new ComputeFleetVmDeleteOption(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssPublicIPAddressConfigurationProperties( + idleTimeoutInMinutes, + dnsSettings, + ipTags ?? new ChangeTrackingList(), + publicIPPrefix, + publicIPAddressVersion, + deleteOption, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssPublicIPAddressConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssPublicIPAddressConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.cs new file mode 100644 index 000000000000..387582ab8d8e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressConfigurationProperties.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Describes a virtual machines scale set IP Configuration's PublicIPAddress + /// configuration + /// + public partial class ComputeFleetVmssPublicIPAddressConfigurationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssPublicIPAddressConfigurationProperties() + { + IPTags = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The idle timeout of the public IP address. + /// The dns settings to be applied on the publicIP addresses . + /// The list of IP tags associated with the public IP address. + /// The PublicIPPrefix from which to allocate publicIP addresses. + /// + /// Available from Api-Version 2019-07-01 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + /// values are: 'IPv4' and 'IPv6'. + /// + /// Specify what happens to the public IP when the VM is deleted. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssPublicIPAddressConfigurationProperties(int? idleTimeoutInMinutes, ComputeFleetVmssPublicIPAddressDnsSettings dnsSettings, IList ipTags, WritableSubResource publicIPPrefix, ComputeFleetIPVersion? publicIPAddressVersion, ComputeFleetVmDeleteOption? deleteOption, IDictionary serializedAdditionalRawData) + { + IdleTimeoutInMinutes = idleTimeoutInMinutes; + DnsSettings = dnsSettings; + IPTags = ipTags; + PublicIPPrefix = publicIPPrefix; + PublicIPAddressVersion = publicIPAddressVersion; + DeleteOption = deleteOption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The idle timeout of the public IP address. + public int? IdleTimeoutInMinutes { get; set; } + /// The dns settings to be applied on the publicIP addresses . + public ComputeFleetVmssPublicIPAddressDnsSettings DnsSettings { get; set; } + /// The list of IP tags associated with the public IP address. + public IList IPTags { get; } + /// The PublicIPPrefix from which to allocate publicIP addresses. + internal WritableSubResource PublicIPPrefix { get; set; } + /// Gets or sets Id. + public ResourceIdentifier PublicIPPrefixId + { + get => PublicIPPrefix is null ? default : PublicIPPrefix.Id; + set + { + if (PublicIPPrefix is null) + PublicIPPrefix = new WritableSubResource(); + PublicIPPrefix.Id = value; + } + } + + /// + /// Available from Api-Version 2019-07-01 onwards, it represents whether the + /// specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible + /// values are: 'IPv4' and 'IPv6'. + /// + public ComputeFleetIPVersion? PublicIPAddressVersion { get; set; } + /// Specify what happens to the public IP when the VM is deleted. + public ComputeFleetVmDeleteOption? DeleteOption { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs new file mode 100644 index 000000000000..549d22d6b6bc --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssPublicIPAddressDnsSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressDnsSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("domainNameLabel"u8); + writer.WriteStringValue(DomainNameLabel); + if (Optional.IsDefined(DomainNameLabelScope)) + { + writer.WritePropertyName("domainNameLabelScope"u8); + writer.WriteStringValue(DomainNameLabelScope.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssPublicIPAddressDnsSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressDnsSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssPublicIPAddressDnsSettings(document.RootElement, options); + } + + internal static ComputeFleetVmssPublicIPAddressDnsSettings DeserializeComputeFleetVmssPublicIPAddressDnsSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string domainNameLabel = default; + ComputeFleetDomainNameLabelScopeType? domainNameLabelScope = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("domainNameLabel"u8)) + { + domainNameLabel = property.Value.GetString(); + continue; + } + if (property.NameEquals("domainNameLabelScope"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + domainNameLabelScope = new ComputeFleetDomainNameLabelScopeType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssPublicIPAddressDnsSettings(domainNameLabel, domainNameLabelScope, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressDnsSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssPublicIPAddressDnsSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssPublicIPAddressDnsSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssPublicIPAddressDnsSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.cs new file mode 100644 index 000000000000..77ec4a06980f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssPublicIPAddressDnsSettings.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machines scale sets network configuration's DNS settings. + public partial class ComputeFleetVmssPublicIPAddressDnsSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// The Domain name label.The concatenation of the domain name label and vm index + /// will be the domain name labels of the PublicIPAddress resources that will be + /// created + /// + /// is null. + public ComputeFleetVmssPublicIPAddressDnsSettings(string domainNameLabel) + { + Argument.AssertNotNull(domainNameLabel, nameof(domainNameLabel)); + + DomainNameLabel = domainNameLabel; + } + + /// Initializes a new instance of . + /// + /// The Domain name label.The concatenation of the domain name label and vm index + /// will be the domain name labels of the PublicIPAddress resources that will be + /// created + /// + /// + /// The Domain name label scope.The concatenation of the hashed domain name label + /// that generated according to the policy from domain name label scope and vm + /// index will be the domain name labels of the PublicIPAddress resources that will + /// be created + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssPublicIPAddressDnsSettings(string domainNameLabel, ComputeFleetDomainNameLabelScopeType? domainNameLabelScope, IDictionary serializedAdditionalRawData) + { + DomainNameLabel = domainNameLabel; + DomainNameLabelScope = domainNameLabelScope; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmssPublicIPAddressDnsSettings() + { + } + + /// + /// The Domain name label.The concatenation of the domain name label and vm index + /// will be the domain name labels of the PublicIPAddress resources that will be + /// created + /// + public string DomainNameLabel { get; set; } + /// + /// The Domain name label scope.The concatenation of the hashed domain name label + /// that generated according to the policy from domain name label scope and vm + /// index will be the domain name labels of the PublicIPAddress resources that will + /// be created + /// + public ComputeFleetDomainNameLabelScopeType? DomainNameLabelScope { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs new file mode 100644 index 000000000000..525485dfa9fa --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.Serialization.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetVmssStorageProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssStorageProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ImageReference)) + { + writer.WritePropertyName("imageReference"u8); + writer.WriteObjectValue(ImageReference, options); + } + if (Optional.IsDefined(OSDisk)) + { + writer.WritePropertyName("osDisk"u8); + writer.WriteObjectValue(OSDisk, options); + } + if (Optional.IsCollectionDefined(DataDisks)) + { + writer.WritePropertyName("dataDisks"u8); + writer.WriteStartArray(); + foreach (var item in DataDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DiskControllerType)) + { + writer.WritePropertyName("diskControllerType"u8); + writer.WriteStringValue(DiskControllerType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetVmssStorageProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmssStorageProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmssStorageProfile(document.RootElement, options); + } + + internal static ComputeFleetVmssStorageProfile DeserializeComputeFleetVmssStorageProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetImageReference imageReference = default; + ComputeFleetVmssOSDisk osDisk = default; + IList dataDisks = default; + ComputeFleetDiskControllerType? diskControllerType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("imageReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + imageReference = ComputeFleetImageReference.DeserializeComputeFleetImageReference(property.Value, options); + continue; + } + if (property.NameEquals("osDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osDisk = ComputeFleetVmssOSDisk.DeserializeComputeFleetVmssOSDisk(property.Value, options); + continue; + } + if (property.NameEquals("dataDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmssDataDisk.DeserializeComputeFleetVmssDataDisk(item, options)); + } + dataDisks = array; + continue; + } + if (property.NameEquals("diskControllerType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskControllerType = new ComputeFleetDiskControllerType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmssStorageProfile(imageReference, osDisk, dataDisks ?? new ChangeTrackingList(), diskControllerType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssStorageProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmssStorageProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetVmssStorageProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmssStorageProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.cs new file mode 100644 index 000000000000..b966f044c957 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmssStorageProfile.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes a virtual machine scale set storage profile. + public partial class ComputeFleetVmssStorageProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetVmssStorageProfile() + { + DataDisks = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Specifies information about the image to use. You can specify information about + /// platform images, marketplace images, or virtual machine images. This element is + /// required when you want to use a platform image, marketplace image, or virtual + /// machine image, but is not used in other creation operations. + /// + /// + /// Specifies information about the operating system disk used by the virtual + /// machines in the scale set. For more information about disks, see [About disks + /// and VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + /// + /// Specifies the parameters that are used to add data disks to the virtual + /// machines in the scale set. For more information about disks, see [About disks + /// and VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + /// Specifies the disk controller type configured for the virtual machines in the scale set. Minimum api-version: 2022-08-01. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmssStorageProfile(ComputeFleetImageReference imageReference, ComputeFleetVmssOSDisk osDisk, IList dataDisks, ComputeFleetDiskControllerType? diskControllerType, IDictionary serializedAdditionalRawData) + { + ImageReference = imageReference; + OSDisk = osDisk; + DataDisks = dataDisks; + DiskControllerType = diskControllerType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies information about the image to use. You can specify information about + /// platform images, marketplace images, or virtual machine images. This element is + /// required when you want to use a platform image, marketplace image, or virtual + /// machine image, but is not used in other creation operations. + /// + public ComputeFleetImageReference ImageReference { get; set; } + /// + /// Specifies information about the operating system disk used by the virtual + /// machines in the scale set. For more information about disks, see [About disks + /// and VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + public ComputeFleetVmssOSDisk OSDisk { get; set; } + /// + /// Specifies the parameters that are used to add data disks to the virtual + /// machines in the scale set. For more information about disks, see [About disks + /// and VHDs for Azure virtual + /// machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview). + /// + public IList DataDisks { get; } + /// Specifies the disk controller type configured for the virtual machines in the scale set. Minimum api-version: 2022-08-01. + public ComputeFleetDiskControllerType? DiskControllerType { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs new file mode 100644 index 000000000000..b30770bb281f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetWinRMListener : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetWinRMListener)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Protocol)) + { + writer.WritePropertyName("protocol"u8); + writer.WriteStringValue(Protocol.Value.ToString()); + } + if (Optional.IsDefined(CertificateUri)) + { + writer.WritePropertyName("certificateUrl"u8); + writer.WriteStringValue(CertificateUri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetWinRMListener IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetWinRMListener)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetWinRMListener(document.RootElement, options); + } + + internal static ComputeFleetWinRMListener DeserializeComputeFleetWinRMListener(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetProtocolType? protocol = default; + Uri certificateUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protocol"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protocol = new ComputeFleetProtocolType(property.Value.GetString()); + continue; + } + if (property.NameEquals("certificateUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + certificateUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetWinRMListener(protocol, certificateUrl, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetWinRMListener)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetWinRMListener IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetWinRMListener(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetWinRMListener)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.cs new file mode 100644 index 000000000000..33f9ceeec6b8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWinRMListener.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes Protocol and thumbprint of Windows Remote Management listener. + public partial class ComputeFleetWinRMListener + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetWinRMListener() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the protocol of WinRM listener. Possible values are: **http,** + /// **https.** + /// + /// + /// This is the URL of a certificate that has been uploaded to Key Vault as a + /// secret. For adding a secret to the Key Vault, see [Add a key or secret to the + /// key + /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + /// In this case, your certificate needs to be the Base64 encoding of the following + /// JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a virtual + /// machine it is recommended to use the [Azure Key Vault virtual machine extension + /// for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetWinRMListener(ComputeFleetProtocolType? protocol, Uri certificateUri, IDictionary serializedAdditionalRawData) + { + Protocol = protocol; + CertificateUri = certificateUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the protocol of WinRM listener. Possible values are: **http,** + /// **https.** + /// + public ComputeFleetProtocolType? Protocol { get; set; } + /// + /// This is the URL of a certificate that has been uploaded to Key Vault as a + /// secret. For adding a secret to the Key Vault, see [Add a key or secret to the + /// key + /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + /// In this case, your certificate needs to be the Base64 encoding of the following + /// JSON Object which is encoded in UTF-8: <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} <br> To install certificates on a virtual + /// machine it is recommended to use the [Azure Key Vault virtual machine extension + /// for + /// Linux](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-linux) + /// or the [Azure Key Vault virtual machine extension for + /// Windows](https://docs.microsoft.com/azure/virtual-machines/extensions/key-vault-windows). + /// + public Uri CertificateUri { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs new file mode 100644 index 000000000000..bb7cfbca2055 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetWindowsConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetWindowsConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsVmAgentProvisioned)) + { + writer.WritePropertyName("provisionVMAgent"u8); + writer.WriteBooleanValue(IsVmAgentProvisioned.Value); + } + if (Optional.IsDefined(IsAutomaticUpdatesEnabled)) + { + writer.WritePropertyName("enableAutomaticUpdates"u8); + writer.WriteBooleanValue(IsAutomaticUpdatesEnabled.Value); + } + if (Optional.IsDefined(TimeZone)) + { + writer.WritePropertyName("timeZone"u8); + writer.WriteStringValue(TimeZone); + } + if (Optional.IsCollectionDefined(AdditionalUnattendContent)) + { + writer.WritePropertyName("additionalUnattendContent"u8); + writer.WriteStartArray(); + foreach (var item in AdditionalUnattendContent) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PatchSettings)) + { + writer.WritePropertyName("patchSettings"u8); + writer.WriteObjectValue(PatchSettings, options); + } + if (Optional.IsDefined(WinRM)) + { + writer.WritePropertyName("winRM"u8); + writer.WriteObjectValue(WinRM, options); + } + if (Optional.IsDefined(IsVmAgentPlatformUpdatesEnabled)) + { + writer.WritePropertyName("enableVMAgentPlatformUpdates"u8); + writer.WriteBooleanValue(IsVmAgentPlatformUpdatesEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetWindowsConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetWindowsConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetWindowsConfiguration(document.RootElement, options); + } + + internal static ComputeFleetWindowsConfiguration DeserializeComputeFleetWindowsConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? provisionVmAgent = default; + bool? enableAutomaticUpdates = default; + string timeZone = default; + IList additionalUnattendContent = default; + ComputeFleetVmGuestPatchSettings patchSettings = default; + WinRMConfiguration winRM = default; + bool? enableVmAgentPlatformUpdates = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisionVMAgent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisionVmAgent = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableAutomaticUpdates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutomaticUpdates = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("timeZone"u8)) + { + timeZone = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalUnattendContent"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WindowsSetupAdditionalInformation.DeserializeWindowsSetupAdditionalInformation(item, options)); + } + additionalUnattendContent = array; + continue; + } + if (property.NameEquals("patchSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchSettings = ComputeFleetVmGuestPatchSettings.DeserializeComputeFleetVmGuestPatchSettings(property.Value, options); + continue; + } + if (property.NameEquals("winRM"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + winRM = WinRMConfiguration.DeserializeWinRMConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("enableVMAgentPlatformUpdates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableVmAgentPlatformUpdates = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetWindowsConfiguration( + provisionVmAgent, + enableAutomaticUpdates, + timeZone, + additionalUnattendContent ?? new ChangeTrackingList(), + patchSettings, + winRM, + enableVmAgentPlatformUpdates, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetWindowsConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetWindowsConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetWindowsConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetWindowsConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.cs new file mode 100644 index 000000000000..6bdc7de86ce9 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsConfiguration.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies Windows operating system settings on the virtual machine. + public partial class ComputeFleetWindowsConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetWindowsConfiguration() + { + AdditionalUnattendContent = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// Indicates whether virtual machine agent should be provisioned on the virtual + /// machine. When this property is not specified in the request body, it is set to + /// true by default. This will ensure that VM Agent is installed on the VM so that + /// extensions can be added to the VM later. + /// + /// + /// Indicates whether Automatic Updates is enabled for the Windows virtual machine. + /// Default value is true. For virtual machine scale sets, this property can be + /// updated and updates will take effect on OS reprovisioning. + /// + /// + /// Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". + /// Possible values can be + /// [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) + /// value from time zones returned by + /// [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + /// + /// + /// Specifies additional base-64 encoded XML formatted information that can be + /// included in the Unattend.xml file, which is used by Windows Setup. + /// + /// [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + /// + /// Specifies the Windows Remote Management listeners. This enables remote Windows + /// PowerShell. + /// + /// + /// Indicates whether VMAgent Platform Updates is enabled for the Windows virtual + /// machine. Default value is false. + /// + /// Keeps track of any properties unknown to the library. + internal ComputeFleetWindowsConfiguration(bool? isVmAgentProvisioned, bool? isAutomaticUpdatesEnabled, string timeZone, IList additionalUnattendContent, ComputeFleetVmGuestPatchSettings patchSettings, WinRMConfiguration winRM, bool? isVmAgentPlatformUpdatesEnabled, IDictionary serializedAdditionalRawData) + { + IsVmAgentProvisioned = isVmAgentProvisioned; + IsAutomaticUpdatesEnabled = isAutomaticUpdatesEnabled; + TimeZone = timeZone; + AdditionalUnattendContent = additionalUnattendContent; + PatchSettings = patchSettings; + WinRM = winRM; + IsVmAgentPlatformUpdatesEnabled = isVmAgentPlatformUpdatesEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Indicates whether virtual machine agent should be provisioned on the virtual + /// machine. When this property is not specified in the request body, it is set to + /// true by default. This will ensure that VM Agent is installed on the VM so that + /// extensions can be added to the VM later. + /// + public bool? IsVmAgentProvisioned { get; set; } + /// + /// Indicates whether Automatic Updates is enabled for the Windows virtual machine. + /// Default value is true. For virtual machine scale sets, this property can be + /// updated and updates will take effect on OS reprovisioning. + /// + public bool? IsAutomaticUpdatesEnabled { get; set; } + /// + /// Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time". + /// Possible values can be + /// [TimeZoneInfo.Id](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) + /// value from time zones returned by + /// [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.getsystemtimezones). + /// + public string TimeZone { get; set; } + /// + /// Specifies additional base-64 encoded XML formatted information that can be + /// included in the Unattend.xml file, which is used by Windows Setup. + /// + public IList AdditionalUnattendContent { get; } + /// [Preview Feature] Specifies settings related to VM Guest Patching on Windows. + public ComputeFleetVmGuestPatchSettings PatchSettings { get; set; } + /// + /// Specifies the Windows Remote Management listeners. This enables remote Windows + /// PowerShell. + /// + internal WinRMConfiguration WinRM { get; set; } + /// The list of Windows Remote Management listeners. + public IList WinRMListeners + { + get + { + if (WinRM is null) + WinRM = new WinRMConfiguration(); + return WinRM.Listeners; + } + } + + /// + /// Indicates whether VMAgent Platform Updates is enabled for the Windows virtual + /// machine. Default value is false. + /// + public bool? IsVmAgentPlatformUpdatesEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsPatchAssessmentMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsPatchAssessmentMode.cs new file mode 100644 index 000000000000..2210891e8e24 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsPatchAssessmentMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the mode of VM Guest patch assessment for the IaaS virtual machine. + public readonly partial struct ComputeFleetWindowsPatchAssessmentMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetWindowsPatchAssessmentMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ImageDefaultValue = "ImageDefault"; + private const string AutomaticByPlatformValue = "AutomaticByPlatform"; + + /// You control the timing of patch assessments on a virtual machine. + public static ComputeFleetWindowsPatchAssessmentMode ImageDefault { get; } = new ComputeFleetWindowsPatchAssessmentMode(ImageDefaultValue); + /// The platform will trigger periodic patch assessments. The property provisionVMAgent must be true. + public static ComputeFleetWindowsPatchAssessmentMode AutomaticByPlatform { get; } = new ComputeFleetWindowsPatchAssessmentMode(AutomaticByPlatformValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetWindowsPatchAssessmentMode left, ComputeFleetWindowsPatchAssessmentMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetWindowsPatchAssessmentMode left, ComputeFleetWindowsPatchAssessmentMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetWindowsPatchAssessmentMode(string value) => new ComputeFleetWindowsPatchAssessmentMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetWindowsPatchAssessmentMode other && Equals(other); + /// + public bool Equals(ComputeFleetWindowsPatchAssessmentMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting.cs new file mode 100644 index 000000000000..aad0e344f814 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Specifies the reboot setting for all AutomaticByPlatform patch installation operations. + public readonly partial struct ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string IfRequiredValue = "IfRequired"; + private const string NeverValue = "Never"; + private const string AlwaysValue = "Always"; + + /// Unknown Reboot setting. + public static ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Unknown { get; } = new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(UnknownValue); + /// IfRequired Reboot setting. + public static ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting IfRequired { get; } = new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(IfRequiredValue); + /// Never Reboot setting. + public static ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Never { get; } = new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(NeverValue); + /// Always Reboot setting. + public static ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting Always { get; } = new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(AlwaysValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting left, ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting left, ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(string value) => new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting other && Equals(other); + /// + public bool Equals(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs new file mode 100644 index 000000000000..6f3e5079e52e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(RebootSetting)) + { + writer.WritePropertyName("rebootSetting"u8); + writer.WriteStringValue(RebootSetting.Value.ToString()); + } + if (Optional.IsDefined(IsBypassPlatformSafetyChecksOnUserScheduleEnabled)) + { + writer.WritePropertyName("bypassPlatformSafetyChecksOnUserSchedule"u8); + writer.WriteBooleanValue(IsBypassPlatformSafetyChecksOnUserScheduleEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(document.RootElement, options); + } + + internal static ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings DeserializeComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting? rebootSetting = default; + bool? bypassPlatformSafetyChecksOnUserSchedule = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("rebootSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rebootSetting = new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting(property.Value.GetString()); + continue; + } + if (property.NameEquals("bypassPlatformSafetyChecksOnUserSchedule"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + bypassPlatformSafetyChecksOnUserSchedule = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(rebootSetting, bypassPlatformSafetyChecksOnUserSchedule, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.cs new file mode 100644 index 000000000000..4f801617b5ea --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies additional settings to be applied when patch mode AutomaticByPlatform + /// is selected in Windows patch settings. + /// + public partial class ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings() + { + } + + /// Initializes a new instance of . + /// + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// + /// Enables customer to schedule patching without accidental upgrades. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetWindowsVmGuestPatchAutomaticByPlatformSettings(ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting? rebootSetting, bool? isBypassPlatformSafetyChecksOnUserScheduleEnabled, IDictionary serializedAdditionalRawData) + { + RebootSetting = rebootSetting; + IsBypassPlatformSafetyChecksOnUserScheduleEnabled = isBypassPlatformSafetyChecksOnUserScheduleEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Specifies the reboot setting for all AutomaticByPlatform patch installation + /// operations. + /// + public ComputeFleetWindowsVmGuestPatchAutomaticByPlatformRebootSetting? RebootSetting { get; set; } + /// Enables customer to schedule patching without accidental upgrades. + public bool? IsBypassPlatformSafetyChecksOnUserScheduleEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchMode.cs new file mode 100644 index 000000000000..c83947c933ab --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetWindowsVmGuestPatchMode.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the mode of VM Guest Patching to IaaS virtual machine or virtual + /// machines associated to virtual machine scale set with OrchestrationMode as + /// Flexible. + /// + public readonly partial struct ComputeFleetWindowsVmGuestPatchMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetWindowsVmGuestPatchMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ManualValue = "Manual"; + private const string AutomaticByOSValue = "AutomaticByOS"; + private const string AutomaticByPlatformValue = "AutomaticByPlatform"; + + /// + /// You control the application of patches to a virtual machine. + /// You do this by applying patches manually inside the VM. In this mode, + /// automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates + /// must be false + /// + public static ComputeFleetWindowsVmGuestPatchMode Manual { get; } = new ComputeFleetWindowsVmGuestPatchMode(ManualValue); + /// + /// The virtual machine will automatically be updated by the OS. + /// The property WindowsConfiguration.enableAutomaticUpdates must be true. + /// + public static ComputeFleetWindowsVmGuestPatchMode AutomaticByOS { get; } = new ComputeFleetWindowsVmGuestPatchMode(AutomaticByOSValue); + /// + /// The virtual machine will automatically updated by the platform. The properties + /// provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true. + /// + public static ComputeFleetWindowsVmGuestPatchMode AutomaticByPlatform { get; } = new ComputeFleetWindowsVmGuestPatchMode(AutomaticByPlatformValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetWindowsVmGuestPatchMode left, ComputeFleetWindowsVmGuestPatchMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetWindowsVmGuestPatchMode left, ComputeFleetWindowsVmGuestPatchMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ComputeFleetWindowsVmGuestPatchMode(string value) => new ComputeFleetWindowsVmGuestPatchMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetWindowsVmGuestPatchMode other && Equals(other); + /// + public bool Equals(ComputeFleetWindowsVmGuestPatchMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.cs new file mode 100644 index 000000000000..dde91baff145 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The response of a Fleet list operation. + internal partial class FleetListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The Fleet items on this page. + /// is null. + internal FleetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Fleet items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetListResult() + { + } + + /// The Fleet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ProxyAgentExecuteMode.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ProxyAgentExecuteMode.cs new file mode 100644 index 000000000000..45e67750c10c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ProxyAgentExecuteMode.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies the mode that ProxyAgent will execute on if the feature is enabled. + /// ProxyAgent will start to audit or monitor but not enforce access control over + /// requests to host endpoints in Audit mode, while in Enforce mode it will enforce + /// access control. The default value is Enforce mode. + /// + public readonly partial struct ProxyAgentExecuteMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProxyAgentExecuteMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AuditValue = "Audit"; + private const string EnforceValue = "Enforce"; + + /// Audit Mode. + public static ProxyAgentExecuteMode Audit { get; } = new ProxyAgentExecuteMode(AuditValue); + /// Enforce Mode. + public static ProxyAgentExecuteMode Enforce { get; } = new ProxyAgentExecuteMode(EnforceValue); + /// Determines if two values are the same. + public static bool operator ==(ProxyAgentExecuteMode left, ProxyAgentExecuteMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProxyAgentExecuteMode left, ProxyAgentExecuteMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ProxyAgentExecuteMode(string value) => new ProxyAgentExecuteMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProxyAgentExecuteMode other && Equals(other); + /// + public bool Equals(ProxyAgentExecuteMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityAllocationStrategy.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityAllocationStrategy.cs new file mode 100644 index 000000000000..49694b9d5760 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityAllocationStrategy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Regular VM Allocation strategy types for Compute Fleet. + public readonly partial struct RegularPriorityAllocationStrategy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RegularPriorityAllocationStrategy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LowestPriceValue = "LowestPrice"; + private const string PrioritizedValue = "Prioritized"; + + /// Default. VM sizes distribution will be determined to optimize for price. + public static RegularPriorityAllocationStrategy LowestPrice { get; } = new RegularPriorityAllocationStrategy(LowestPriceValue); + /// VM sizes distribution will be determined to optimize for the 'priority' as specified for each vm size. + public static RegularPriorityAllocationStrategy Prioritized { get; } = new RegularPriorityAllocationStrategy(PrioritizedValue); + /// Determines if two values are the same. + public static bool operator ==(RegularPriorityAllocationStrategy left, RegularPriorityAllocationStrategy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RegularPriorityAllocationStrategy left, RegularPriorityAllocationStrategy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RegularPriorityAllocationStrategy(string value) => new RegularPriorityAllocationStrategy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RegularPriorityAllocationStrategy other && Equals(other); + /// + public bool Equals(RegularPriorityAllocationStrategy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs new file mode 100644 index 000000000000..2db980f8d3f7 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class RegularPriorityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegularPriorityProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteNumberValue(Capacity.Value); + } + if (Optional.IsDefined(MinCapacity)) + { + writer.WritePropertyName("minCapacity"u8); + writer.WriteNumberValue(MinCapacity.Value); + } + if (Optional.IsDefined(AllocationStrategy)) + { + writer.WritePropertyName("allocationStrategy"u8); + writer.WriteStringValue(AllocationStrategy.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RegularPriorityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegularPriorityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRegularPriorityProfile(document.RootElement, options); + } + + internal static RegularPriorityProfile DeserializeRegularPriorityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? capacity = default; + int? minCapacity = default; + RegularPriorityAllocationStrategy? allocationStrategy = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minCapacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("allocationStrategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocationStrategy = new RegularPriorityAllocationStrategy(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RegularPriorityProfile(capacity, minCapacity, allocationStrategy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RegularPriorityProfile)} does not support writing '{options.Format}' format."); + } + } + + RegularPriorityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRegularPriorityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RegularPriorityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.cs new file mode 100644 index 000000000000..a910113c1fe1 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/RegularPriorityProfile.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Configuration Options for Regular instances in Compute Fleet. + public partial class RegularPriorityProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RegularPriorityProfile() + { + } + + /// Initializes a new instance of . + /// Total capacity to achieve. It is currently in terms of number of VMs. + /// Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. + /// Allocation strategy to follow when determining the VM sizes distribution for Regular VMs. + /// Keeps track of any properties unknown to the library. + internal RegularPriorityProfile(int? capacity, int? minCapacity, RegularPriorityAllocationStrategy? allocationStrategy, IDictionary serializedAdditionalRawData) + { + Capacity = capacity; + MinCapacity = minCapacity; + AllocationStrategy = allocationStrategy; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Total capacity to achieve. It is currently in terms of number of VMs. + public int? Capacity { get; set; } + /// Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. + public int? MinCapacity { get; set; } + /// Allocation strategy to follow when determining the VM sizes distribution for Regular VMs. + public RegularPriorityAllocationStrategy? AllocationStrategy { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotAllocationStrategy.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotAllocationStrategy.cs new file mode 100644 index 000000000000..2721fa92c10f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotAllocationStrategy.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Spot allocation strategy types for Compute Fleet. + public readonly partial struct SpotAllocationStrategy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SpotAllocationStrategy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PriceCapacityOptimizedValue = "PriceCapacityOptimized"; + private const string LowestPriceValue = "LowestPrice"; + private const string CapacityOptimizedValue = "CapacityOptimized"; + + /// Default. VM sizes distribution will be determined to optimize for both price and capacity. + public static SpotAllocationStrategy PriceCapacityOptimized { get; } = new SpotAllocationStrategy(PriceCapacityOptimizedValue); + /// VM sizes distribution will be determined to optimize for price. Note: Capacity will still be considered here but will be given much less weight. + public static SpotAllocationStrategy LowestPrice { get; } = new SpotAllocationStrategy(LowestPriceValue); + /// VM sizes distribution will be determined to optimize for capacity. + public static SpotAllocationStrategy CapacityOptimized { get; } = new SpotAllocationStrategy(CapacityOptimizedValue); + /// Determines if two values are the same. + public static bool operator ==(SpotAllocationStrategy left, SpotAllocationStrategy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SpotAllocationStrategy left, SpotAllocationStrategy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SpotAllocationStrategy(string value) => new SpotAllocationStrategy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SpotAllocationStrategy other && Equals(other); + /// + public bool Equals(SpotAllocationStrategy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs new file mode 100644 index 000000000000..b9fa2a9b128a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.Serialization.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class SpotPriorityProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpotPriorityProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteNumberValue(Capacity.Value); + } + if (Optional.IsDefined(MinCapacity)) + { + writer.WritePropertyName("minCapacity"u8); + writer.WriteNumberValue(MinCapacity.Value); + } + if (Optional.IsDefined(MaxPricePerVm)) + { + writer.WritePropertyName("maxPricePerVM"u8); + writer.WriteNumberValue(MaxPricePerVm.Value); + } + if (Optional.IsDefined(EvictionPolicy)) + { + writer.WritePropertyName("evictionPolicy"u8); + writer.WriteStringValue(EvictionPolicy.Value.ToString()); + } + if (Optional.IsDefined(AllocationStrategy)) + { + writer.WritePropertyName("allocationStrategy"u8); + writer.WriteStringValue(AllocationStrategy.Value.ToString()); + } + if (Optional.IsDefined(IsMaintainEnabled)) + { + writer.WritePropertyName("maintain"u8); + writer.WriteBooleanValue(IsMaintainEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SpotPriorityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpotPriorityProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpotPriorityProfile(document.RootElement, options); + } + + internal static SpotPriorityProfile DeserializeSpotPriorityProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? capacity = default; + int? minCapacity = default; + float? maxPricePerVm = default; + ComputeFleetEvictionPolicy? evictionPolicy = default; + SpotAllocationStrategy? allocationStrategy = default; + bool? maintain = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("minCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minCapacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maxPricePerVM"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxPricePerVm = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("evictionPolicy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + evictionPolicy = new ComputeFleetEvictionPolicy(property.Value.GetString()); + continue; + } + if (property.NameEquals("allocationStrategy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allocationStrategy = new SpotAllocationStrategy(property.Value.GetString()); + continue; + } + if (property.NameEquals("maintain"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maintain = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpotPriorityProfile( + capacity, + minCapacity, + maxPricePerVm, + evictionPolicy, + allocationStrategy, + maintain, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpotPriorityProfile)} does not support writing '{options.Format}' format."); + } + } + + SpotPriorityProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpotPriorityProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpotPriorityProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.cs new file mode 100644 index 000000000000..2689b8414b50 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/SpotPriorityProfile.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Configuration Options for Spot instances in Compute Fleet. + public partial class SpotPriorityProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public SpotPriorityProfile() + { + } + + /// Initializes a new instance of . + /// Total capacity to achieve. It is currently in terms of number of VMs. + /// Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. + /// Price per hour of each Spot VM will never exceed this. + /// Eviction Policy to follow when evicting Spot VMs. + /// Allocation strategy to follow when determining the VM sizes distribution for Spot VMs. + /// + /// Flag to enable/disable continuous goal seeking for the desired capacity and restoration of evicted Spot VMs. + /// If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs (if VMs are evicted deleted) + /// or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate due to capacity constraint) in order to achieve the desired capacity. + /// Maintain is enabled by default. + /// + /// Keeps track of any properties unknown to the library. + internal SpotPriorityProfile(int? capacity, int? minCapacity, float? maxPricePerVm, ComputeFleetEvictionPolicy? evictionPolicy, SpotAllocationStrategy? allocationStrategy, bool? isMaintainEnabled, IDictionary serializedAdditionalRawData) + { + Capacity = capacity; + MinCapacity = minCapacity; + MaxPricePerVm = maxPricePerVm; + EvictionPolicy = evictionPolicy; + AllocationStrategy = allocationStrategy; + IsMaintainEnabled = isMaintainEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Total capacity to achieve. It is currently in terms of number of VMs. + public int? Capacity { get; set; } + /// Minimum capacity to achieve which cannot be updated. If we will not be able to "guarantee" minimum capacity, we will reject the request in the sync path itself. + public int? MinCapacity { get; set; } + /// Price per hour of each Spot VM will never exceed this. + public float? MaxPricePerVm { get; set; } + /// Eviction Policy to follow when evicting Spot VMs. + public ComputeFleetEvictionPolicy? EvictionPolicy { get; set; } + /// Allocation strategy to follow when determining the VM sizes distribution for Spot VMs. + public SpotAllocationStrategy? AllocationStrategy { get; set; } + /// + /// Flag to enable/disable continuous goal seeking for the desired capacity and restoration of evicted Spot VMs. + /// If maintain is enabled, AzureFleetRP will use all VM sizes in vmSizesProfile to create new VMs (if VMs are evicted deleted) + /// or update existing VMs with new VM sizes (if VMs are evicted deallocated or failed to allocate due to capacity constraint) in order to achieve the desired capacity. + /// Maintain is enabled by default. + /// + public bool? IsMaintainEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs new file mode 100644 index 000000000000..33c194673c99 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + internal partial class VirtualMachineScaleSetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VirtualMachineScaleSetListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + VirtualMachineScaleSetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VirtualMachineScaleSetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVirtualMachineScaleSetListResult(document.RootElement, options); + } + + internal static VirtualMachineScaleSetListResult DeserializeVirtualMachineScaleSetListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetVmss.DeserializeComputeFleetVmss(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VirtualMachineScaleSetListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VirtualMachineScaleSetListResult)} does not support writing '{options.Format}' format."); + } + } + + VirtualMachineScaleSetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeVirtualMachineScaleSetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VirtualMachineScaleSetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.cs new file mode 100644 index 000000000000..4e967da60061 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/VirtualMachineScaleSetListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The response of a VirtualMachineScaleSet list operation. + internal partial class VirtualMachineScaleSetListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The VirtualMachineScaleSet items on this page. + /// is null. + internal VirtualMachineScaleSetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The VirtualMachineScaleSet items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal VirtualMachineScaleSetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VirtualMachineScaleSetListResult() + { + } + + /// The VirtualMachineScaleSet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.cs new file mode 100644 index 000000000000..1cc6c654610a --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// Describes Windows Remote Management configuration of the VM. + internal partial class WinRMConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public WinRMConfiguration() + { + Listeners = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of Windows Remote Management listeners. + /// Keeps track of any properties unknown to the library. + internal WinRMConfiguration(IList listeners, IDictionary serializedAdditionalRawData) + { + Listeners = listeners; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of Windows Remote Management listeners. + public IList Listeners { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.Serialization.cs new file mode 100644 index 000000000000..b4b958c1bef3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + public partial class WindowsSetupAdditionalInformation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WindowsSetupAdditionalInformation)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PassName)) + { + writer.WritePropertyName("passName"u8); + writer.WriteStringValue(PassName.Value.ToString()); + } + if (Optional.IsDefined(ComponentName)) + { + writer.WritePropertyName("componentName"u8); + writer.WriteStringValue(ComponentName.Value.ToString()); + } + if (Optional.IsDefined(SettingName)) + { + writer.WritePropertyName("settingName"u8); + writer.WriteStringValue(SettingName.Value.ToString()); + } + if (Optional.IsDefined(Content)) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + WindowsSetupAdditionalInformation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WindowsSetupAdditionalInformation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWindowsSetupAdditionalInformation(document.RootElement, options); + } + + internal static WindowsSetupAdditionalInformation DeserializeWindowsSetupAdditionalInformation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WindowsSetupAdditionalInformationPassName? passName = default; + WindowsSetupAdditionalInformationComponentName? componentName = default; + AdditionalInformationSettingName? settingName = default; + string content = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("passName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + passName = new WindowsSetupAdditionalInformationPassName(property.Value.GetString()); + continue; + } + if (property.NameEquals("componentName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + componentName = new WindowsSetupAdditionalInformationComponentName(property.Value.GetString()); + continue; + } + if (property.NameEquals("settingName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + settingName = new AdditionalInformationSettingName(property.Value.GetString()); + continue; + } + if (property.NameEquals("content"u8)) + { + content = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WindowsSetupAdditionalInformation(passName, componentName, settingName, content, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WindowsSetupAdditionalInformation)} does not support writing '{options.Format}' format."); + } + } + + WindowsSetupAdditionalInformation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWindowsSetupAdditionalInformation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WindowsSetupAdditionalInformation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.cs new file mode 100644 index 000000000000..0d024a1b04cb --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformation.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// Specifies additional XML formatted information that can be included in the + /// Unattend.xml file, which is used by Windows Setup. Contents are defined by + /// setting name, component name, and the pass in which the content is applied. + /// + public partial class WindowsSetupAdditionalInformation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public WindowsSetupAdditionalInformation() + { + } + + /// Initializes a new instance of . + /// The pass name. Currently, the only allowable value is OobeSystem. + /// + /// The component name. Currently, the only allowable value is + /// Microsoft-Windows-Shell-Setup. + /// + /// + /// Specifies the name of the setting to which the content applies. Possible values + /// are: FirstLogonCommands and AutoLogon. + /// + /// + /// Specifies the XML formatted content that is added to the unattend.xml file for + /// the specified path and component. The XML must be less than 4KB and must + /// include the root element for the setting or feature that is being inserted. + /// + /// Keeps track of any properties unknown to the library. + internal WindowsSetupAdditionalInformation(WindowsSetupAdditionalInformationPassName? passName, WindowsSetupAdditionalInformationComponentName? componentName, AdditionalInformationSettingName? settingName, string content, IDictionary serializedAdditionalRawData) + { + PassName = passName; + ComponentName = componentName; + SettingName = settingName; + Content = content; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The pass name. Currently, the only allowable value is OobeSystem. + public WindowsSetupAdditionalInformationPassName? PassName { get; set; } + /// + /// The component name. Currently, the only allowable value is + /// Microsoft-Windows-Shell-Setup. + /// + public WindowsSetupAdditionalInformationComponentName? ComponentName { get; set; } + /// + /// Specifies the name of the setting to which the content applies. Possible values + /// are: FirstLogonCommands and AutoLogon. + /// + public AdditionalInformationSettingName? SettingName { get; set; } + /// + /// Specifies the XML formatted content that is added to the unattend.xml file for + /// the specified path and component. The XML must be less than 4KB and must + /// include the root element for the setting or feature that is being inserted. + /// + public string Content { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationComponentName.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationComponentName.cs new file mode 100644 index 000000000000..46c35370f73f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationComponentName.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The WindowsSetupAdditionalInformation_componentName. + public readonly partial struct WindowsSetupAdditionalInformationComponentName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WindowsSetupAdditionalInformationComponentName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MicrosoftWindowsShellSetupValue = "Microsoft-Windows-Shell-Setup"; + + /// Microsoft-Windows-Shell-Setup. + public static WindowsSetupAdditionalInformationComponentName MicrosoftWindowsShellSetup { get; } = new WindowsSetupAdditionalInformationComponentName(MicrosoftWindowsShellSetupValue); + /// Determines if two values are the same. + public static bool operator ==(WindowsSetupAdditionalInformationComponentName left, WindowsSetupAdditionalInformationComponentName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WindowsSetupAdditionalInformationComponentName left, WindowsSetupAdditionalInformationComponentName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator WindowsSetupAdditionalInformationComponentName(string value) => new WindowsSetupAdditionalInformationComponentName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WindowsSetupAdditionalInformationComponentName other && Equals(other); + /// + public bool Equals(WindowsSetupAdditionalInformationComponentName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationPassName.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationPassName.cs new file mode 100644 index 000000000000..e7b5fa1d8fca --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WindowsSetupAdditionalInformationPassName.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// The WindowsSetupAdditionalInformation_passName. + public readonly partial struct WindowsSetupAdditionalInformationPassName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WindowsSetupAdditionalInformationPassName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OobeSystemValue = "OobeSystem"; + + /// OobeSystem. + public static WindowsSetupAdditionalInformationPassName OobeSystem { get; } = new WindowsSetupAdditionalInformationPassName(OobeSystemValue); + /// Determines if two values are the same. + public static bool operator ==(WindowsSetupAdditionalInformationPassName left, WindowsSetupAdditionalInformationPassName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WindowsSetupAdditionalInformationPassName left, WindowsSetupAdditionalInformationPassName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator WindowsSetupAdditionalInformationPassName(string value) => new WindowsSetupAdditionalInformationPassName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WindowsSetupAdditionalInformationPassName other && Equals(other); + /// + public bool Equals(WindowsSetupAdditionalInformationPassName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ProviderConstants.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..89dbf6abd991 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/RestOperations/FleetsRestOperations.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/RestOperations/FleetsRestOperations.cs new file mode 100644 index 000000000000..497e8c9acbcd --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/RestOperations/FleetsRestOperations.cs @@ -0,0 +1,901 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ComputeFleet.Models; + +namespace Azure.ResourceManager.ComputeFleet +{ + internal partial class FleetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// The to use. + /// The API version to use for this operation. + /// or is null. + public FleetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ComputeFleetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ComputeFleetData.DeserializeComputeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ComputeFleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ComputeFleetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ComputeFleetData.DeserializeComputeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ComputeFleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fleetName, ComputeFleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Compute Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Fleet resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Fleet resources by resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Fleet resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Fleet resources by subscription ID. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListVirtualMachineScaleSetsRequestUri(string subscriptionId, string resourceGroupName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualMachineScaleSets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListVirtualMachineScaleSetsRequest(string subscriptionId, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.AzureFleet/fleets/", false); + uri.AppendPath(name, true); + uri.AppendPath("/virtualMachineScaleSets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List VirtualMachineScaleSet resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListVirtualMachineScaleSetsAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateListVirtualMachineScaleSetsRequest(subscriptionId, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineScaleSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualMachineScaleSetListResult.DeserializeVirtualMachineScaleSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List VirtualMachineScaleSet resources by Fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListVirtualMachineScaleSets(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateListVirtualMachineScaleSetsRequest(subscriptionId, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineScaleSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualMachineScaleSetListResult.DeserializeVirtualMachineScaleSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Fleet resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Fleet resources by resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Fleet resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Fleet resources by subscription ID. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListVirtualMachineScaleSetsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListVirtualMachineScaleSetsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List VirtualMachineScaleSet resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListVirtualMachineScaleSetsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateListVirtualMachineScaleSetsNextPageRequest(nextLink, subscriptionId, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineScaleSetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualMachineScaleSetListResult.DeserializeVirtualMachineScaleSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List VirtualMachineScaleSet resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListVirtualMachineScaleSetsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateListVirtualMachineScaleSetsNextPageRequest(nextLink, subscriptionId, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineScaleSetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualMachineScaleSetListResult.DeserializeVirtualMachineScaleSetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Properties/AssemblyInfo.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..3c2cf9f44386 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.AzureFleet")] + +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] +[assembly: InternalsVisibleTo("Azure.ResourceManager.ComputeFleet.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/autorest.md.bak b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/autorest.md.bak new file mode 100644 index 000000000000..7ff2afdfd1d3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/autorest.md.bak @@ -0,0 +1,199 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +``` yaml +azure-arm: true +csharp: true +library-name: ComputeFleet +namespace: Azure.ResourceManager.ComputeFleet +require: https://github.com/Azure/azure-rest-api-specs/blob/ad73e424df6df56b4cd206fcba7149891b5b6660/specification/azurefleet/resource-manager/readme.md +#tag: package-preview-2024-05 +output-folder: $(this-folder)/Generated +clear-output-folder: true +sample-gen: + output-folder: $(this-folder)/../samples/Generated + clear-output-folder: true + skipped-operations: + - Fleets_Update + - Fleets_CreateOrUpdate +skip-csproj: true +modelerfour: + flatten-payloads: false + flatten-models: false +use-model-reader-writer: true + +#mgmt-debug: +# show-serialized-names: true + +format-by-name-rules: + 'tenantId': 'uuid' + 'ETag': 'etag' + 'location': 'azure-location' + '*Uri': 'Uri' + '*Uris': 'Uri' + +acronym-mapping: + CPU: Cpu + CPUs: Cpus + Os: OS + Ip: IP + Ips: IPs|ips + ID: Id + IDs: Ids + VM: Vm + VMs: Vms + Vmos: VmOS + VMScaleSet: VmScaleSet + DNS: Dns + VPN: Vpn + NAT: Nat + WAN: Wan + Ipv4: IPv4|ipv4 + Ipv6: IPv6|ipv6 + Ipsec: IPsec|ipsec + SSO: Sso + URI: Uri + Etag: ETag|etag + +rename-mapping: + Fleet: ComputeFleet + FleetProperties: ComputeFleetProperties + FleetProperties.timeCreated: CreatedOn + AdditionalUnattendContent: WindowsSetupAdditionalInformation + AdditionalUnattendContentComponentName: WindowsSetupAdditionalInformationComponentName + AdditionalUnattendContentPassName: WindowsSetupAdditionalInformationPassName + ApiErrorBase: ComputeFleetApiErrorInfo + BaseVirtualMachineProfile: ComputeFleetVmProfile + BaseVirtualMachineProfile.timeCreated: CreatedOn + BootDiagnostics.enabled: IsEnabled + DeleteOptions: ComputeFleetVmDeleteOptions + DiskControllerTypes.NVMe: Nvme + LinuxConfiguration.disablePasswordAuthentication: IsPasswordAuthenticationDisabled + LinuxConfiguration.provisionVMAgent: IsVmAgentProvisioned + LinuxConfiguration.enableVMAgentPlatformUpdates: IsVmAgentPlatformUpdatesEnabled + LinuxVMGuestPatchAutomaticByPlatformSettings.bypassPlatformSafetyChecksOnUserSchedule: IsBypassPlatformSafetyChecksOnUserScheduleEnabled + Mode: ProxyAgentExecuteMode + OSImageNotificationProfile.enable: IsEnabled + PatchSettings: ComputeFleetVmGuestPatchSettings + PatchSettings.enableHotpatching: IsHotPatchingEnabled + ProxyAgentSettings.enabled: IsEnabled + SecurityEncryptionTypes.NonPersistedTPM: NonPersistedTpm + SecurityProfile.encryptionAtHost: IsEncryptionAtHostEnabled + SettingNames: AdditionalInformationSettingNames + SpotPriorityProfile.maintain: IsMaintainEnabled + StorageAccountTypes.Standard_LRS: StandardLrs + StorageAccountTypes.Premium_LRS: PremiumLrs + StorageAccountTypes.StandardSSD_LRS: StandardSsdLrd + StorageAccountTypes.UltraSSD_LRS: UltraSsdLrs + StorageAccountTypes.Premium_ZRS: PremiumZrs + StorageAccountTypes.StandardSSD_ZRS: StandardSsdZrs + TerminateNotificationProfile.enable: IsEnabled + UefiSettings.secureBootEnabled: IsSecureBootEnabled + UefiSettings.vTpmEnabled: IsVTpmEnabled + VirtualMachineScaleSet: ComputeFleetVmss + VirtualMachineScaleSetDataDisk: ComputeFleetVmssDataDisk + VirtualMachineScaleSetDataDisk.writeAcceleratorEnabled: IsWriteAcceleratorEnabled + VirtualMachineScaleSetDataDisk.diskIOPSReadWrite: DiskIopsReadWrite + VirtualMachineScaleSetDataDisk.diskMBpsReadWrite: DiskMbpsReadWrite + VirtualMachineScaleSetExtension: ComputeFleetVmssExtension + VirtualMachineScaleSetExtension.type: ExtensionType + VirtualMachineScaleSetExtensionProfile: ComputeFleetVmssExtensionProfile + VirtualMachineScaleSetExtensionProperties: ComputeFleetVmssExtensionProperties + VirtualMachineScaleSetExtensionProperties.type: ExtensionType + VirtualMachineScaleSetExtensionProperties.autoUpgradeMinorVersion: ShouldAutoUpgradeMinorVersion + VirtualMachineScaleSetExtensionProperties.enableAutomaticUpgrade: IsAutomaticUpgradeEnabled + VirtualMachineScaleSetExtensionProperties.suppressFailures: IsSuppressFailuresEnabled + VirtualMachineScaleSetHardwareProfile: ComputeFleetVmssHardwareProfile + VirtualMachineScaleSetIPConfiguration: ComputeFleetVmssIPConfiguration + VirtualMachineScaleSetIPConfigurationProperties: ComputeFleetVmssIPConfigurationProperties + VirtualMachineScaleSetIPConfigurationProperties.primary: IsPrimary + VirtualMachineScaleSetIpTag: ComputeFleetVmssIPTag + VirtualMachineScaleSetManagedDiskParameters: ComputeFleetVmssManagedDisk + VirtualMachineScaleSetNetworkConfiguration: ComputeFleetVmssNetworkConfiguration + VirtualMachineScaleSetNetworkConfigurationDnsSettings: ComputeFleetVmssNetworkDnsSettings + VirtualMachineScaleSetNetworkConfigurationProperties: ComputeFleetVmssNetworkConfigurationProperties + VirtualMachineScaleSetNetworkConfigurationProperties.primary: IsPrimary + VirtualMachineScaleSetNetworkConfigurationProperties.enableAcceleratedNetworking: IsAcceleratedNetworkingEnabled + VirtualMachineScaleSetNetworkConfigurationProperties.disableTcpStateTracking: IsTcpStateTrackingDisabled + VirtualMachineScaleSetNetworkConfigurationProperties.enableFpga: IsFpgaEnabled + VirtualMachineScaleSetNetworkConfigurationProperties.enableIPForwarding: IsIPForwardingEnabled + VirtualMachineScaleSetNetworkProfile: ComputeFleetVmssNetworkProfile + VirtualMachineScaleSetOSDisk: ComputeFleetVmssOSDisk + VirtualMachineScaleSetOSDisk.writeAcceleratorEnabled: IsWriteAcceleratorEnabled + VirtualMachineScaleSetOSProfile: ComputeFleetVmssOSProfile + VirtualMachineScaleSetOSProfile.allowExtensionOperations: AreExtensionOperationsAllowed + VirtualMachineScaleSetOSProfile.requireGuestProvisionSignal: IsGuestProvisionSignalRequired + VirtualMachineScaleSetPublicIPAddressConfiguration: ComputeFleetVmssPublicIPAddressConfiguration + VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings: ComputeFleetVmssPublicIPAddressDnsSettings + VirtualMachineScaleSetPublicIPAddressConfigurationProperties: ComputeFleetVmssPublicIPAddressConfigurationProperties + VirtualMachineScaleSetStorageProfile: ComputeFleetVmssStorageProfile + VMGalleryApplication.treatFailureAsDeploymentFailure: IsTreatFailureAsDeploymentFailureEnabled + VMGalleryApplication.enableAutomaticUpgrade: IsAutomaticUpgradeEnabled + WindowsConfiguration.provisionVMAgent: IsVmAgentProvisioned + WindowsConfiguration.enableAutomaticUpdates: IsAutomaticUpdatesEnabled + WindowsConfiguration.enableVMAgentPlatformUpdates: IsVmAgentPlatformUpdatesEnabled + WindowsVMGuestPatchAutomaticByPlatformSettings.bypassPlatformSafetyChecksOnUserSchedule: IsBypassPlatformSafetyChecksOnUserScheduleEnabled + +prepend-rp-prefix: + - ApiError + - ApplicationProfile + - BootDiagnostics + - CachingTypes + - ComputeProfile + - DiagnosticsProfile + - DiffDiskOptions + - DiffDiskPlacement + - DiffDiskSettings + - DiskControllerTypes + - DiskCreateOptionTypes + - DiskDeleteOptionTypes + - DomainNameLabelScopeTypes + - EncryptionIdentity + - EvictionPolicy + - ImageReference + - InnerError + - IPVersion + - KeyVaultSecretReference + - LinuxConfiguration + - LinuxPatchAssessmentMode + - LinuxPatchSettings + - LinuxVMGuestPatchAutomaticByPlatformRebootSetting + - LinuxVMGuestPatchAutomaticByPlatformSettings + - LinuxVMGuestPatchMode + - NetworkApiVersion + - NetworkInterfaceAuxiliaryMode + - NetworkInterfaceAuxiliarySku + - OperatingSystemTypes + - OSImageNotificationProfile + - ProtocolTypes + - ProvisioningState + - ProxyAgentSettings + - PublicIPAddressSku + - PublicIPAddressSkuName + - PublicIPAddressSkuTier + - ScheduledEventsProfile + - SecurityEncryptionTypes + - SecurityPostureReference + - SecurityProfile + - SecurityTypes + - SshConfiguration + - SshPublicKey + - StorageAccountTypes + - TerminateNotificationProfile + - UefiSettings + - VaultCertificate + - VaultSecretGroup + - VirtualHardDisk + - VMDiskSecurityProfile + - VMGalleryApplication + - VmSizeProfile + - VMSizeProperties + - WindowsConfiguration + - WindowsPatchAssessmentMode + - WindowsVMGuestPatchAutomaticByPlatformRebootSetting + - WindowsVMGuestPatchAutomaticByPlatformSettings + - WindowsVMGuestPatchMode + - WinRMListener + +``` \ No newline at end of file diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Azure.ResourceManager.ComputeFleet.Tests.csproj b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Azure.ResourceManager.ComputeFleet.Tests.csproj new file mode 100644 index 000000000000..9209a063ed2b --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Azure.ResourceManager.ComputeFleet.Tests.csproj @@ -0,0 +1,5 @@ + + + + + diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestBase.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestBase.cs new file mode 100644 index 000000000000..bdaea3c85835 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestBase.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.ComputeFleet.Tests +{ + public class ComputeFleetManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected ComputeFleetManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected ComputeFleetManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestEnvironment.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestEnvironment.cs new file mode 100644 index 000000000000..60efcacf330e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/ComputeFleetManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.ComputeFleet.Tests +{ + public class ComputeFleetManagementTestEnvironment : TestEnvironment + { + } +} \ No newline at end of file diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml new file mode 100644 index 000000000000..b5e602272d0c --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification/azurefleet/AzureFleet.Management +commit: c0a15f4623eb11f745f890089f3d46d8a538524f +repo: Azure/azure-rest-api-specs \ No newline at end of file diff --git a/sdk/computefleet/ci.mgmt.yml b/sdk/computefleet/ci.mgmt.yml new file mode 100644 index 000000000000..de169e18c599 --- /dev/null +++ b/sdk/computefleet/ci.mgmt.yml @@ -0,0 +1,23 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/computefleet/ci.mgmt.yml + - sdk/computefleet/Azure.ResourceManager.ComputeFleet/ + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: computefleet + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.ComputeFleet + safeName: AzureResourceManagerComputeFleet diff --git a/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryKeyVaultSecret.Serialization.cs b/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryKeyVaultSecret.Serialization.cs index 18e4ef20c2e6..b71d6428aca4 100644 --- a/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryKeyVaultSecret.Serialization.cs +++ b/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryKeyVaultSecret.Serialization.cs @@ -35,7 +35,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } DataFactoryLinkedServiceReference? store = default; DataFactoryElement? secretName = default; - Optional> secretVersion = default; + DataFactoryElement? secretVersion = default; string? type = default; foreach (var property in element.EnumerateObject()) { @@ -64,7 +64,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) continue; } } - return new DataFactoryKeyVaultSecret(type, store, secretName, secretVersion.Value); + return new DataFactoryKeyVaultSecret(type, store, secretName, secretVersion); } internal partial class DataFactoryKeyVaultSecretConverter : JsonConverter diff --git a/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryLinkedServiceReference.Serialization.cs b/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryLinkedServiceReference.Serialization.cs index 76724f0c94cf..6eb043516847 100644 --- a/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryLinkedServiceReference.Serialization.cs +++ b/sdk/core/Azure.Core.Expressions.DataFactory/src/DataFactoryLinkedServiceReference.Serialization.cs @@ -54,7 +54,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { if (property.NameEquals("type"u8)) { - kind = new DataFactoryLinkedServiceReferenceKind(property.Value.GetString()); + kind = new DataFactoryLinkedServiceReferenceKind(property.Value.GetString() ?? string.Empty); continue; } if (property.NameEquals("referenceName"u8)) diff --git a/sdk/core/Azure.Core.Expressions.DataFactory/tests/DataFactoryElementTests.cs b/sdk/core/Azure.Core.Expressions.DataFactory/tests/DataFactoryElementTests.cs index 57fe13ad079f..54a7b6088bd6 100644 --- a/sdk/core/Azure.Core.Expressions.DataFactory/tests/DataFactoryElementTests.cs +++ b/sdk/core/Azure.Core.Expressions.DataFactory/tests/DataFactoryElementTests.cs @@ -1021,10 +1021,10 @@ private static void AssertListOfStringDfe(DataFactoryElement> dfe) private static void AssertBinaryDataDfe(DataFactoryElement dfe) { - var model = dfe.Literal!.ToObjectFromJson(); + TestModel? model = dfe.Literal!.ToObjectFromJson(); Assert.IsNotNull(model); - Assert.AreEqual(1, model.A); - Assert.IsTrue(model.B); + Assert.AreEqual(1, model?.A); + Assert.IsTrue(model?.B); } [Test] diff --git a/sdk/core/Azure.Core/CHANGELOG.md b/sdk/core/Azure.Core/CHANGELOG.md index 73dbbcc75094..29ecdafa3da1 100644 --- a/sdk/core/Azure.Core/CHANGELOG.md +++ b/sdk/core/Azure.Core/CHANGELOG.md @@ -10,6 +10,10 @@ ### Other Changes +- Upgraded dependency on System.Text.Json to 6.0.9 +- Added a new constructor on `AzureEventSourceListener` for callers that don't need the formatted message ([#45191](https://github.com/Azure/azure-sdk-for-net/pull/45191)). +- Remove unused callback from `HttpRequestMessage` options in `HttpClientTransport` transport. + ## 1.42.0 (2024-08-01) ### Other Changes diff --git a/sdk/core/Azure.Core/api/Azure.Core.net461.cs b/sdk/core/Azure.Core/api/Azure.Core.net461.cs index 5f34b2c37794..35906202bd9f 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net461.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net461.cs @@ -807,6 +807,7 @@ public partial class AzureEventSourceListener : System.Diagnostics.Tracing.Event public const string TraitName = "AzureEventSource"; public const string TraitValue = "true"; public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } + public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateConsoleLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateTraceLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } protected sealed override void OnEventSourceCreated(System.Diagnostics.Tracing.EventSource eventSource) { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net472.cs b/sdk/core/Azure.Core/api/Azure.Core.net472.cs index 5f34b2c37794..35906202bd9f 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net472.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net472.cs @@ -807,6 +807,7 @@ public partial class AzureEventSourceListener : System.Diagnostics.Tracing.Event public const string TraitName = "AzureEventSource"; public const string TraitValue = "true"; public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } + public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateConsoleLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateTraceLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } protected sealed override void OnEventSourceCreated(System.Diagnostics.Tracing.EventSource eventSource) { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs b/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs index 7c538465c29b..9b0a433af974 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.net6.0.cs @@ -812,6 +812,7 @@ public partial class AzureEventSourceListener : System.Diagnostics.Tracing.Event public const string TraitName = "AzureEventSource"; public const string TraitValue = "true"; public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } + public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateConsoleLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateTraceLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } protected sealed override void OnEventSourceCreated(System.Diagnostics.Tracing.EventSource eventSource) { } diff --git a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs index 5f34b2c37794..35906202bd9f 100644 --- a/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs +++ b/sdk/core/Azure.Core/api/Azure.Core.netstandard2.0.cs @@ -807,6 +807,7 @@ public partial class AzureEventSourceListener : System.Diagnostics.Tracing.Event public const string TraitName = "AzureEventSource"; public const string TraitValue = "true"; public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } + public AzureEventSourceListener(System.Action log, System.Diagnostics.Tracing.EventLevel level) { } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateConsoleLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } public static Azure.Core.Diagnostics.AzureEventSourceListener CreateTraceLogger(System.Diagnostics.Tracing.EventLevel level = System.Diagnostics.Tracing.EventLevel.Informational) { throw null; } protected sealed override void OnEventSourceCreated(System.Diagnostics.Tracing.EventSource eventSource) { } diff --git a/sdk/core/Azure.Core/perf/EventSourceBenchmark.cs b/sdk/core/Azure.Core/perf/EventSourceBenchmark.cs index d05eebd0787a..d4e2e0163c93 100644 --- a/sdk/core/Azure.Core/perf/EventSourceBenchmark.cs +++ b/sdk/core/Azure.Core/perf/EventSourceBenchmark.cs @@ -33,7 +33,7 @@ public class EventSourceBenchmark [GlobalSetup] public void SetUp() { - _sourceListener = new AzureEventSourceListener((_, _) => { }, EventLevel.LogAlways); + _sourceListener = new AzureEventSourceListener(_ => { }, EventLevel.LogAlways); _eventSource = new EventSource(); _sourceListener.EnableEvents(_eventSource, EventLevel.LogAlways); @@ -84,6 +84,7 @@ private byte[] FormatHeaders() string newValue = Sanitizer.SanitizeHeader(header.Name, header.Value); stringBuilder.AppendLine(newValue); } + return Encoding.UTF8.GetBytes(stringBuilder.ToString()); } diff --git a/sdk/core/Azure.Core/samples/ProtocolMethods.md b/sdk/core/Azure.Core/samples/ProtocolMethods.md index 633023823d58..7ff235bb59c4 100644 --- a/sdk/core/Azure.Core/samples/ProtocolMethods.md +++ b/sdk/core/Azure.Core/samples/ProtocolMethods.md @@ -1,131 +1,3 @@ # C# Azure SDK Clients that Contain Protocol Methods -## Introduction - -Azure SDK clients provide an interface to Azure services by translating library calls to REST requests. - -In Azure SDK clients, there are two ways to expose the schematized body in the request or response, known as the `message body`: - -- Most Azure SDK Clients expose methods that take ['model types'](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-model-types) as parameters, C# classes which map to the `message body` of the REST call. Those methods can be called here '**convenience methods**'. - -- However, some clients expose methods that mirror the message body directly. Those methods are called here '**protocol methods**', as they provide more direct access to the REST protocol used by the client library. - -### Pet's Example - -To compare the two approaches, imagine a service that stores information about pets, with a pair of `GetPet` and `SetPet` operations. - -Pets are represented in the message body as a JSON object: - -```json -{ - "name": "snoopy", - "species": "beagle" -} -``` - -An API using model types could be: - -```csharp -// This is an example model class -public class Pet -{ - string Name { get; } - string Species { get; } -} - -Response GetPet(string dogName); -Response SetPet(Pet dog); -``` - -While the protocol methods version would be: - -```csharp -// Request: "id" in the context path, like "/pets/{id}" -// Response: { -// "name": "snoopy", -// "species": "beagle" -// } -Response GetPet(string id, RequestContext context = null) -// Request: { -// "name": "snoopy", -// "species": "beagle" -// } -// Response: { -// "name": "snoopy", -// "species": "beagle" -// } -Response SetPet(RequestContent requestBody, RequestContext context = null); -``` - -**[Note]**: This document is a general quickstart in using SDK Clients that expose '**protocol methods**'. - -## Usage - -The basic structure of calling protocol methods remains the same as that of convenience methods: - -1. [Initialize Your Client](#1-initialize-your-client "Initialize Your Client") - -2. [Create and Send a request](#2-create-and-send-a-request "Create and Send a Request") - -3. [Handle the Response](#3-handle-the-response "Handle the Response") - -### 1. Initialize Your Client - -The first step in interacting with a service via protocol methods is to create a client instance. - -```csharp -using System; -using Azure.Pets; -using Azure.Core; -using Azure.Identity; - -const string endpoint = "http://localhost:3000"; -var credential = new AzureKeyCredential(/*SERVICE-API-KEY*/); -var client = new PetStoreClient(new Uri(endpoint), credential, new PetStoreClientOptions()); -``` - -### 2. Create and Send a Request - -Protocol methods need a JSON object of the shape required by the schema of the service. - -See the specific service documentation for details, but as an example: - -```csharp -// anonymous class is serialized by System.Text.Json using runtime reflection -var data = new { - name = "snoopy", - species = "beagle" -}; -/* -{ - "name": "snoopy", - "species": "beagle" -} -*/ -client.SetPet(RequestContent.Create(data)); -``` - -### 3. Handle the Response - -Protocol methods all return a `Response` object that contains information returned from the service request. - -The most important field on Response contains the REST content returned from the service: - -```C# Snippet:GetPetAsync -Response response = await client.GetPetAsync("snoopy", new RequestContext()); - -var doc = JsonDocument.Parse(response.Content.ToMemory()); -var name = doc.RootElement.GetProperty("name").GetString(); -``` - -JSON properties can also be accessed using a dynamic layer. - -```C# Snippet:AzureCoreGetDynamicJsonProperty -Response response = client.GetWidget(); -dynamic widget = response.Content.ToDynamicFromJson(); -string name = widget.name; -``` - -## Configuration And Customization - -**Protocol methods** share the same configuration and customization as **convenience methods**. For details, see the [ReadMe](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md). You can find more samples [here](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/README.md). +This guidance has moved to [Azure SDK for .NET protocol and convenience methods overview](https://learn.microsoft.com/dotnet/azure/sdk/protocol-convenience-methods?tabs=protocol-methods). diff --git a/sdk/core/Azure.Core/samples/README.md b/sdk/core/Azure.Core/samples/README.md index 622f65ca4cf0..1edccddfa91b 100644 --- a/sdk/core/Azure.Core/samples/README.md +++ b/sdk/core/Azure.Core/samples/README.md @@ -17,4 +17,4 @@ description: Samples for the Azure.Core client library - [Events](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Events.md) - [Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) - [Mocking](https://learn.microsoft.com/dotnet/azure/sdk/unit-testing-mocking) -- [Protocol Methods](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/ProtocolMethods.md) +- [Protocol Methods](https://learn.microsoft.com/dotnet/azure/sdk/protocol-convenience-methods?tabs=protocol-methods) diff --git a/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs b/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs index c0a51d5372fd..5f66f0bffb58 100644 --- a/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs +++ b/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs @@ -25,15 +25,15 @@ public class AzureEventSourceListener: EventListener public const string TraitValue = "true"; private readonly List _eventSources = new List(); - private readonly Action _log; + private readonly Action _log; private readonly EventLevel _level; /// /// Creates an instance of that executes a callback every time event is written. /// - /// The to call when event is written. The second parameter is formatted message. + /// The to call when event is written. /// The level of events to enable. - public AzureEventSourceListener(Action log, EventLevel level) + public AzureEventSourceListener(Action log, EventLevel level) { _log = log ?? throw new ArgumentNullException(nameof(log)); @@ -47,6 +47,15 @@ public AzureEventSourceListener(Action log, Event _eventSources.Clear(); } + /// + /// Creates an instance of that executes a callback every time event is written. + /// + /// The to call when event is written. The second parameter is the formatted message. + /// The level of events to enable. + public AzureEventSourceListener(Action log, EventLevel level) : this(e => log(e, EventSourceEventFormatting.Format(e)), level) + { + } + /// protected sealed override void OnEventSourceCreated(EventSource eventSource) { @@ -74,7 +83,7 @@ protected sealed override void OnEventWritten(EventWrittenEventArgs eventData) // There is a very tight race during the AzureEventSourceListener creation where EnableEvents was called // and the thread producing events not observing the `_log` field assignment - _log?.Invoke(eventData, EventSourceEventFormatting.Format(eventData)); + _log?.Invoke(eventData); } /// diff --git a/sdk/core/Azure.Core/src/JsonPatchDocument.cs b/sdk/core/Azure.Core/src/JsonPatchDocument.cs index b3961675aef9..e1728aa957d5 100644 --- a/sdk/core/Azure.Core/src/JsonPatchDocument.cs +++ b/sdk/core/Azure.Core/src/JsonPatchDocument.cs @@ -58,7 +58,7 @@ public JsonPatchDocument(ReadOnlyMemory rawDocument, ObjectSerializer seri } /// - /// Initializes a new instance of using an existing UTF8-encoded JSON Patch document. + /// Appends an "add" operation to this . /// /// The path to apply the addition to. /// The raw JSON value to add to the path. diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs b/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs index 0d2e840e1185..07f21a103c9a 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs @@ -18,8 +18,6 @@ namespace Azure.Core.Pipeline /// public partial class HttpClientTransport : HttpPipelineTransport, IDisposable { - internal const string MessageForServerCertificateCallback = "MessageForServerCertificateCallback"; - /// /// A shared instance of with default parameters. /// @@ -85,7 +83,6 @@ private async ValueTask ProcessSyncOrAsync(HttpMessage message, bool async) #pragma warning restore CA1801 { using HttpRequestMessage httpRequest = BuildRequestMessage(message); - SetPropertiesOrOptions(httpRequest, MessageForServerCertificateCallback, message); HttpResponseMessage responseMessage; Stream? contentStream = null; message.ClearResponse(); diff --git a/sdk/core/Azure.Core/tests/AzureEventSourceTests.cs b/sdk/core/Azure.Core/tests/AzureEventSourceTests.cs index f08008869e28..03d1a1a8bfb8 100644 --- a/sdk/core/Azure.Core/tests/AzureEventSourceTests.cs +++ b/sdk/core/Azure.Core/tests/AzureEventSourceTests.cs @@ -39,7 +39,7 @@ void LogEvent(EventSource azureCoreEventSource) try { List events = new(); - using var listener = new AzureEventSourceListener((args, s) => events.Add(args), EventLevel.Verbose); + using var listener = new AzureEventSourceListener(events.Add, EventLevel.Verbose); alc.LoadFromAssemblyPath(typeof(TestEventSource).Assembly.Location); alc2.LoadFromAssemblyPath(typeof(TestEventSource).Assembly.Location); diff --git a/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs b/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs index a7ee3ab94645..bc0e6cac371f 100644 --- a/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs +++ b/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs @@ -250,10 +250,7 @@ public void SetTransportOptions([Values(true, false)] bool isCustomTransportSet) List events = new(); using var listener = new AzureEventSourceListener( - (args, s) => - { - events.Add(args); - }, + events.Add, EventLevel.Verbose); var pipeline = HttpPipelineBuilder.Build( diff --git a/sdk/core/System.ClientModel/CHANGELOG.md b/sdk/core/System.ClientModel/CHANGELOG.md index 6878bacb6092..e924704c34ea 100644 --- a/sdk/core/System.ClientModel/CHANGELOG.md +++ b/sdk/core/System.ClientModel/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- Removed implicit cast from `string` to `ApiKeyCredential`. + ## 1.1.0-beta.7 (2024-08-14) ### Features Added diff --git a/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs b/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs index 38a53857153d..a510e31d07d7 100644 --- a/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs +++ b/sdk/core/System.ClientModel/api/System.ClientModel.net6.0.cs @@ -4,7 +4,6 @@ public partial class ApiKeyCredential { public ApiKeyCredential(string key) { } public void Deconstruct(out string key) { throw null; } - public static implicit operator System.ClientModel.ApiKeyCredential (string key) { throw null; } public void Update(string key) { } } public abstract partial class AsyncCollectionResult : System.ClientModel.ClientResult, System.Collections.Generic.IAsyncEnumerable diff --git a/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs b/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs index 2a716c72f50d..ad3a7a378fc0 100644 --- a/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs +++ b/sdk/core/System.ClientModel/api/System.ClientModel.netstandard2.0.cs @@ -4,7 +4,6 @@ public partial class ApiKeyCredential { public ApiKeyCredential(string key) { } public void Deconstruct(out string key) { throw null; } - public static implicit operator System.ClientModel.ApiKeyCredential (string key) { throw null; } public void Update(string key) { } } public abstract partial class AsyncCollectionResult : System.ClientModel.ClientResult, System.Collections.Generic.IAsyncEnumerable diff --git a/sdk/core/System.ClientModel/src/Convenience/ApiKeyCredential.cs b/sdk/core/System.ClientModel/src/Convenience/ApiKeyCredential.cs index 25968d7b4550..5549597debbb 100644 --- a/sdk/core/System.ClientModel/src/Convenience/ApiKeyCredential.cs +++ b/sdk/core/System.ClientModel/src/Convenience/ApiKeyCredential.cs @@ -65,7 +65,4 @@ public void Update(string key) Volatile.Write(ref _key, key); } - - /// Converts a string to an . - public static implicit operator ApiKeyCredential(string key) => new(key); } diff --git a/sdk/core/System.ClientModel/tests/Pipeline/ApiKeyAuthenticationPolicyTests.cs b/sdk/core/System.ClientModel/tests/Pipeline/ApiKeyAuthenticationPolicyTests.cs index e5638343fbfb..874e6ba0c7b6 100644 --- a/sdk/core/System.ClientModel/tests/Pipeline/ApiKeyAuthenticationPolicyTests.cs +++ b/sdk/core/System.ClientModel/tests/Pipeline/ApiKeyAuthenticationPolicyTests.cs @@ -16,19 +16,6 @@ public ApiKeyAuthenticationPolicyTests(bool isAsync) : base(isAsync) { } - [Test] - public void CanImplicitlyCastApiKeyCredential() - { - string keyValue = "test_key"; - ApiKeyCredential credential1 = new(keyValue); - ApiKeyCredential credential2 = keyValue; - - credential1.Deconstruct(out string deconstructed1); - credential2.Deconstruct(out string deconstructed2); - - Assert.AreEqual(deconstructed1, deconstructed2); - } - [Test] public async Task HeaderPolicySetsKey() { diff --git a/sdk/core/System.ClientModel/tests/internal/Convenience/SSE/ClientResultCollectionTests.cs b/sdk/core/System.ClientModel/tests/internal/Convenience/SSE/ClientResultCollectionTests.cs index d9f896e7769e..03a28295bb76 100644 --- a/sdk/core/System.ClientModel/tests/internal/Convenience/SSE/ClientResultCollectionTests.cs +++ b/sdk/core/System.ClientModel/tests/internal/Convenience/SSE/ClientResultCollectionTests.cs @@ -121,10 +121,10 @@ public async Task EnumeratesDataValues() int i = 0; await foreach (BinaryData data in result.GetRawResponse().EnumerateDataEvents()) { - MockJsonModel model = data.ToObjectFromJson(); + MockJsonModel? model = data.ToObjectFromJson(); - Assert.AreEqual(i, model.IntValue); - Assert.AreEqual(i.ToString(), model.StringValue); + Assert.AreEqual(i, model?.IntValue); + Assert.AreEqual(i.ToString(), model?.StringValue); i++; } diff --git a/sdk/core/ci.yml b/sdk/core/ci.yml index 99c66b9e7234..be4ac396948f 100644 --- a/sdk/core/ci.yml +++ b/sdk/core/ci.yml @@ -58,6 +58,8 @@ extends: AOTTestInputs: - ArtifactName: Azure.Core ExpectedWarningsFilepath: /Azure.Core/tests/compatibility/ExpectedAotWarnings.txt + - ArtifactName: System.ClientModel + ExpectedWarningsFilepath: None TestSetupSteps: - template: /sdk/storage/tests-install-azurite.yml diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md b/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md index 06a0e0e83900..77afc20c6396 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.4.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.3.0 (2024-08-16) ### Features Added diff --git a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Azure.ResourceManager.DataFactory.csproj b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Azure.ResourceManager.DataFactory.csproj index 3d76b61309d6..77413add3014 100644 --- a/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Azure.ResourceManager.DataFactory.csproj +++ b/sdk/datafactory/Azure.ResourceManager.DataFactory/src/Azure.ResourceManager.DataFactory.csproj @@ -1,8 +1,8 @@ - 1.3.0 + 1.4.0-beta.1 - 1.2.0 + 1.3.0 Azure.ResourceManager.DataFactory Microsoft Azure Resource Manager client SDK for Azure resource provider Microsoft.DataFactory. azure;management;arm;resource manager;datafactory diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md index 952bebd6a322..9311fd17d303 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.25.0-beta.1 (Unreleased) +## 4.26.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,13 @@ ### Other Changes +## 4.25.0 (2024-08-21) + +### Features Added + +- Added `AccessTier` and `PreviousTier` properties to `StorageBlobTierChangedEventData` system event. +- Added `AccessTier` to `StorageBlobCreatedEventData` system event. + ## 4.24.1 (2024-07-16) ### Bugs Fixed diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs index 7f385c8ad2d4..86c1f7f8124e 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/api/Azure.Messaging.EventGrid.netstandard2.0.cs @@ -341,10 +341,14 @@ public static partial class EventGridModelFactory public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionConnectedEventData SignalRServiceClientConnectionConnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.SignalRServiceClientConnectionDisconnectedEventData SignalRServiceClientConnectionDisconnectedEventData(System.DateTimeOffset? timestamp = default(System.DateTimeOffset?), string hubName = null, string connectionId = null, string userId = null, string errorMessage = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageAsyncOperationInitiatedEventData StorageAsyncOperationInitiatedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = default(long?), long? contentOffset = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobDeletedEventData StorageBlobDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobInventoryPolicyCompletedEventData StorageBlobInventoryPolicyCompletedEventData(System.DateTimeOffset? scheduleDateTime = default(System.DateTimeOffset?), string accountName = null, string ruleName = null, string policyRunStatus = null, string policyRunStatusMessage = null, string policyRunId = null, string manifestBlobUrl = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobRenamedEventData StorageBlobRenamedEventData(string api = null, string clientRequestId = null, string requestId = null, string sourceUrl = null, string destinationUrl = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier accessTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier previousTier = default(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier), string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = default(long?), string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryCreatedEventData StorageDirectoryCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } public static Azure.Messaging.EventGrid.SystemEvents.StorageDirectoryDeletedEventData StorageDirectoryDeletedEventData(string api = null, string clientRequestId = null, string requestId = null, string url = null, bool? recursive = default(bool?), string sequencer = null, string identity = null, object storageDiagnostics = null) { throw null; } @@ -3375,9 +3379,31 @@ internal StorageAsyncOperationInitiatedEventData() { } public object StorageDiagnostics { get { throw null; } } public string Url { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StorageBlobAccessTier : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StorageBlobAccessTier(string value) { throw null; } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Archive { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cold { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Cool { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Default { get { throw null; } } + public static Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier Hot { get { throw null; } } + public bool Equals(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } + public static implicit operator Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier (string value) { throw null; } + public static bool operator !=(Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier left, Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier right) { throw null; } + public override string ToString() { throw null; } + } public partial class StorageBlobCreatedEventData { internal StorageBlobCreatedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } @@ -3430,12 +3456,14 @@ internal StorageBlobRenamedEventData() { } public partial class StorageBlobTierChangedEventData { internal StorageBlobTierChangedEventData() { } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier AccessTier { get { throw null; } } public string Api { get { throw null; } } public string BlobType { get { throw null; } } public string ClientRequestId { get { throw null; } } public long? ContentLength { get { throw null; } } public string ContentType { get { throw null; } } public string Identity { get { throw null; } } + public Azure.Messaging.EventGrid.SystemEvents.StorageBlobAccessTier PreviousTier { get { throw null; } } public string RequestId { get { throw null; } } public string Sequencer { get { throw null; } } public object StorageDiagnostics { get { throw null; } } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj index 2d3d6f8ea6a6..6904a5b6fe8f 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Azure.Messaging.EventGrid.csproj @@ -2,9 +2,9 @@ This library can be used to publish events to Azure Event Grid and to consume events delivered by EventGrid. It also defines the event schemas for the events published to EventGrid by various Azure services. Microsoft Azure.Messaging.EventGrid client library - 4.25.0-beta.1 + 4.26.0-beta.1 - 4.24.1 + 4.25.0 Microsoft Azure EventGrid;Event Grid;Event Grid Publishing; true $(RequiredTargetFrameworks) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs index a365f2da8848..c74913724cf1 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Customization/EventGridModelFactory.cs @@ -726,6 +726,69 @@ public static CommunicationIdentifierModel CommunicationIdentifierModel(string r { return new CommunicationIdentifierModel(default, rawId, communicationUser, phoneNumber, microsoftTeamsUser, default); } + + /// Initializes a new instance of . + /// The name of the API/operation that triggered this event. + /// A request id provided by the client of the storage API operation that triggered this event. + /// The request id generated by the Storage service for the storage API operation that triggered this event. + /// The etag of the blob at the time this event was triggered. + /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. + /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. + /// The offset of the blob in bytes. + /// The type of blob. + /// The path to the blob. + /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. + /// The identity of the requester that triggered this event. + /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static StorageBlobCreatedEventData StorageBlobCreatedEventData( + string api = null, + string clientRequestId = null, + string requestId = null, + string eTag = null, + string contentType = null, + long? contentLength = null, + long? contentOffset = null, + string blobType = null, + string url = null, + string sequencer = null, + string identity = null, + object storageDiagnostics = null) + { + return StorageBlobCreatedEventData(api, clientRequestId, requestId, eTag, contentType, contentLength, + contentOffset, blobType, null, url, sequencer, identity, storageDiagnostics); + } + + /// Initializes a new instance of . + /// The name of the API/operation that triggered this event. + /// A request id provided by the client of the storage API operation that triggered this event. + /// The request id generated by the Storage service for the storage API operation that triggered this event. + /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. + /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. + /// The type of blob. + /// The path to the blob. + /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. + /// The identity of the requester that triggered this event. + /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + { + return StorageBlobTierChangedEventData( + api, + clientRequestId, + requestId, + contentType, + contentLength, + blobType, + null, + null, + url, + sequencer, + identity, + storageDiagnostics); + } } #pragma warning restore CA1054 // URI-like parameters should not be strings } diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs index 6c19b5da67ac..c4aff0098a22 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/EventGridModelFactory.cs @@ -24,12 +24,13 @@ public static partial class EventGridModelFactory /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The offset of the blob in bytes. /// The type of blob. + /// The current tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = null, long? contentOffset = null, string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api = null, string clientRequestId = null, string requestId = null, string eTag = null, string contentType = null, long? contentLength = null, long? contentOffset = null, string blobType = null, StorageBlobAccessTier accessTier = default, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { return new StorageBlobCreatedEventData( api, @@ -40,6 +41,7 @@ public static StorageBlobCreatedEventData StorageBlobCreatedEventData(string api contentLength, contentOffset, blobType, + accessTier, url, sequencer, identity, @@ -168,12 +170,14 @@ public static StorageLifecyclePolicyActionSummaryDetail StorageLifecyclePolicyAc /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The type of blob. + /// The current tier of the blob. + /// The previous tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. /// A new instance for mocking. - public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) + public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(string api = null, string clientRequestId = null, string requestId = null, string contentType = null, long? contentLength = null, string blobType = null, StorageBlobAccessTier accessTier = default, StorageBlobAccessTier previousTier = default, string url = null, string sequencer = null, string identity = null, object storageDiagnostics = null) { return new StorageBlobTierChangedEventData( api, @@ -182,6 +186,8 @@ public static StorageBlobTierChangedEventData StorageBlobTierChangedEventData(st contentType, contentLength, blobType, + accessTier, + previousTier, url, sequencer, identity, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobAccessTier.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobAccessTier.cs new file mode 100644 index 000000000000..b5072eac433a --- /dev/null +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobAccessTier.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Messaging.EventGrid.SystemEvents +{ + /// The access tier of the blob. + public readonly partial struct StorageBlobAccessTier : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StorageBlobAccessTier(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HotValue = "Hot"; + private const string CoolValue = "Cool"; + private const string ColdValue = "Cold"; + private const string ArchiveValue = "Archive"; + private const string DefaultValue = "Default"; + + /// The blob is in access tier Hot. + public static StorageBlobAccessTier Hot { get; } = new StorageBlobAccessTier(HotValue); + /// The blob is in access tier Cool. + public static StorageBlobAccessTier Cool { get; } = new StorageBlobAccessTier(CoolValue); + /// The blob is in access tier Cold. + public static StorageBlobAccessTier Cold { get; } = new StorageBlobAccessTier(ColdValue); + /// The blob is in access tier Archive. + public static StorageBlobAccessTier Archive { get; } = new StorageBlobAccessTier(ArchiveValue); + /// The blob is in access tier Default(Inferred). + public static StorageBlobAccessTier Default { get; } = new StorageBlobAccessTier(DefaultValue); + /// Determines if two values are the same. + public static bool operator ==(StorageBlobAccessTier left, StorageBlobAccessTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StorageBlobAccessTier left, StorageBlobAccessTier right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator StorageBlobAccessTier(string value) => new StorageBlobAccessTier(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StorageBlobAccessTier other && Equals(other); + /// + public bool Equals(StorageBlobAccessTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs index fd69094430b2..5429ec22864c 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.Serialization.cs @@ -28,6 +28,7 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa long? contentLength = default; long? contentOffset = default; string blobType = default; + StorageBlobAccessTier accessTier = default; string url = default; string sequencer = default; string identity = default; @@ -82,6 +83,11 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa blobType = property.Value.GetString(); continue; } + if (property.NameEquals("accessTier"u8)) + { + accessTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } if (property.NameEquals("url"u8)) { url = property.Value.GetString(); @@ -116,6 +122,7 @@ internal static StorageBlobCreatedEventData DeserializeStorageBlobCreatedEventDa contentLength, contentOffset, blobType, + accessTier, url, sequencer, identity, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.cs index 586b36d3acca..5f2e4fafe875 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobCreatedEventData.cs @@ -11,8 +11,10 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class StorageBlobCreatedEventData { /// Initializes a new instance of . - internal StorageBlobCreatedEventData() + /// The current tier of the blob. + internal StorageBlobCreatedEventData(StorageBlobAccessTier accessTier) { + AccessTier = accessTier; } /// Initializes a new instance of . @@ -24,11 +26,12 @@ internal StorageBlobCreatedEventData() /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The offset of the blob in bytes. /// The type of blob. + /// The current tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string contentType, long? contentLength, long? contentOffset, string blobType, string url, string sequencer, string identity, object storageDiagnostics) + internal StorageBlobCreatedEventData(string api, string clientRequestId, string requestId, string eTag, string contentType, long? contentLength, long? contentOffset, string blobType, StorageBlobAccessTier accessTier, string url, string sequencer, string identity, object storageDiagnostics) { Api = api; ClientRequestId = clientRequestId; @@ -38,6 +41,7 @@ internal StorageBlobCreatedEventData(string api, string clientRequestId, string ContentLength = contentLength; ContentOffset = contentOffset; BlobType = blobType; + AccessTier = accessTier; Url = url; Sequencer = sequencer; Identity = identity; @@ -60,6 +64,8 @@ internal StorageBlobCreatedEventData(string api, string clientRequestId, string public long? ContentOffset { get; } /// The type of blob. public string BlobType { get; } + /// The current tier of the blob. + public StorageBlobAccessTier AccessTier { get; } /// The path to the blob. public string Url { get; } /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.Serialization.cs index c499115c5eb5..f7c4e3a4bc38 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.Serialization.cs @@ -26,6 +26,8 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange string contentType = default; long? contentLength = default; string blobType = default; + StorageBlobAccessTier accessTier = default; + StorageBlobAccessTier previousTier = default; string url = default; string sequencer = default; string identity = default; @@ -66,6 +68,16 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange blobType = property.Value.GetString(); continue; } + if (property.NameEquals("accessTier"u8)) + { + accessTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } + if (property.NameEquals("previousTier"u8)) + { + previousTier = new StorageBlobAccessTier(property.Value.GetString()); + continue; + } if (property.NameEquals("url"u8)) { url = property.Value.GetString(); @@ -98,6 +110,8 @@ internal static StorageBlobTierChangedEventData DeserializeStorageBlobTierChange contentType, contentLength, blobType, + accessTier, + previousTier, url, sequencer, identity, diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.cs index fdedf0d44345..edebd32d65c5 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/Generated/Models/StorageBlobTierChangedEventData.cs @@ -11,8 +11,12 @@ namespace Azure.Messaging.EventGrid.SystemEvents public partial class StorageBlobTierChangedEventData { /// Initializes a new instance of . - internal StorageBlobTierChangedEventData() + /// The current tier of the blob. + /// The previous tier of the blob. + internal StorageBlobTierChangedEventData(StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier) { + AccessTier = accessTier; + PreviousTier = previousTier; } /// Initializes a new instance of . @@ -22,11 +26,13 @@ internal StorageBlobTierChangedEventData() /// The content type of the blob. This is the same as what would be returned in the Content-Type header from the blob. /// The size of the blob in bytes. This is the same as what would be returned in the Content-Length header from the blob. /// The type of blob. + /// The current tier of the blob. + /// The previous tier of the blob. /// The path to the blob. /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. /// The identity of the requester that triggered this event. /// For service use only. Diagnostic data occasionally included by the Azure Storage service. This property should be ignored by event consumers. - internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, string url, string sequencer, string identity, object storageDiagnostics) + internal StorageBlobTierChangedEventData(string api, string clientRequestId, string requestId, string contentType, long? contentLength, string blobType, StorageBlobAccessTier accessTier, StorageBlobAccessTier previousTier, string url, string sequencer, string identity, object storageDiagnostics) { Api = api; ClientRequestId = clientRequestId; @@ -34,6 +40,8 @@ internal StorageBlobTierChangedEventData(string api, string clientRequestId, str ContentType = contentType; ContentLength = contentLength; BlobType = blobType; + AccessTier = accessTier; + PreviousTier = previousTier; Url = url; Sequencer = sequencer; Identity = identity; @@ -52,6 +60,10 @@ internal StorageBlobTierChangedEventData(string api, string clientRequestId, str public long? ContentLength { get; } /// The type of blob. public string BlobType { get; } + /// The current tier of the blob. + public StorageBlobAccessTier AccessTier { get; } + /// The previous tier of the blob. + public StorageBlobAccessTier PreviousTier { get; } /// The path to the blob. public string Url { get; } /// An opaque string value representing the logical sequence of events for any particular blob name. Users can use standard string comparison to understand the relative sequence of two events on the same blob name. diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md index 0a5b3d31756e..c61d63368e00 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md +++ b/sdk/eventgrid/Azure.Messaging.EventGrid/src/autorest.md @@ -4,7 +4,7 @@ Run `dotnet build /t:GenerateCode` to generate code. ``` yaml title: EventGridClient -require: https://github.com/Azure/azure-rest-api-specs/blob/1b0e82df2f7f953796af2aee0372e34e00baa2d2/specification/eventgrid/data-plane/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/0d023bd802cde559706b5865f685a10a88516e09/specification/eventgrid/data-plane/readme.md generation1-convenience-client: true model-factory-for-hlc: - MediaJobOutputAsset diff --git a/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs b/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs index 1e37fa9de0e5..4114d7d0233b 100644 --- a/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs +++ b/sdk/identity/Azure.Identity.Broker/src/InteractiveBrowserCredentialBrokerOptions.cs @@ -9,6 +9,7 @@ namespace Azure.Identity.Broker { /// /// Options to configure the to use the system authentication broker in lieu of an embedded web view or the system browser. + /// For more information, see Interactive brokered authentication. /// public class InteractiveBrowserCredentialBrokerOptions : InteractiveBrowserCredentialOptions, IMsalPublicClientInitializerOptions { @@ -17,7 +18,6 @@ public class InteractiveBrowserCredentialBrokerOptions : InteractiveBrowserCrede /// /// Gets or sets whether Microsoft Account (MSA) passthrough is enabled. /// - /// public bool? IsLegacyMsaPassthroughEnabled { get; set; } /// diff --git a/sdk/identity/Azure.Identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg b/sdk/identity/Azure.Identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg new file mode 100644 index 000000000000..f60052a3a066 --- /dev/null +++ b/sdk/identity/Azure.Identity/images/mermaidjs/DefaultAzureCredentialAuthFlow.svg @@ -0,0 +1 @@ +DefaultAzureCredential authentication flow;Flowchart showing the credential chain implemented by DefaultAzureCredential;
CREDENTIALS
Interactive browser
Environment
Workload Identity
Managed Identity
Visual Studio
Azure CLI
Azure PowerShell
Azure Developer CLI
CREDENTIAL TYPES
Interactive
Deployed service
Developer tool
\ No newline at end of file diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/CHANGELOG.md b/sdk/keyvault/Azure.Security.KeyVault.Administration/CHANGELOG.md index 265085526e79..4b08ca6035e4 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/CHANGELOG.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/CHANGELOG.md @@ -4,12 +4,17 @@ ### Features Added +- Added support for service API version `7.6-preview.1`. +- Added new methods `StartPreRestoreAsync`, `StartPreRestore`, `StartPreBackupAsync`, and `StartPreBackupAsync` to the `KeyVaultBackupClient`. + ### Breaking Changes ### Bugs Fixed ### Other Changes +- The default service version is now "V7_6_Preview_1". + ## 4.4.0 (2024-02-14) Changes from both the last release and the last beta include: @@ -83,8 +88,8 @@ The following changes are only breaking from the previous beta. They are not bre ### Breaking Changes - Verify the challenge resource matches the vault domain. - This should affect few customers who can set `KeyVaultAdministrationClientOptions.DisableChallengeResourceVerification` to `true` to disable. - See https://aka.ms/azsdk/blog/vault-uri for more information. + This should affect few customers who can set `KeyVaultAdministrationClientOptions.DisableChallengeResourceVerification` to `true` to disable. + See for more information. ## 4.1.0 (2022-03-24) diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md b/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md index c05c0ad094bd..dc452003b702 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/README.md @@ -141,10 +141,16 @@ A `KeyVaultAccessControlClient` provides both synchronous and asynchronous opera A `KeyVaultBackupClient` provides both synchronous and asynchronous operations for performing full key backups, full key restores, and selective key restores. +### PreBackupOperation +A `PreBackupOperation` represents a long-running operation that checks if it is possible to perform a full key backup. + ### BackupOperation A `BackupOperation` represents a long running operation for a full key backup. +### PreRestoreOperation +A `PreRestoreOperation` represents a long-running operation that checks if it is possible to perform a full key restore from a backup. + ### RestoreOperation A `RestoreOperation` represents a long running operation for both a full key and selective key restore. diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/api/Azure.Security.KeyVault.Administration.netstandard2.0.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/api/Azure.Security.KeyVault.Administration.netstandard2.0.cs index 32a5847b1b3e..0c1a09a9ad6f 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/api/Azure.Security.KeyVault.Administration.netstandard2.0.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/api/Azure.Security.KeyVault.Administration.netstandard2.0.cs @@ -43,7 +43,7 @@ public KeyVaultAccessControlClient(System.Uri vaultUri, Azure.Core.TokenCredenti } public partial class KeyVaultAdministrationClientOptions : Azure.Core.ClientOptions { - public KeyVaultAdministrationClientOptions(Azure.Security.KeyVault.Administration.KeyVaultAdministrationClientOptions.ServiceVersion version = Azure.Security.KeyVault.Administration.KeyVaultAdministrationClientOptions.ServiceVersion.V7_5) { } + public KeyVaultAdministrationClientOptions(Azure.Security.KeyVault.Administration.KeyVaultAdministrationClientOptions.ServiceVersion version = Azure.Security.KeyVault.Administration.KeyVaultAdministrationClientOptions.ServiceVersion.V7_6_Preview_1) { } public bool DisableChallengeResourceVerification { get { throw null; } set { } } public Azure.Security.KeyVault.Administration.KeyVaultAdministrationClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion @@ -52,6 +52,7 @@ public enum ServiceVersion V7_3 = 2, V7_4 = 3, V7_5 = 4, + V7_6_Preview_1 = 5, } } public static partial class KeyVaultAdministrationModelFactory @@ -79,6 +80,10 @@ public KeyVaultBackupClient(System.Uri vaultUri, Azure.Core.TokenCredential cred public virtual System.Uri VaultUri { get { throw null; } } public virtual Azure.Security.KeyVault.Administration.KeyVaultBackupOperation StartBackup(System.Uri blobStorageUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StartBackupAsync(System.Uri blobStorageUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Security.KeyVault.Administration.KeyVaultPreBackupOperation StartPreBackup(System.Uri blobStorageUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StartPreBackupAsync(System.Uri blobStorageUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Security.KeyVault.Administration.KeyVaultPreRestoreOperation StartPreRestore(System.Uri folderUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task StartPreRestoreAsync(System.Uri folderUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Security.KeyVault.Administration.KeyVaultRestoreOperation StartRestore(System.Uri folderUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task StartRestoreAsync(System.Uri folderUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Security.KeyVault.Administration.KeyVaultSelectiveKeyRestoreOperation StartSelectiveKeyRestore(string keyName, System.Uri folderUri, string sasToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -165,6 +170,38 @@ public KeyVaultPermission() { } public System.Collections.Generic.IList NotActions { get { throw null; } } public System.Collections.Generic.IList NotDataActions { get { throw null; } } } + public partial class KeyVaultPreBackupOperation : Azure.Operation + { + protected KeyVaultPreBackupOperation() { } + public KeyVaultPreBackupOperation(Azure.Security.KeyVault.Administration.KeyVaultBackupClient client, string id) { } + public System.DateTimeOffset? EndTime { get { throw null; } } + public override bool HasCompleted { get { throw null; } } + public override bool HasValue { get { throw null; } } + public override string Id { get { throw null; } } + public System.DateTimeOffset? StartTime { get { throw null; } } + public override Azure.Security.KeyVault.Administration.KeyVaultBackupResult Value { get { throw null; } } + public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken) { throw null; } + } + public partial class KeyVaultPreRestoreOperation : Azure.Operation + { + protected KeyVaultPreRestoreOperation() { } + public KeyVaultPreRestoreOperation(Azure.Security.KeyVault.Administration.KeyVaultBackupClient client, string id) { } + public System.DateTimeOffset? EndTime { get { throw null; } } + public override bool HasCompleted { get { throw null; } } + public override bool HasValue { get { throw null; } } + public override string Id { get { throw null; } } + public System.DateTimeOffset? StartTime { get { throw null; } } + public override Azure.Security.KeyVault.Administration.KeyVaultRestoreResult Value { get { throw null; } } + public override Azure.Response GetRawResponse() { throw null; } + public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public override System.Threading.Tasks.ValueTask> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken) { throw null; } + } public partial class KeyVaultRestoreOperation : Azure.Operation { protected KeyVaultRestoreOperation() { } @@ -337,3 +374,13 @@ public readonly partial struct KeyVaultSettingValue public override string ToString() { throw null; } } } +namespace Azure.Security.KeyVault.Administration.Models +{ + public partial class PreBackupOperationParameters + { + public PreBackupOperationParameters() { } + public string StorageResourceUri { get { throw null; } set { } } + public string Token { get { throw null; } set { } } + public bool? UseManagedIdentity { get { throw null; } set { } } + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/assets.json b/sdk/keyvault/Azure.Security.KeyVault.Administration/assets.json index 3072779aaa8a..28336ec072ed 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/assets.json +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/keyvault/Azure.Security.KeyVault.Administration", - "Tag": "net/keyvault/Azure.Security.KeyVault.Administration_4951f6b8e1" + "Tag": "net/keyvault/Azure.Security.KeyVault.Administration_2b51d5440c" } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullBackupHeaders.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullBackupHeaders.cs new file mode 100644 index 000000000000..e98c641e0422 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullBackupHeaders.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.Security.KeyVault.Administration +{ + internal partial class AzureSecurityKeyVaultAdministrationPreFullBackupHeaders + { + private readonly Response _response; + public AzureSecurityKeyVaultAdministrationPreFullBackupHeaders(Response response) + { + _response = response; + } + /// The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. + public long? RetryAfter => _response.Headers.TryGetValue("Retry-After", out long? value) ? value : null; + /// The URI to poll for completion status. + public string AzureAsyncOperation => _response.Headers.TryGetValue("Azure-AsyncOperation", out string value) ? value : null; + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders.cs new file mode 100644 index 000000000000..f70613009957 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.Security.KeyVault.Administration +{ + internal partial class AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders + { + private readonly Response _response; + public AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders(Response response) + { + _response = response; + } + /// The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. + public long? RetryAfter => _response.Headers.TryGetValue("Retry-After", out long? value) ? value : null; + /// The URI to poll for completion status. + public string AzureAsyncOperation => _response.Headers.TryGetValue("Azure-AsyncOperation", out string value) ? value : null; + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/BackupRestoreRestClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/BackupRestoreRestClient.cs index b30181ba2e98..794f0d418986 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/BackupRestoreRestClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/BackupRestoreRestClient.cs @@ -28,7 +28,7 @@ internal partial class BackupRestoreRestClient /// The HTTP pipeline for sending and receiving REST requests and responses. /// Api Version. /// , or is null. - public BackupRestoreRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.5") + public BackupRestoreRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.6-preview.1") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); @@ -104,6 +104,75 @@ public ResponseWithHeaders } } + internal HttpMessage CreatePreFullBackupRequest(string vaultBaseUrl, PreBackupOperationParameters preBackupOperationParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(vaultBaseUrl, false); + uri.AppendPath("/prebackup", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (preBackupOperationParameters != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(preBackupOperationParameters); + request.Content = content; + } + return message; + } + + /// Pre-backup operation for checking whether the customer can perform a full backup operation. + /// The vault name, for example https://myvault.vault.azure.net. + /// Optional parameters to validate prior to performing a full backup operation. + /// The cancellation token to use. + /// is null. + public async Task> PreFullBackupAsync(string vaultBaseUrl, PreBackupOperationParameters preBackupOperationParameters = null, CancellationToken cancellationToken = default) + { + if (vaultBaseUrl == null) + { + throw new ArgumentNullException(nameof(vaultBaseUrl)); + } + + using var message = CreatePreFullBackupRequest(vaultBaseUrl, preBackupOperationParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new AzureSecurityKeyVaultAdministrationPreFullBackupHeaders(message.Response); + switch (message.Response.Status) + { + case 202: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Pre-backup operation for checking whether the customer can perform a full backup operation. + /// The vault name, for example https://myvault.vault.azure.net. + /// Optional parameters to validate prior to performing a full backup operation. + /// The cancellation token to use. + /// is null. + public ResponseWithHeaders PreFullBackup(string vaultBaseUrl, PreBackupOperationParameters preBackupOperationParameters = null, CancellationToken cancellationToken = default) + { + if (vaultBaseUrl == null) + { + throw new ArgumentNullException(nameof(vaultBaseUrl)); + } + + using var message = CreatePreFullBackupRequest(vaultBaseUrl, preBackupOperationParameters); + _pipeline.Send(message, cancellationToken); + var headers = new AzureSecurityKeyVaultAdministrationPreFullBackupHeaders(message.Response); + switch (message.Response.Status) + { + case 202: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateFullBackupStatusRequest(string vaultBaseUrl, string jobId) { var message = _pipeline.CreateMessage(); @@ -184,6 +253,75 @@ public Response FullBackupStatus(string vaultBaseUrl, } } + internal HttpMessage CreatePreFullRestoreOperationRequest(string vaultBaseUrl, PreRestoreOperationParameters preRestoreOperationParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(vaultBaseUrl, false); + uri.AppendPath("/prerestore", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (preRestoreOperationParameters != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(preRestoreOperationParameters); + request.Content = content; + } + return message; + } + + /// Pre-restore operation for checking whether the customer can perform a full restore operation. + /// The vault name, for example https://myvault.vault.azure.net. + /// Optional pre restore parameters to validate prior to performing a full restore operation. + /// The cancellation token to use. + /// is null. + public async Task> PreFullRestoreOperationAsync(string vaultBaseUrl, PreRestoreOperationParameters preRestoreOperationParameters = null, CancellationToken cancellationToken = default) + { + if (vaultBaseUrl == null) + { + throw new ArgumentNullException(nameof(vaultBaseUrl)); + } + + using var message = CreatePreFullRestoreOperationRequest(vaultBaseUrl, preRestoreOperationParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders(message.Response); + switch (message.Response.Status) + { + case 202: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Pre-restore operation for checking whether the customer can perform a full restore operation. + /// The vault name, for example https://myvault.vault.azure.net. + /// Optional pre restore parameters to validate prior to performing a full restore operation. + /// The cancellation token to use. + /// is null. + public ResponseWithHeaders PreFullRestoreOperation(string vaultBaseUrl, PreRestoreOperationParameters preRestoreOperationParameters = null, CancellationToken cancellationToken = default) + { + if (vaultBaseUrl == null) + { + throw new ArgumentNullException(nameof(vaultBaseUrl)); + } + + using var message = CreatePreFullRestoreOperationRequest(vaultBaseUrl, preRestoreOperationParameters); + _pipeline.Send(message, cancellationToken); + var headers = new AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders(message.Response); + switch (message.Response.Status) + { + case 202: + return ResponseWithHeaders.FromValue(headers, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateFullRestoreOperationRequest(string vaultBaseUrl, RestoreOperationParameters restoreBlobDetails) { var message = _pipeline.CreateMessage(); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.Serialization.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.Serialization.cs new file mode 100644 index 000000000000..e1ce1dc31993 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Security.KeyVault.Administration.Models +{ + public partial class PreBackupOperationParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(StorageResourceUri)) + { + writer.WritePropertyName("storageResourceUri"u8); + writer.WriteStringValue(StorageResourceUri); + } + if (Optional.IsDefined(Token)) + { + writer.WritePropertyName("token"u8); + writer.WriteStringValue(Token); + } + if (Optional.IsDefined(UseManagedIdentity)) + { + writer.WritePropertyName("useManagedIdentity"u8); + writer.WriteBooleanValue(UseManagedIdentity.Value); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.cs new file mode 100644 index 000000000000..c12e9e3d3265 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreBackupOperationParameters.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Security.KeyVault.Administration.Models +{ + /// The PreBackupOperationParameters. + public partial class PreBackupOperationParameters + { + /// Initializes a new instance of . + public PreBackupOperationParameters() + { + } + + /// Initializes a new instance of . + /// Azure Blob storage container Uri. + /// The SAS token pointing to an Azure Blob storage container. + /// Indicates which authentication method should be used. If set to true, Managed HSM will use the configured user-assigned managed identity to authenticate with Azure Storage. Otherwise, a SAS token has to be specified. + internal PreBackupOperationParameters(string storageResourceUri, string token, bool? useManagedIdentity) + { + StorageResourceUri = storageResourceUri; + Token = token; + UseManagedIdentity = useManagedIdentity; + } + + /// Azure Blob storage container Uri. + public string StorageResourceUri { get; set; } + /// The SAS token pointing to an Azure Blob storage container. + public string Token { get; set; } + /// Indicates which authentication method should be used. If set to true, Managed HSM will use the configured user-assigned managed identity to authenticate with Azure Storage. Otherwise, a SAS token has to be specified. + public bool? UseManagedIdentity { get; set; } + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.Serialization.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.Serialization.cs new file mode 100644 index 000000000000..45d6d2d44270 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Security.KeyVault.Administration.Models +{ + internal partial class PreRestoreOperationParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(SasTokenParameters)) + { + writer.WritePropertyName("sasTokenParameters"u8); + writer.WriteObjectValue(SasTokenParameters); + } + if (Optional.IsDefined(FolderToRestore)) + { + writer.WritePropertyName("folderToRestore"u8); + writer.WriteStringValue(FolderToRestore); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.cs new file mode 100644 index 000000000000..f2985849bc63 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/Models/PreRestoreOperationParameters.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Security.KeyVault.Administration.Models +{ + /// The PreRestoreOperationParameters. + internal partial class PreRestoreOperationParameters + { + /// Initializes a new instance of . + public PreRestoreOperationParameters() + { + } + + /// Initializes a new instance of . + /// + /// The Folder name of the blob where the previous successful full backup was stored. + internal PreRestoreOperationParameters(SASTokenParameter sasTokenParameters, string folderToRestore) + { + SasTokenParameters = sasTokenParameters; + FolderToRestore = folderToRestore; + } + + /// Gets or sets the sas token parameters. + public SASTokenParameter SasTokenParameters { get; set; } + /// The Folder name of the blob where the previous successful full backup was stored. + public string FolderToRestore { get; set; } + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleAssignmentsRestClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleAssignmentsRestClient.cs index 8cdf96815723..60475edd03da 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleAssignmentsRestClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleAssignmentsRestClient.cs @@ -28,7 +28,7 @@ internal partial class RoleAssignmentsRestClient /// The HTTP pipeline for sending and receiving REST requests and responses. /// Api Version. /// , or is null. - public RoleAssignmentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.5") + public RoleAssignmentsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.6-preview.1") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleDefinitionsRestClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleDefinitionsRestClient.cs index 6221ad1e783c..9b47b644ea83 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleDefinitionsRestClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/RoleDefinitionsRestClient.cs @@ -28,7 +28,7 @@ internal partial class RoleDefinitionsRestClient /// The HTTP pipeline for sending and receiving REST requests and responses. /// Api Version. /// , or is null. - public RoleDefinitionsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.5") + public RoleDefinitionsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.6-preview.1") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/SettingsRestClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/SettingsRestClient.cs index 7a898bfb4b4b..924e65f68b0f 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/SettingsRestClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/Generated/SettingsRestClient.cs @@ -28,7 +28,7 @@ internal partial class SettingsRestClient /// The HTTP pipeline for sending and receiving REST requests and responses. /// Api Version. /// , or is null. - public SettingsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.5") + public SettingsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "7.6-preview.1") { ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultAdministrationClientOptions.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultAdministrationClientOptions.cs index baf00abf0c86..8e2144f9ac42 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultAdministrationClientOptions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultAdministrationClientOptions.cs @@ -18,7 +18,7 @@ public class KeyVaultAdministrationClientOptions : ClientOptions /// For more information, see /// Key Vault versions. ///
- internal const ServiceVersion LatestVersion = ServiceVersion.V7_5; + internal const ServiceVersion LatestVersion = ServiceVersion.V7_6_Preview_1; /// /// The versions of Azure Key Vault supported by this client @@ -46,6 +46,11 @@ public enum ServiceVersion /// The Key Vault API version 7.5. /// V7_5 = 4, + + /// + /// The Key Vault API version 7.6-preview.1. + /// + V7_6_Preview_1 = 5, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -83,6 +88,7 @@ internal string GetVersionString() ServiceVersion.V7_3 => "7.3", ServiceVersion.V7_4 => "7.4", ServiceVersion.V7_5 => "7.5", + ServiceVersion.V7_6_Preview_1 => "7.6-preview.1", _ => throw new ArgumentException(Version.ToString()), }; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultBackupClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultBackupClient.cs index 36a06b4f3bec..9c3ea0d922c1 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultBackupClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultBackupClient.cs @@ -123,6 +123,80 @@ public virtual KeyVaultBackupOperation StartBackup(Uri blobStorageUri, string sa } } + /// + /// Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire collection of keys from a Key Vault. + /// + /// The for the blob storage resource. + /// Optional Shared Access Signature (SAS) token to authorize access to the blob. If null, Managed Identity will be used to authenticate instead. + /// A controlling the request lifetime. + /// or is null. + /// The server returned an error. See for details returned from the server. + /// A representing the result of the asynchronous operation. + public virtual async Task StartPreBackupAsync(Uri blobStorageUri, string sasToken = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(blobStorageUri, nameof(blobStorageUri)); + Argument.AssertNotNull(sasToken, nameof(sasToken)); + + using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(KeyVaultBackupClient)}.{nameof(StartPreBackupAsync)}"); + scope.Start(); + try + { + var response = await _restClient.PreFullBackupAsync( + VaultUri.AbsoluteUri, + new PreBackupOperationParameters( + blobStorageUri.AbsoluteUri, + sasToken, + useManagedIdentity: sasToken == null + ), + cancellationToken).ConfigureAwait(false); + + // Should this return a KeyVaultBackupOperation? + return new KeyVaultPreBackupOperation(this, response); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Initiates a pre-backup check on the Key Vault. This operation checks if it is possible to back up the entire collection of keys from a Key Vault. + /// + /// The for the blob storage resource. + /// Optional Shared Access Signature (SAS) token to authorize access to the blob. If null, Managed Identity will be used to authenticate instead. + /// A controlling the request lifetime. + /// or is null. + /// The server returned an error. See for details returned from the server. + /// A representing the result of the operation. + public virtual KeyVaultPreBackupOperation StartPreBackup(Uri blobStorageUri, string sasToken = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(blobStorageUri, nameof(blobStorageUri)); + Argument.AssertNotNull(sasToken, nameof(sasToken)); + + using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(KeyVaultBackupClient)}.{nameof(StartPreBackup)}"); + scope.Start(); + try + { + var response = _restClient.PreFullBackup( + VaultUri.AbsoluteUri, + new PreBackupOperationParameters( + blobStorageUri.AbsoluteUri, + sasToken, + useManagedIdentity: sasToken == null + ), + cancellationToken); + + // Should this return a KeyVaultBackupOperation? + return new KeyVaultPreBackupOperation(this, response); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + /// /// Initiates a full key restore of the Key Vault. /// @@ -163,6 +237,89 @@ public virtual async Task StartRestoreAsync(Uri folder } } + /// + /// Initiate a pre-restore check on a Key Vault. This operation checks if it is possible to restore the entire collection of keys from a Key Vault. + /// + /// + /// The for the blob storage resource, including the path to the blob container where the backup resides. + /// This would be the exact value that is returned as the result of a . + /// An example Uri may look like the following: https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313. + /// + /// Optional Shared Access Signature (SAS) token to authorize access to the blob. If null, Managed Identity will be used to authenticate instead. + /// A controlling the request lifetime. + /// or is null. + /// The server returned an error. See for details returned from the server. + /// A representing the result of the asynchronous operation. + public virtual async Task StartPreRestoreAsync(Uri folderUri, string sasToken = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(folderUri, nameof(folderUri)); + Argument.AssertNotNull(sasToken, nameof(sasToken)); + + using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(KeyVaultBackupClient)}.{nameof(StartRestore)}"); + scope.Start(); + try + { + // Get the folder name from the backupBlobUri returned from a previous BackupOperation + ParseFolderName(folderUri, out string containerUriString, out string folderName); + + var response = await _restClient.PreFullRestoreOperationAsync( + VaultUri.AbsoluteUri, + new PreRestoreOperationParameters( + new SASTokenParameter(containerUriString, sasToken), + folderUri.AbsoluteUri + ), + cancellationToken).ConfigureAwait(false); + + return new KeyVaultPreRestoreOperation(this, response); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + + /// + /// Initiate a pre-restore check on a Key Vault. This operation checks if it is possible to restore the entire collection of keys from a Key Vault. + /// + /// + /// The for the blob storage resource, including the path to the blob container where the backup resides. + /// This would be the exact value that is returned as the result of a . + /// An example Uri path may look like the following: https://contoso.blob.core.windows.net/backup/mhsm-contoso-2020090117323313. + /// + /// Optional Shared Access Signature (SAS) token to authorize access to the blob. If null, Managed Identity will be used to authenticate instead. + /// A controlling the request lifetime. + /// or is null. + /// The server returned an error. See for details returned from the server. + /// A to wait on this long-running operation. + public virtual KeyVaultPreRestoreOperation StartPreRestore(Uri folderUri, string sasToken = default, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(folderUri, nameof(folderUri)); + Argument.AssertNotNull(sasToken, nameof(sasToken)); + + using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(KeyVaultBackupClient)}.{nameof(StartRestore)}"); + scope.Start(); + try + { + // Get the folder name from the backupBlobUri returned from a previous BackupOperation + ParseFolderName(folderUri, out string containerUriString, out string folderName); + + var response = _restClient.PreFullRestoreOperation( + VaultUri.AbsoluteUri, + new PreRestoreOperationParameters( + new SASTokenParameter(containerUriString, sasToken), + folderUri.AbsoluteUri + ), + cancellationToken); + return new KeyVaultPreRestoreOperation(this, response); + } + catch (Exception ex) + { + scope.Failed(ex); + throw; + } + } + /// /// Initiates a full key restore of the Key Vault. /// diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreBackupOperation.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreBackupOperation.cs new file mode 100644 index 000000000000..92ed12ee8f5a --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreBackupOperation.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Azure.Core; +using Azure.Security.KeyVault.Administration.Models; +using System.Threading.Tasks; +using System.Threading; +using Azure.Core.Pipeline; + +namespace Azure.Security.KeyVault.Administration +{ + /// + /// A long-running operation for or . + /// + public class KeyVaultPreBackupOperation : Operation + { + /// + /// The number of seconds recommended by the service to delay before checking on completion status. + /// + internal long? _retryAfterSeconds; + private readonly KeyVaultBackupClient _client; + private Response _response; + private FullBackupDetailsInternal _value; + private readonly string _id; + private RequestFailedException _requestFailedException; + + /// + /// Creates an instance of a KeyVaultPreBackupOperation from a previously started operation. , , + /// , or must be called + /// to re-populate the details of this operation. + /// + /// An instance of . + /// The from a previous . + /// or is null. + /// is empty. + public KeyVaultPreBackupOperation(KeyVaultBackupClient client, string id) + { + Argument.AssertNotNullOrEmpty(id, nameof(id)); + Argument.AssertNotNull(client, nameof(client)); + + _client = client; + _id = id; + } + + /// + /// Initializes a new instance of a KeyVaultPreBackupOperation. + /// + /// An instance of . + /// The returned from or . + /// The server operation does not contains an Id + internal KeyVaultPreBackupOperation(KeyVaultBackupClient client, ResponseWithHeaders response) + { + _client = client; + _response = response; + _retryAfterSeconds = response.Headers.RetryAfter; + _id = response.Headers.JobId() ?? throw new InvalidOperationException("The response does not contain an Id"); + } + + /// + /// Initializes a new instance of a KeyVaultPreBackupOperation for mocking purposes. + /// + /// The that will be returned from . + /// The that will be returned from . + /// An instance of . + /// , , or is null. + internal KeyVaultPreBackupOperation(FullBackupDetailsInternal value, Response response, KeyVaultBackupClient client) + { + Argument.AssertNotNull(value, nameof(value)); + Argument.AssertNotNull(response, nameof(response)); + Argument.AssertNotNull(client, nameof(client)); + + _response = response; + _value = value; + _id = value.JobId; + _client = client; + } + + /// Initializes a new instance of for mocking. + protected KeyVaultPreBackupOperation() { } + + /// + /// The start time of the backup operation. + /// + public DateTimeOffset? StartTime => _value?.StartTime; + + /// + /// The end time of the backup operation. + /// + public DateTimeOffset? EndTime => _value?.EndTime; + + /// + public override string Id => _id; + + /// + /// Gets the of the backup operation. + /// You should await before attempting to use a key in this pending state. + /// + public override KeyVaultBackupResult Value + { + get + { +#pragma warning disable CA1065 // Do not raise exceptions in unexpected locations + if (!HasCompleted) + { + throw new InvalidOperationException("The operation is not complete."); + } + if (_requestFailedException != null) + { + throw _requestFailedException; + } +#pragma warning restore CA1065 // Do not raise exceptions in unexpected locations + return new KeyVaultBackupResult(new Uri(_value.AzureStorageBlobContainerUri), _value.StartTime.Value, _value.EndTime.Value); + } + } + + /// + public override bool HasCompleted => _value?.EndTime.HasValue ?? false; + + /// + public override bool HasValue => _response != null && _value?.Error == null && HasCompleted; + + /// + public override Response GetRawResponse() => _response; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => + UpdateStatusAsync(false, cancellationToken).EnsureCompleted(); + + /// + public override async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => + await UpdateStatusAsync(true, cancellationToken).ConfigureAwait(false); + + private async ValueTask UpdateStatusAsync(bool async, CancellationToken cancellationToken = default) + { + if (!HasCompleted) + { + try + { + Response response = async ? + await _client.GetBackupDetailsAsync(Id, cancellationToken).ConfigureAwait(false) + : _client.GetBackupDetails(Id, cancellationToken); + + _value = response.Value; + _response = response.GetRawResponse(); + } + catch (RequestFailedException ex) + { + _requestFailedException = ex; + throw; + } + catch (Exception ex) + { + _requestFailedException = new RequestFailedException("Unexpected failure", ex); + throw _requestFailedException; + } + + if (_value != null && _value.EndTime.HasValue && _value.Error != null) + { + _requestFailedException = _response != null ? + new RequestFailedException(_response) + : new RequestFailedException($"{_value.Error.Message}\nInnerError: {_value.Error.InnerError}\nCode: {_value.Error.Code}"); + throw _requestFailedException; + } + } + + return GetRawResponse(); + } + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => + _retryAfterSeconds.HasValue ? this.DefaultWaitForCompletionAsync(TimeSpan.FromSeconds(_retryAfterSeconds.Value), cancellationToken) : + this.DefaultWaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken) => + this.DefaultWaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreRestoreOperation.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreRestoreOperation.cs new file mode 100644 index 000000000000..f0e236b47af7 --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/KeyVaultPreRestoreOperation.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Security.KeyVault.Administration.Models; + +namespace Azure.Security.KeyVault.Administration +{ + /// + /// A long-running operation for or . + /// + public class KeyVaultPreRestoreOperation : Operation + { + internal readonly RestoreOperationInternal _operationInternal; + + /// + /// Creates an instance of a KeyVaultPreRestoreOperation from a previously started operation. , , + /// , or must be called + /// to re-populate the details of this operation. + /// + /// An instance of . + /// The from a previous . + /// or is null. + /// is empty. + public KeyVaultPreRestoreOperation(KeyVaultBackupClient client, string id) + { + Argument.AssertNotNull(client, nameof(client)); + Argument.AssertNotNullOrEmpty(id, nameof(id)); + + _operationInternal = new RestoreOperationInternal(client, id); + } + + /// + /// Initializes a new instance of the class. + /// + /// An instance of . + /// The returned from or . + /// or is null. + internal KeyVaultPreRestoreOperation(KeyVaultBackupClient client, ResponseWithHeaders response) + { + Argument.AssertNotNull(client, nameof(client)); + Argument.AssertNotNull(response, nameof(response)); + + _operationInternal = new RestoreOperationInternal(client, response); + } + + /// + /// Initializes a new instance of a KeyVaultPreRestoreOperation for mocking purposes. + /// + /// The that will be used to populate various properties. + /// The that will be returned from . + /// An instance of . + /// or or is null. + internal KeyVaultPreRestoreOperation(RestoreDetailsInternal value, Response response, KeyVaultBackupClient client) + { + Argument.AssertNotNull(value, nameof(value)); + Argument.AssertNotNull(response, nameof(response)); + Argument.AssertNotNull(client, nameof(client)); + + _operationInternal = new RestoreOperationInternal(value, response, client); + } + + /// Initializes a new instance of for mocking. + protected KeyVaultPreRestoreOperation() {} + + /// + /// The start time of the restore operation. + /// + public DateTimeOffset? StartTime => _operationInternal.StartTime; + + /// + /// The end time of the restore operation. + /// + public DateTimeOffset? EndTime => _operationInternal.EndTime; + + /// + public override string Id => _operationInternal.Id; + /// + public override KeyVaultRestoreResult Value => _operationInternal.Value; + + /// + public override bool HasCompleted => _operationInternal.HasCompleted; + + /// + public override bool HasValue => _operationInternal.HasValue; + + /// + public override Response GetRawResponse() => _operationInternal.GetRawResponse(); + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operationInternal.UpdateStatus(cancellationToken); + + /// + public override async ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => await _operationInternal.UpdateStatusAsync(cancellationToken).ConfigureAwait(false); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => + _operationInternal.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken) => + _operationInternal.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/OperationHeadersExtensions.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/OperationHeadersExtensions.cs index aa3687c4c5f4..dba73a3eb443 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/OperationHeadersExtensions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/OperationHeadersExtensions.cs @@ -16,6 +16,24 @@ public static string JobId(this AzureSecurityKeyVaultAdministrationFullBackupHea return GetJobIdFromAzureAsyncOperation(header.AzureAsyncOperation); } + /// + /// Extracts the operation JobId from the AzureAsyncOperation. + /// + /// The operation JobId. + public static string JobId(this AzureSecurityKeyVaultAdministrationPreFullBackupHeaders header) + { + return GetJobIdFromAzureAsyncOperation(header.AzureAsyncOperation); + } + + /// + /// Extracts the operation JobId from the AzureAsyncOperation. + /// + /// The operation JobId. + public static string JobId(this AzureSecurityKeyVaultAdministrationPreFullRestoreOperationHeaders header) + { + return GetJobIdFromAzureAsyncOperation(header.AzureAsyncOperation); + } + /// /// Extracts the operation JobId from the AzureAsyncOperation. /// diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/PreRestoreOperationParameters.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/PreRestoreOperationParameters.cs new file mode 100644 index 000000000000..aac8dd35968d --- /dev/null +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/PreRestoreOperationParameters.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Azure.Security.KeyVault.Administration.Models +{ + // Transform the PreBackupOperationParameters model to an internal class. + internal partial class PreRestoreOperationParameters + { } +} diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/RestoreOperationInternal.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/RestoreOperationInternal.cs index dfff9a186646..bfb7d460b44b 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/RestoreOperationInternal.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/RestoreOperationInternal.cs @@ -65,6 +65,11 @@ internal RestoreOperationInternal(KeyVaultBackupClient client, ResponseWithHeade _id = selectiveRestoreHeaders.Headers.JobId() ?? throw new InvalidOperationException("The response does not contain an Id"); _retryAfterSeconds = selectiveRestoreHeaders.Headers.RetryAfter; } + else if (response is ResponseWithHeaders preRestoreHeaders) + { + _id = preRestoreHeaders.Headers.JobId() ?? throw new InvalidOperationException("The response does not contain an Id"); + _retryAfterSeconds = (int)preRestoreHeaders.Headers.RetryAfter; + } else { throw new ArgumentException("Invalid header type", nameof(response)); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md index 4135789b16a2..58678e5a0652 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/src/autorest.md @@ -9,9 +9,9 @@ Run `dotnet build /t:GenerateCode` in src directory to re-generate. ``` yaml title: Azure.Security.KeyVault.Administration input-file: -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7452e1cc7db72fbc6cd9539b390d8b8e5c2a1864/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.5/rbac.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7452e1cc7db72fbc6cd9539b390d8b8e5c2a1864/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.5/backuprestore.json -- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/7452e1cc7db72fbc6cd9539b390d8b8e5c2a1864/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.5/settings.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/rbac.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/backuprestore.json +- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8af9817c15d688c941cda106758045b5deb9a069/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.6-preview.1/settings.json namespace: Azure.Security.KeyVault.Administration generation1-convenience-client: true include-csproj: disable diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/AdministrationTestBase.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/AdministrationTestBase.cs index 9cd66922f472..57860b6ff99b 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/AdministrationTestBase.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/AdministrationTestBase.cs @@ -16,6 +16,7 @@ namespace Azure.Security.KeyVault.Administration.Tests /// Base class for recorded Administration tests. /// [ClientTestFixture( + KeyVaultAdministrationClientOptions.ServiceVersion.V7_6_Preview_1, KeyVaultAdministrationClientOptions.ServiceVersion.V7_5, KeyVaultAdministrationClientOptions.ServiceVersion.V7_4, KeyVaultAdministrationClientOptions.ServiceVersion.V7_3, diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/FullBackupClientLiveTests.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/FullBackupClientLiveTests.cs index 17087ce4e551..bc4e404c519c 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/FullBackupClientLiveTests.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/FullBackupClientLiveTests.cs @@ -50,6 +50,36 @@ public async Task BackupAndRestore() Assert.That(restoreOperation.HasValue, Is.True); } + [RecordedTest] + [Ignore("Service preview is not available yet.")] + public async Task PreBackupAndPreRestore() + { + var source = new CancellationTokenSource(Timeout); + + UriBuilder builder = new UriBuilder(TestEnvironment.StorageUri); + builder.Path = BlobContainerName; + + // Start the pre-backup operation. + KeyVaultPreBackupOperation preBackupOperation = await Client.StartPreBackupAsync(builder.Uri, "?" + SasToken, source.Token); + + KeyVaultBackupResult preBackupResult = await preBackupOperation.WaitForCompletionAsync(source.Token); + + await WaitForOperationAsync(); + + Assert.That(source.IsCancellationRequested, Is.False); + Assert.That(preBackupResult, Is.Not.Null); + Assert.That(preBackupOperation.HasValue, Is.True); + + // Start the pre-restore operation. + KeyVaultPreRestoreOperation preRestoreOperation = await Client.StartPreRestoreAsync(preBackupResult.FolderUri, "?" + SasToken, source.Token); + KeyVaultRestoreResult preRestoreResult = await preRestoreOperation.WaitForCompletionAsync(source.Token); + await WaitForOperationAsync(); + + Assert.That(source.IsCancellationRequested, Is.False); + Assert.That(preRestoreResult, Is.Not.Null); + Assert.That(preRestoreOperation.HasValue, Is.True); + } + [RecordedTest] [LiveOnly] [Ignore("https://github.com/Azure/azure-sdk-for-net/issues/35614")] diff --git a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample1_BackupHelloWorld.cs b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample1_BackupHelloWorld.cs index 139819a4b099..b070f3048b93 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample1_BackupHelloWorld.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Administration/tests/samples/Sample1_BackupHelloWorld.cs @@ -71,6 +71,61 @@ public async Task BackupAndRestoreSampleAsync() await WaitForOperationAsync(); } + [RecordedTest] + [AsyncOnly] + [Ignore("Service preview is not available yet")] + public async Task PreBackupAndPreRestoreSampleAsync() + { + var blobStorageUrl = TestEnvironment.StorageUri; + var blobContainerName = BlobContainerName; + var sasToken = "?" + SasToken; + + // Create a Uri with the storage container + UriBuilder builder = new UriBuilder(blobStorageUrl) + { + Path = blobContainerName, + }; + + // Check for backup readiness. + KeyVaultPreBackupOperation backupOperation = await Client.StartPreBackupAsync(builder.Uri, sasToken); + + // Wait for completion of the PreBackupOperation. + Response backupResult = await backupOperation.WaitForCompletionAsync(); + + // Check if the PreBackupOperation has completed successfully. + Uri folderUri = backupOperation.HasValue ? backupResult.Value.FolderUri : null; + + if (folderUri is null) + { + Console.WriteLine($"Backup operation failed. Status: {backupOperation.GetRawResponse().Status}, Reason: {backupOperation.GetRawResponse().ReasonPhrase}"); + } + + Assert.That(folderUri, Is.Not.Null); + Assert.That(backupOperation.HasValue, Is.True); + + await WaitForOperationAsync(); + + // Check for restore readiness using the backupBlobUri returned from a previous BackupOperation. + KeyVaultPreRestoreOperation preRestoreOperation = await Client.StartPreRestoreAsync(folderUri, sasToken); + + // Wait for completion of the PreRestoreOperation. + Response preRestoreResult = await preRestoreOperation.WaitForCompletionAsync(); + + // Check if the PreRestoreOperation has completed successfully. + if (preRestoreOperation.HasValue) + { + Console.WriteLine($"Pre-restore operation completed successfully. Status: {preRestoreOperation.GetRawResponse().Status}"); + } + else + { + Console.WriteLine($"Pre-restore operation failed. Status: {preRestoreOperation.GetRawResponse().Status}, Reason: {preRestoreOperation.GetRawResponse().ReasonPhrase}"); + } + + Assert.That(preRestoreOperation.HasValue, Is.True); + Assert.That(preRestoreResult.Value.StartTime, Is.Not.EqualTo(default)); + Assert.That(preRestoreResult.Value.EndTime, Is.Not.EqualTo(default)); + } + [RecordedTest] [SyncOnly] public async Task BackupAndRestoreSampleSync() diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md b/sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md index e040932d1035..917ca4d22e1d 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- The default service version is now "V7_6_Preview_1". + ## 4.6.0 (2024-02-14) Changes from both the last release and the last beta include: @@ -17,7 +19,7 @@ Changes from both the last release and the last beta include: ### Features Added - Added `CertificateProperties.X509ThumbprintString` to return the hexadecimal string representation of the SHA-1 hash of the certificate. - `CertificateProperties.X509Thumbprint` has been hidden but is still available. + `CertificateProperties.X509Thumbprint` has been hidden but is still available. ### Breaking Changes @@ -46,7 +48,7 @@ Changes from both the last release and the last beta include: ### Features Added - Added `CertificateProperties.X509ThumbprintString` to return the hexadecimal string representation of the SHA-1 hash of the certificate. - `CertificateProperties.X509Thumbprint` has been hidden but is still available. + `CertificateProperties.X509Thumbprint` has been hidden but is still available. ### Breaking Changes @@ -94,8 +96,8 @@ Changes from both the last release and the last beta include: ### Breaking Changes - Verify the challenge resource matches the vault domain. - This should affect few customers who can set `CertificateClientOptions.DisableChallengeResourceVerification` to `true` to disable. - See https://aka.ms/azsdk/blog/vault-uri for more information. + This should affect few customers who can set `CertificateClientOptions.DisableChallengeResourceVerification` to `true` to disable. + See for more information. ## 4.3.0 (2022-03-24) diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/api/Azure.Security.KeyVault.Certificates.netstandard2.0.cs b/sdk/keyvault/Azure.Security.KeyVault.Certificates/api/Azure.Security.KeyVault.Certificates.netstandard2.0.cs index 8ba696e10ee1..f24667ced66e 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/api/Azure.Security.KeyVault.Certificates.netstandard2.0.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/api/Azure.Security.KeyVault.Certificates.netstandard2.0.cs @@ -73,7 +73,7 @@ public CertificateClient(System.Uri vaultUri, Azure.Core.TokenCredential credent } public partial class CertificateClientOptions : Azure.Core.ClientOptions { - public CertificateClientOptions(Azure.Security.KeyVault.Certificates.CertificateClientOptions.ServiceVersion version = Azure.Security.KeyVault.Certificates.CertificateClientOptions.ServiceVersion.V7_5) { } + public CertificateClientOptions(Azure.Security.KeyVault.Certificates.CertificateClientOptions.ServiceVersion version = Azure.Security.KeyVault.Certificates.CertificateClientOptions.ServiceVersion.V7_6_Preview_1) { } public bool DisableChallengeResourceVerification { get { throw null; } set { } } public Azure.Security.KeyVault.Certificates.CertificateClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion @@ -84,6 +84,7 @@ public enum ServiceVersion V7_3 = 3, V7_4 = 4, V7_5 = 5, + V7_6_Preview_1 = 6, } } public partial class CertificateContact diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/assets.json b/sdk/keyvault/Azure.Security.KeyVault.Certificates/assets.json index 3d555e91ec26..ceae51646e6a 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/assets.json +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/keyvault/Azure.Security.KeyVault.Certificates", - "Tag": "net/keyvault/Azure.Security.KeyVault.Certificates_320abaee9a" + "Tag": "net/keyvault/Azure.Security.KeyVault.Certificates_11a73707a2" } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateClientOptions.cs b/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateClientOptions.cs index b63f82c4cf56..d90bf176b648 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateClientOptions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateClientOptions.cs @@ -16,7 +16,7 @@ public class CertificateClientOptions : ClientOptions /// For more information, see /// Key Vault versions. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V7_5; + internal const ServiceVersion LatestVersion = ServiceVersion.V7_6_Preview_1; /// /// The versions of Azure Key Vault supported by this client @@ -54,6 +54,11 @@ public enum ServiceVersion /// The Key Vault API version 7.5. /// V7_5 = 5, + + /// + /// The Key Vault API version V7_6_Preview_1. + /// + V7_6_Preview_1 = 6, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -94,6 +99,7 @@ internal string GetVersionString() ServiceVersion.V7_3 => "7.3", ServiceVersion.V7_4 => "7.4", ServiceVersion.V7_5 => "7.5", + ServiceVersion.V7_6_Preview_1 => "7.6-preview.1", _ => throw new ArgumentException(Version.ToString()), }; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs b/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs index b38b255f8363..6620b70d41c5 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Certificates/tests/CertificatesTestBase.cs @@ -13,6 +13,7 @@ namespace Azure.Security.KeyVault.Certificates.Tests { [ClientTestFixture( + CertificateClientOptions.ServiceVersion.V7_6_Preview_1, CertificateClientOptions.ServiceVersion.V7_5, CertificateClientOptions.ServiceVersion.V7_4, CertificateClientOptions.ServiceVersion.V7_3, diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/CHANGELOG.md b/sdk/keyvault/Azure.Security.KeyVault.Keys/CHANGELOG.md index 00f3e43cec7e..1734a9546135 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/CHANGELOG.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- The default service version is now "V7_6_Preview_1". + ## 4.6.0 (2024-02-14) Changes from both the last release and the last beta include: @@ -106,7 +108,7 @@ The following changes are only breaking from the previous beta. They are not bre - Verify the challenge resource matches the vault domain. This should affect few customers who can set `KeyClientOptions.DisableChallengeResourceVerification` or `CryptographyClientOptions.DisableChallengeResourceVerification` to `true` to disable. - See https://aka.ms/azsdk/blog/vault-uri for more information. + See for more information. ## 4.3.0 (2022-03-24) @@ -397,7 +399,7 @@ Changes from both the last release and the last beta include: Version 4.0.0-preview.1 is the first preview of our efforts to create a user-friendly client library for Azure Key Vault. For more information about preview releases of other Azure SDK libraries, please visit -https://aka.ms/azure-sdk-preview1-net. +. This library is not a direct replacement for `Microsoft.Azure.KeyVault`. Applications using that library would require code changes to use `Azure.Security.KeyVault.Keys`. @@ -422,7 +424,7 @@ only). [Azure Identity documentation](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity) for more information -### `Microsoft.Azure.KeyVault` features not implemented in this release: +### `Microsoft.Azure.KeyVault` features not implemented in this release - Certificate management APIs - Cryptographic operations, e.g. sign, un/wrap, verify, en- and diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/api/Azure.Security.KeyVault.Keys.netstandard2.0.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/api/Azure.Security.KeyVault.Keys.netstandard2.0.cs index c33c46631e8a..77b3469313e9 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/api/Azure.Security.KeyVault.Keys.netstandard2.0.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/api/Azure.Security.KeyVault.Keys.netstandard2.0.cs @@ -159,7 +159,7 @@ public KeyClient(System.Uri vaultUri, Azure.Core.TokenCredential credential, Azu } public partial class KeyClientOptions : Azure.Core.ClientOptions { - public KeyClientOptions(Azure.Security.KeyVault.Keys.KeyClientOptions.ServiceVersion version = Azure.Security.KeyVault.Keys.KeyClientOptions.ServiceVersion.V7_5) { } + public KeyClientOptions(Azure.Security.KeyVault.Keys.KeyClientOptions.ServiceVersion version = Azure.Security.KeyVault.Keys.KeyClientOptions.ServiceVersion.V7_6_Preview_1) { } public bool DisableChallengeResourceVerification { get { throw null; } set { } } public Azure.Security.KeyVault.Keys.KeyClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion @@ -170,6 +170,7 @@ public enum ServiceVersion V7_3 = 3, V7_4 = 4, V7_5 = 5, + V7_6_Preview_1 = 6, } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -429,7 +430,7 @@ public CryptographyClient(System.Uri keyId, Azure.Core.TokenCredential credentia } public partial class CryptographyClientOptions : Azure.Core.ClientOptions { - public CryptographyClientOptions(Azure.Security.KeyVault.Keys.Cryptography.CryptographyClientOptions.ServiceVersion version = Azure.Security.KeyVault.Keys.Cryptography.CryptographyClientOptions.ServiceVersion.V7_5) { } + public CryptographyClientOptions(Azure.Security.KeyVault.Keys.Cryptography.CryptographyClientOptions.ServiceVersion version = Azure.Security.KeyVault.Keys.Cryptography.CryptographyClientOptions.ServiceVersion.V7_6_Preview_1) { } public bool DisableChallengeResourceVerification { get { throw null; } set { } } public Azure.Security.KeyVault.Keys.Cryptography.CryptographyClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion @@ -440,6 +441,7 @@ public enum ServiceVersion V7_3 = 3, V7_4 = 4, V7_5 = 5, + V7_6_Preview_1 = 6, } } public partial class DecryptParameters diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/assets.json b/sdk/keyvault/Azure.Security.KeyVault.Keys/assets.json index 59c5d87f82ee..23e1dd31e631 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/assets.json +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/keyvault/Azure.Security.KeyVault.Keys", - "Tag": "net/keyvault/Azure.Security.KeyVault.Keys_a8557a0a67" + "Tag": "net/keyvault/Azure.Security.KeyVault.Keys_5dc33e5113" } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Cryptography/CryptographyClientOptions.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Cryptography/CryptographyClientOptions.cs index ebc5f47514f5..e4e3d9f68105 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Cryptography/CryptographyClientOptions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/Cryptography/CryptographyClientOptions.cs @@ -16,7 +16,7 @@ public class CryptographyClientOptions : ClientOptions /// For more information, see /// Key Vault versions. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V7_5; + internal const ServiceVersion LatestVersion = ServiceVersion.V7_6_Preview_1; /// /// The versions of Azure Key Vault supported by this client @@ -54,6 +54,11 @@ public enum ServiceVersion /// The Key Vault API version 7.5. /// V7_5 = 5, + + /// + /// The Key Vault API version 7.6-preview.1. + /// + V7_6_Preview_1 = 6, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -94,6 +99,7 @@ internal string GetVersionString() ServiceVersion.V7_3 => "7.3", ServiceVersion.V7_4 => "7.4", ServiceVersion.V7_5 => "7.5", + ServiceVersion.V7_6_Preview_1 => "7.6-preview.1", _ => throw new ArgumentException(Version.ToString()), }; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClientOptions.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClientOptions.cs index 0a423f973438..53af4ace6a14 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClientOptions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClientOptions.cs @@ -16,7 +16,7 @@ public class KeyClientOptions : ClientOptions /// For more information, see /// Key Vault versions. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V7_5; + internal const ServiceVersion LatestVersion = ServiceVersion.V7_6_Preview_1; /// /// The versions of Azure Key Vault supported by this client @@ -54,6 +54,11 @@ public enum ServiceVersion /// The Key Vault API version 7.5. /// V7_5 = 5, + + /// + /// The Key Vault API version V7_6_Preview_1. + /// + V7_6_Preview_1 = 6, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -94,6 +99,7 @@ internal string GetVersionString() ServiceVersion.V7_3 => "7.3", ServiceVersion.V7_4 => "7.4", ServiceVersion.V7_5 => "7.5", + ServiceVersion.V7_6_Preview_1 => "7.6-preview.1", _ => throw new ArgumentException(Version.ToString()), }; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyRotationLifetimeAction.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyRotationLifetimeAction.cs index 8b6baff2d325..34499114c71d 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyRotationLifetimeAction.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyRotationLifetimeAction.cs @@ -37,6 +37,7 @@ internal KeyRotationLifetimeAction() /// /// Gets the that will be executed. + /// The value is compared case-insensitively by the service. /// public KeyRotationPolicyAction Action { get; private set; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeysTestBase.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeysTestBase.cs index 5de9d50e622d..a2dd49ddea8c 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeysTestBase.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/tests/KeysTestBase.cs @@ -13,6 +13,7 @@ namespace Azure.Security.KeyVault.Keys.Tests { [ClientTestFixture( + KeyClientOptions.ServiceVersion.V7_6_Preview_1, KeyClientOptions.ServiceVersion.V7_5, KeyClientOptions.ServiceVersion.V7_4, KeyClientOptions.ServiceVersion.V7_3, diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/CHANGELOG.md b/sdk/keyvault/Azure.Security.KeyVault.Secrets/CHANGELOG.md index c5f0e76d6ea0..6e2354363b26 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/CHANGELOG.md +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- The default service version is now "V7_6_Preview_1". + ## 4.6.0 (2024-02-14) Changes from both the last release and the last beta include: @@ -74,7 +76,7 @@ Changes from both the last release and the last beta include: - Verify the challenge resource matches the vault domain. This should affect few customers who can set `SecretClientOptions.DisableChallengeResourceVerification` to `true` to disable. - See https://aka.ms/azsdk/blog/vault-uri for more information. + See for more information. ## 4.3.0 (2022-03-24) @@ -218,14 +220,14 @@ Changes from both the last release and the last beta include: - `SecretClient.DeleteSecret` has been renamed to `SecretClient.StartDeleteSecret` and now returns a `DeleteSecretOperation` to track this long-running operation. - `SecretClient.RecoverDeletedSecret` has been renamed to `SecretClient.StartRecoverDeletedSecret` and now returns a `RecoverDeletedSecretOperation` to track this long-running operation. -### Major changes +### Major changes - Updated to work with the 1.0.0 release versions of Azure.Core and Azure.Identity. - `KeyModelFactory` added to create mocks of model types for testing. ## 4.0.0-preview.5 (2019-10-07) -### Breaking changes +### Breaking changes - `SecretBase` has been renamed to `SecretProperties`. - `Secret` and `DeletedSecret` no longer extend `SecretProperties`, but instead contain a `SecretProperties` property named `Properties`. @@ -234,9 +236,10 @@ Changes from both the last release and the last beta include: - All methods in `SecretClient` now include the word "Secret" consistent with `KeyClient` and `CertificateClient`. ## 4.0.0-preview.1 (2019-06-28) + Version 4.0.0-preview.1 is the first preview of our efforts to create a user-friendly client library for Azure Key Vault. For more information about preview releases of other Azure SDK libraries, please visit -https://aka.ms/azure-sdk-preview1-net. +. This library is not a direct replacement for `Microsoft.Azure.KeyVault`. Applications using that library would require code changes to use `Azure.Security.KeyVault.Secrets`. @@ -247,9 +250,10 @@ and demonstrate the new API. ### Major changes from `Microsoft.Azure.KeyVault` + - Packages scoped by functionality - - `Azure.Security.KeyVault.Secrets` contains a client for secret operations. - - `Azure.Security.KeyVault.Keys` contains a client for key operations. + - `Azure.Security.KeyVault.Secrets` contains a client for secret operations. + - `Azure.Security.KeyVault.Keys` contains a client for key operations. - Client instances are scoped to vaults (an instance interacts with one vault only). - Asynchronous and synchronous APIs in the `Azure.Security.KeyVault.Secrets` package. @@ -260,7 +264,8 @@ only). [Azure Identity documentation](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity) for more information -### `Microsoft.Azure.KeyVault` features not implemented in this release: +### `Microsoft.Azure.KeyVault` features not implemented in this release + - Certificate management APIs - National cloud support. This release supports public global cloud vaults, e.g. https://{vault-name}.vault.azure.net diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/api/Azure.Security.KeyVault.Secrets.netstandard2.0.cs b/sdk/keyvault/Azure.Security.KeyVault.Secrets/api/Azure.Security.KeyVault.Secrets.netstandard2.0.cs index c231ef8a47bd..fffa9c113764 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/api/Azure.Security.KeyVault.Secrets.netstandard2.0.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/api/Azure.Security.KeyVault.Secrets.netstandard2.0.cs @@ -95,7 +95,7 @@ public SecretClient(System.Uri vaultUri, Azure.Core.TokenCredential credential, } public partial class SecretClientOptions : Azure.Core.ClientOptions { - public SecretClientOptions(Azure.Security.KeyVault.Secrets.SecretClientOptions.ServiceVersion version = Azure.Security.KeyVault.Secrets.SecretClientOptions.ServiceVersion.V7_5) { } + public SecretClientOptions(Azure.Security.KeyVault.Secrets.SecretClientOptions.ServiceVersion version = Azure.Security.KeyVault.Secrets.SecretClientOptions.ServiceVersion.V7_6_Preview_1) { } public bool DisableChallengeResourceVerification { get { throw null; } set { } } public Azure.Security.KeyVault.Secrets.SecretClientOptions.ServiceVersion Version { get { throw null; } } public enum ServiceVersion @@ -106,6 +106,7 @@ public enum ServiceVersion V7_3 = 3, V7_4 = 4, V7_5 = 5, + V7_6_Preview_1 = 6, } } public static partial class SecretModelFactory diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/assets.json b/sdk/keyvault/Azure.Security.KeyVault.Secrets/assets.json index 73d76b643745..2f5fc05d04bf 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/assets.json +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/keyvault/Azure.Security.KeyVault.Secrets", - "Tag": "net/keyvault/Azure.Security.KeyVault.Secrets_18b0beab8a" + "Tag": "net/keyvault/Azure.Security.KeyVault.Secrets_835634e403" } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClientOptions.cs b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClientOptions.cs index 86022586ccb4..66dc3d1b6072 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClientOptions.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClientOptions.cs @@ -16,7 +16,7 @@ public class SecretClientOptions : ClientOptions /// For more information, see /// Key Vault versions. /// - internal const ServiceVersion LatestVersion = ServiceVersion.V7_5; + internal const ServiceVersion LatestVersion = ServiceVersion.V7_6_Preview_1; /// /// The versions of Azure Key Vault supported by this client library. @@ -53,6 +53,11 @@ public enum ServiceVersion /// The Key Vault API version 7.5. /// V7_5 = 5, + + /// + /// The Key Vault API version 7.6-preview.1. + /// + V7_6_Preview_1 = 6, #pragma warning restore CA1707 // Identifiers should not contain underscores } @@ -92,6 +97,7 @@ internal string GetVersionString() ServiceVersion.V7_3 => "7.3", ServiceVersion.V7_4 => "7.4", ServiceVersion.V7_5 => "7.5", + ServiceVersion.V7_6_Preview_1 => "7.6-preview.1", _ => throw new ArgumentException(Version.ToString()), }; } diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretsTestBase.cs b/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretsTestBase.cs index 4b3f24fe846f..1b5f7577b81c 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretsTestBase.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/tests/SecretsTestBase.cs @@ -14,6 +14,7 @@ namespace Azure.Security.KeyVault.Secrets.Tests { [ClientTestFixture( + SecretClientOptions.ServiceVersion.V7_6_Preview_1, SecretClientOptions.ServiceVersion.V7_5, SecretClientOptions.ServiceVersion.V7_4, SecretClientOptions.ServiceVersion.V7_3, diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index 6f70888a8451..f8d5d93e5711 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -283,40 +283,44 @@ } } ], - "outputs": { - "AZURE_KEYVAULT_URL": { - "type": "string", - "value": "[reference(variables('kvName')).vaultUri]" - }, - "AZURE_MANAGEDHSM_URL": { - "type": "string", - "condition": "[parameters('enableHsm')]", - "value": "[reference(variables('hsmName')).hsmUri]" - }, - "KEYVAULT_SKU": { - "type": "string", - "value": "[reference(parameters('baseName')).sku.name]" - }, - "CLIENT_OBJECTID": { - "type": "string", - "value": "[parameters('testApplicationOid')]" - }, - "BLOB_STORAGE_ACCOUNT_NAME": { - "type": "string", - "value": "[variables('primaryAccountName')]" - }, - "BLOB_PRIMARY_STORAGE_ACCOUNT_KEY": { - "type": "string", - "value": "[listKeys(variables('primaryAccountName'), variables('mgmtApiVersion')).keys[0].value]" - }, - "BLOB_CONTAINER_NAME" : { - "type": "string", - "value": "[variables('blobContainerName')]" - }, - "AZURE_KEYVAULT_ATTESTATION_URL": { - "type": "string", - "condition": "[parameters('enableAttestation')]", - "value": "[format('https://{0}/', reference(variables('attestationSite')).defaultHostName)]" - } + "outputs": { + "AZURE_KEYVAULT_URL": { + "type": "string", + "value": "[reference(variables('kvName')).vaultUri]" + }, + "AZURE_MANAGEDHSM_URL": { + "type": "string", + "condition": "[parameters('enableHsm')]", + "value": "[reference(variables('hsmName')).hsmUri]" + }, + "KEYVAULT_SKU": { + "type": "string", + "value": "[reference(parameters('baseName')).sku.name]" + }, + "CLIENT_OBJECTID": { + "type": "string", + "value": "[parameters('testApplicationOid')]" + }, + "BLOB_STORAGE_ACCOUNT_NAME": { + "type": "string", + "value": "[variables('primaryAccountName')]" + }, + "BLOB_PRIMARY_STORAGE_ACCOUNT_KEY": { + "type": "string", + "value": "[listKeys(variables('primaryAccountName'), variables('mgmtApiVersion')).keys[0].value]" + }, + "BLOB_CONTAINER_NAME": { + "type": "string", + "value": "[variables('blobContainerName')]" + }, + "AZURE_KEYVAULT_ATTESTATION_URL": { + "type": "string", + "condition": "[parameters('enableAttestation')]", + "value": "[format('https://{0}/', reference(variables('attestationSite')).defaultHostName)]" + }, + "KEYVAULT_TENANT_ID": { + "type": "string", + "value": "[parameters('tenantId')]" } + } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs index 8de9119c35cb..34e2da46400d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/api/Azure.ResourceManager.MachineLearning.netstandard2.0.cs @@ -1,5 +1,71 @@ namespace Azure.ResourceManager.MachineLearning { + public partial class EndpointDeploymentResourcePropertiesBasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EndpointDeploymentResourcePropertiesBasicResourceData(Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties properties) { } + public Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointResourcePropertiesBasicResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EndpointResourcePropertiesBasicResource() { } + public virtual Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModels(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkspaceEndpointDeployment(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkspaceEndpointDeploymentAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceEndpointDeploymentCollection GetWorkspaceEndpointDeployments() { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceEndpointRaiPolicyCollection GetWorkspaceEndpointRaiPolicies() { throw null; } + public virtual Azure.Response GetWorkspaceEndpointRaiPolicy(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkspaceEndpointRaiPolicyAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RegenerateKeys(Azure.ResourceManager.MachineLearning.Models.RegenerateServiceAccountKeyContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RegenerateKeysAsync(Azure.ResourceManager.MachineLearning.Models.RegenerateServiceAccountKeyContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EndpointResourcePropertiesBasicResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EndpointResourcePropertiesBasicResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string endpointName, Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string endpointName, Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(Azure.ResourceManager.MachineLearning.Models.EndpointType? endpointType = default(Azure.ResourceManager.MachineLearning.Models.EndpointType?), bool? includeInferenceEndpoints = default(bool?), string skip = null, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(Azure.ResourceManager.MachineLearning.Models.EndpointType? endpointType = default(Azure.ResourceManager.MachineLearning.Models.EndpointType?), bool? includeInferenceEndpoints = default(bool?), string skip = null, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class EndpointResourcePropertiesBasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EndpointResourcePropertiesBasicResourceData(Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties properties) { } + public Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class MachineLearningBatchDeploymentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected MachineLearningBatchDeploymentCollection() { } @@ -358,11 +424,15 @@ protected MachineLearningComputeResource() { } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningUnderlyingResourceAction underlyingResourceAction, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningUnderlyingResourceAction underlyingResourceAction, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAllowedResizeSizes(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllowedResizeSizesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetNodes(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetNodesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Resize(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ResizeSchema resizeSchema, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ResizeAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ResizeSchema resizeSchema, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Restart(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task RestartAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -376,6 +446,15 @@ protected MachineLearningComputeResource() { } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } +<<<<<<< HEAD +======= + public virtual Azure.Response UpdateCustomServices(System.Collections.Generic.IEnumerable customServices, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateCustomServicesAsync(System.Collections.Generic.IEnumerable customServices, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateDataMounts(System.Collections.Generic.IEnumerable dataMounts, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateDataMountsAsync(System.Collections.Generic.IEnumerable dataMounts, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateIdleShutdownSetting(Azure.ResourceManager.MachineLearning.Models.IdleShutdownSetting idleShutdownSetting, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateIdleShutdownSettingAsync(Azure.ResourceManager.MachineLearning.Models.IdleShutdownSetting idleShutdownSetting, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } public partial class MachineLearningDataContainerCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -466,7 +545,9 @@ protected MachineLearningDatastoreResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetSecrets(Azure.ResourceManager.MachineLearning.Models.SecretExpiry body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetSecretsAsync(Azure.ResourceManager.MachineLearning.Models.SecretExpiry body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningDatastoreData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -631,6 +712,7 @@ protected MachineLearningEnvironmentVersionResource() { } } public static partial class MachineLearningExtensions { + public static Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResource GetEndpointResourcePropertiesBasicResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningBatchDeploymentResource GetMachineLearningBatchDeploymentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningBatchEndpointResource GetMachineLearningBatchEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningCodeContainerResource GetMachineLearningCodeContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -681,14 +763,31 @@ public static partial class MachineLearningExtensions public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionResource GetMachineLearningWorkspaceConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceResource GetMachineLearningWorkspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceCollection GetMachineLearningWorkspaces(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } +<<<<<<< HEAD [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Pageable GetMachineLearningWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skip, System.Threading.CancellationToken cancellationToken) { throw null; } +======= + public static Azure.Pageable GetMachineLearningWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.Pageable GetMachineLearningWorkspaces(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skip, System.Threading.CancellationToken cancellationToken) { throw null; } + public static Azure.AsyncPageable GetMachineLearningWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.AsyncPageable GetMachineLearningWorkspacesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skip, System.Threading.CancellationToken cancellationToken) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearninRegistryComponentContainerResource GetMachineLearninRegistryComponentContainerResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearninRegistryComponentVersionResource GetMachineLearninRegistryComponentVersionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } +<<<<<<< HEAD + public static Azure.ResourceManager.MachineLearning.ServerlessEndpointResource GetServerlessEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResource GetRaiBlocklistItemPropertiesBasicResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResource GetRaiBlocklistPropertiesBasicResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.MachineLearning.ServerlessEndpointResource GetServerlessEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.WorkspaceConnectionDeploymentResource GetWorkspaceConnectionDeploymentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.WorkspaceConnectionRaiPolicyResource GetWorkspaceConnectionRaiPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.WorkspaceEndpointDeploymentResource GetWorkspaceEndpointDeploymentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.MachineLearning.WorkspaceEndpointRaiPolicyResource GetWorkspaceEndpointRaiPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.Pageable UpdateMachineLearningQuotas(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable UpdateMachineLearningQuotasAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -1274,7 +1373,7 @@ public MachineLearningPrivateEndpointConnectionData(Azure.Core.AzureLocation loc public Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpoint PrivateEndpoint { get { throw null; } set { } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningSku Sku { get { throw null; } set { } } public Azure.Core.ResourceIdentifier SubResourceId { get { throw null; } } Azure.ResourceManager.MachineLearning.MachineLearningPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1409,6 +1508,7 @@ public MachineLearningRegistryData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public string IntellectualPropertyPublisher { get { throw null; } set { } } public string Kind { get { throw null; } set { } } + public System.Collections.Generic.IList ManagedResourceGroupAssignedIdentities { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ManagedResourceId { get { throw null; } set { } } public System.Uri MlFlowRegistryUri { get { throw null; } set { } } public string PublicNetworkAccess { get { throw null; } set { } } @@ -1748,8 +1848,17 @@ protected MachineLearningWorkspaceCollection() { } public virtual Azure.Response Exists(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } +<<<<<<< HEAD public virtual Azure.Pageable GetAll(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllAsync(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } +======= + public virtual Azure.Pageable GetAll(string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Pageable GetAll(string skip, System.Threading.CancellationToken cancellationToken) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.AsyncPageable GetAllAsync(string skip, System.Threading.CancellationToken cancellationToken) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public virtual System.Threading.Tasks.Task> GetAsync(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.NullableResponse GetIfExists(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string workspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1765,8 +1874,10 @@ protected MachineLearningWorkspaceConnectionCollection() { } public virtual Azure.Response Exists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string target = null, string category = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string target = null, string category = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string target, string category, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string target, string category, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.NullableResponse GetIfExists(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string connectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1795,13 +1906,30 @@ protected MachineLearningWorkspaceConnectionResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetModelsConnections(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelsConnectionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetRaiBlocklistPropertiesBasicResource(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRaiBlocklistPropertiesBasicResourceAsync(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceCollection GetRaiBlocklistPropertiesBasicResources() { throw null; } public virtual Azure.Response GetSecrets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetSecretsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetWorkspaceConnectionDeployment(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkspaceConnectionDeploymentAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceConnectionDeploymentCollection GetWorkspaceConnectionDeployments() { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceConnectionRaiPolicyCollection GetWorkspaceConnectionRaiPolicies() { throw null; } + public virtual Azure.Response GetWorkspaceConnectionRaiPolicy(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWorkspaceConnectionRaiPolicyAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } +<<<<<<< HEAD +======= + public virtual Azure.ResourceManager.ArmOperation TestConnection(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task TestConnectionAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData data = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Update(Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1811,6 +1939,7 @@ public partial class MachineLearningWorkspaceData : Azure.ResourceManager.Models { public MachineLearningWorkspaceData(Azure.Core.AzureLocation location) { } public bool? AllowPublicAccessWhenBehindVnet { get { throw null; } set { } } + public bool? AllowRoleAssignmentOnRG { get { throw null; } set { } } public string ApplicationInsights { get { throw null; } set { } } public System.Collections.Generic.IList AssociatedWorkspaces { get { throw null; } } public string ContainerRegistry { get { throw null; } set { } } @@ -1818,12 +1947,16 @@ public MachineLearningWorkspaceData(Azure.Core.AzureLocation location) { } public string Description { get { throw null; } set { } } public System.Uri DiscoveryUri { get { throw null; } set { } } public bool? EnableDataIsolation { get { throw null; } set { } } + public bool? EnableServiceSideCMKEncryption { get { throw null; } set { } } + public bool? EnableSimplifiedCmk { get { throw null; } set { } } + public bool? EnableSoftwareBillOfMaterials { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningEncryptionSetting Encryption { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.FeatureStoreSettings FeatureStoreSettings { get { throw null; } set { } } public string FriendlyName { get { throw null; } set { } } public Azure.Core.ResourceIdentifier HubResourceId { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public string ImageBuildCompute { get { throw null; } set { } } + public System.Collections.Generic.IList IPAllowlist { get { throw null; } } public bool? IsHbiWorkspace { get { throw null; } set { } } public bool? IsStorageHnsEnabled { get { throw null; } } public bool? IsV1LegacyMode { get { throw null; } set { } } @@ -1838,7 +1971,11 @@ public MachineLearningWorkspaceData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? ProvisioningState { get { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } +<<<<<<< HEAD public Azure.ResourceManager.MachineLearning.Models.PublicNetworkAccess? PublicNetworkAccessType { get { throw null; } set { } } +======= + public Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType? PublicNetworkAccessType { get { throw null; } set { } } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings ServerlessComputeSettings { get { throw null; } set { } } public string ServiceProvisionedResourceGroup { get { throw null; } } public System.Collections.Generic.IList SharedPrivateLinkResources { get { throw null; } } @@ -1872,6 +2009,11 @@ protected MachineLearningWorkspaceResource() { } public virtual System.Threading.Tasks.Task> DiagnoseAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceDiagnoseContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetEndpointResourcePropertiesBasicResource(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEndpointResourcePropertiesBasicResourceAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceCollection GetEndpointResourcePropertiesBasicResources() { throw null; } + public virtual Azure.Pageable GetInWorkspaceEndpointDeployments(Azure.ResourceManager.MachineLearning.Models.EndpointType? endpointType = default(Azure.ResourceManager.MachineLearning.Models.EndpointType?), string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetInWorkspaceEndpointDeploymentsAsync(Azure.ResourceManager.MachineLearning.Models.EndpointType? endpointType = default(Azure.ResourceManager.MachineLearning.Models.EndpointType?), string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetMachineLearningBatchEndpoint(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1925,6 +2067,11 @@ protected MachineLearningWorkspaceResource() { } public virtual Azure.Response GetMarketplaceSubscription(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMarketplaceSubscriptionAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionCollection GetMarketplaceSubscriptions() { throw null; } +<<<<<<< HEAD +======= + public virtual Azure.Pageable GetModelsConnections(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetModelsConnectionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public virtual Azure.Response GetNotebookAccessToken(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNotebookAccessTokenAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetNotebookKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -2079,6 +2226,118 @@ protected MarketplaceSubscriptionResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } +<<<<<<< HEAD +======= + public partial class RaiBlocklistItemPropertiesBasicResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RaiBlocklistItemPropertiesBasicResource() { } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RaiBlocklistItemPropertiesBasicResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RaiBlocklistItemPropertiesBasicResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string raiBlocklistItemName, Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string raiBlocklistItemName, Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RaiBlocklistItemPropertiesBasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistItemPropertiesBasicResourceData(Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties properties) { } + public Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiBlocklistPropertiesBasicResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected RaiBlocklistPropertiesBasicResource() { } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.ResourceManager.ArmOperation> AddBulkConnectionRaiBlocklistItem(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task>> AddBulkConnectionRaiBlocklistItemAsync(Azure.WaitUntil waitUntil, System.Collections.Generic.IEnumerable content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DeleteBulkConnectionRaiBlocklistItem(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteBulkConnectionRaiBlocklistItemAsync(Azure.WaitUntil waitUntil, System.BinaryData body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetRaiBlocklistItemPropertiesBasicResource(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetRaiBlocklistItemPropertiesBasicResourceAsync(string raiBlocklistItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceCollection GetRaiBlocklistItemPropertiesBasicResources() { throw null; } + Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class RaiBlocklistPropertiesBasicResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected RaiBlocklistPropertiesBasicResourceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string raiBlocklistName, Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string raiBlocklistName, Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string raiBlocklistName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class RaiBlocklistPropertiesBasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistPropertiesBasicResourceData(Azure.ResourceManager.MachineLearning.Models.RaiBlocklistProperties properties) { } + public string RaiBlocklistDescription { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiPolicyPropertiesBasicResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiPolicyPropertiesBasicResourceData(Azure.ResourceManager.MachineLearning.Models.RaiPolicyProperties properties) { } + public Azure.ResourceManager.MachineLearning.Models.RaiPolicyProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class ServerlessEndpointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ServerlessEndpointCollection() { } @@ -2138,12 +2397,160 @@ protected ServerlessEndpointResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } +<<<<<<< HEAD +======= + public partial class WorkspaceConnectionDeploymentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkspaceConnectionDeploymentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkspaceConnectionDeploymentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkspaceConnectionDeploymentResource() { } + public virtual Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WorkspaceConnectionRaiPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkspaceConnectionRaiPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string raiPolicyName, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string raiPolicyName, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkspaceConnectionRaiPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkspaceConnectionRaiPolicyResource() { } + public virtual Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WorkspaceEndpointDeploymentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkspaceEndpointDeploymentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string deploymentName, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string deploymentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkspaceEndpointDeploymentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkspaceEndpointDeploymentResource() { } + public virtual Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class WorkspaceEndpointRaiPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WorkspaceEndpointRaiPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string raiPolicyName, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string raiPolicyName, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string raiPolicyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WorkspaceEndpointRaiPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WorkspaceEndpointRaiPolicyResource() { } + public virtual Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } namespace Azure.ResourceManager.MachineLearning.Mocking { public partial class MockableMachineLearningArmClient : Azure.ResourceManager.ArmResource { protected MockableMachineLearningArmClient() { } + public virtual Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResource GetEndpointResourcePropertiesBasicResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningBatchDeploymentResource GetMachineLearningBatchDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningBatchEndpointResource GetMachineLearningBatchEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearningCodeContainerResource GetMachineLearningCodeContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -2183,7 +2590,17 @@ protected MockableMachineLearningArmClient() { } public virtual Azure.ResourceManager.MachineLearning.MachineLearninRegistryComponentContainerResource GetMachineLearninRegistryComponentContainerResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MachineLearninRegistryComponentVersionResource GetMachineLearninRegistryComponentVersionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource(Azure.Core.ResourceIdentifier id) { throw null; } +<<<<<<< HEAD + public virtual Azure.ResourceManager.MachineLearning.ServerlessEndpointResource GetServerlessEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } +======= + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResource GetRaiBlocklistItemPropertiesBasicResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResource GetRaiBlocklistPropertiesBasicResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.MachineLearning.ServerlessEndpointResource GetServerlessEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceConnectionDeploymentResource GetWorkspaceConnectionDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceConnectionRaiPolicyResource GetWorkspaceConnectionRaiPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceEndpointDeploymentResource GetWorkspaceEndpointDeploymentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.MachineLearning.WorkspaceEndpointRaiPolicyResource GetWorkspaceEndpointRaiPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } public partial class MockableMachineLearningResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -2206,7 +2623,15 @@ protected MockableMachineLearningSubscriptionResource() { } public virtual Azure.AsyncPageable GetMachineLearningUsagesAsync(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetMachineLearningVmSizes(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetMachineLearningVmSizesAsync(Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } +<<<<<<< HEAD public virtual Azure.Pageable GetMachineLearningWorkspaces(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } +======= + public virtual Azure.Pageable GetMachineLearningWorkspaces(string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public virtual Azure.Pageable GetMachineLearningWorkspaces(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetMachineLearningWorkspacesAsync(string kind = null, string skip = null, string aiCapabilities = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public virtual Azure.AsyncPageable GetMachineLearningWorkspacesAsync(string skip = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable UpdateMachineLearningQuotas(Azure.Core.AzureLocation location, Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable UpdateMachineLearningQuotasAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -2233,6 +2658,20 @@ public AccessKeyAuthTypeWorkspaceConnectionProperties() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + public partial class AccountApiKeys : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AccountApiKeys() { } + public string Key1 { get { throw null; } } + public string Key2 { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.AccountApiKeys System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.AccountApiKeys System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class AccountKeyAuthTypeWorkspaceConnectionProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AccountKeyAuthTypeWorkspaceConnectionProperties() { } @@ -2243,6 +2682,28 @@ public AccountKeyAuthTypeWorkspaceConnectionProperties() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AllowedContentLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AllowedContentLevel(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel High { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel Low { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel Medium { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel left, Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel left, Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel right) { throw null; } + public override string ToString() { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class AmlCompute : Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public AmlCompute() { } @@ -2345,6 +2806,7 @@ public ApiKeyAuthWorkspaceConnectionProperties() { } } public static partial class ArmMachineLearningModelFactory { +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.AadAuthTypeWorkspaceConnectionProperties AadAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), string target = null, System.Collections.Generic.IDictionary metadata = null, System.Collections.Generic.IEnumerable sharedUserList = null, string value = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat? valueFormat = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.AccessKeyAuthTypeWorkspaceConnectionProperties AccessKeyAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), string target = null, System.Collections.Generic.IDictionary metadata = null, System.Collections.Generic.IEnumerable sharedUserList = null, string value = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat? valueFormat = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat?), Azure.ResourceManager.MachineLearning.Models.WorkspaceConnectionAccessKey credentials = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.AccountKeyAuthTypeWorkspaceConnectionProperties AccountKeyAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), string target = null, System.Collections.Generic.IDictionary metadata = null, System.Collections.Generic.IEnumerable sharedUserList = null, string value = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat? valueFormat = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat?), string credentialsKey = null) { throw null; } @@ -2372,15 +2834,70 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchDeploymentProperties MachineLearningBatchDeploymentProperties(string description = null, System.Collections.Generic.IDictionary properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, string compute = null, Azure.ResourceManager.MachineLearning.Models.BatchDeploymentConfiguration deploymentConfiguration = null, int? errorThreshold = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchRetrySettings retrySettings = null, long? miniBatchSize = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchLoggingLevel? loggingLevel = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchLoggingLevel?), Azure.ResourceManager.MachineLearning.Models.MachineLearningAssetReferenceBase model = null, int? maxConcurrencyPerInstance = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchOutputAction? outputAction = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchOutputAction?), string outputFileName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentResourceConfiguration resources = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningBatchEndpointData MachineLearningBatchEndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchEndpointProperties properties = null, string kind = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchEndpointProperties MachineLearningBatchEndpointProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Uri scoringUri = null, System.Uri swaggerUri = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode authMode = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode), Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthKeys keys = null, string defaultsDeploymentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState?)) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.AadAuthTypeWorkspaceConnectionProperties AadAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AccessKeyAuthTypeWorkspaceConnectionProperties AccessKeyAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.MachineLearning.Models.WorkspaceConnectionAccessKey credentials = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AccountApiKeys AccountApiKeys(string key1 = null, string key2 = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AccountKeyAuthTypeWorkspaceConnectionProperties AccountKeyAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsKey = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AmlCompute AmlCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.AmlComputeProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AmlComputeNodeInformation AmlComputeNodeInformation(string nodeId = null, System.Net.IPAddress privateIPAddress = null, System.Net.IPAddress publicIPAddress = null, int? port = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningNodeState? nodeState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningNodeState?), string runId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AmlComputeProperties AmlComputeProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningOSType? osType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOSType?), string vmSize = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningVmPriority? vmPriority = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningVmPriority?), string virtualMachineImageId = null, bool? isolatedNetwork = default(bool?), Azure.ResourceManager.MachineLearning.Models.AmlComputeScaleSettings scaleSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningUserAccountCredentials userAccountCredentials = null, Azure.Core.ResourceIdentifier subnetId = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningRemoteLoginPortPublicAccess? remoteLoginPortPublicAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningRemoteLoginPortPublicAccess?), Azure.ResourceManager.MachineLearning.Models.MachineLearningAllocationState? allocationState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningAllocationState?), System.DateTimeOffset? allocationStateTransitionOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errors = null, int? currentNodeCount = default(int?), int? targetNodeCount = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningNodeStateCounts nodeStateCounts = null, bool? enableNodePublicIP = default(bool?), System.BinaryData propertyBag = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ApiKeyAuthWorkspaceConnectionProperties ApiKeyAuthWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsKey = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.AutoMLJob AutoMLJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary outputs = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), Azure.ResourceManager.MachineLearning.Models.MachineLearningJobResourceConfiguration resources = null, Azure.ResourceManager.MachineLearning.Models.AutoMLVertical taskDetails = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.BlobReferenceForConsumptionDto BlobReferenceForConsumptionDto(System.Uri blobUri = null, Azure.ResourceManager.MachineLearning.Models.PendingUploadCredentialDto credential = null, Azure.Core.ResourceIdentifier storageAccountArmId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointDeploymentResourceProperties ContentSafetyEndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model = null, string raiPolicyName = null, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? versionUpgradeOption = default(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointResourceProperties ContentSafetyEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.CustomKeysWorkspaceConnectionProperties CustomKeysWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), System.Collections.Generic.IDictionary credentialsKeys = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.DockerCredential DockerCredential(string password = null, string userName = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties EndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), string endpointDeploymentResourcePropertiesType = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.EndpointDeploymentResourcePropertiesBasicResourceData EndpointDeploymentResourcePropertiesBasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointKeys EndpointKeys(Azure.ResourceManager.MachineLearning.Models.AccountApiKeys keys = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelDeprecationProperties EndpointModelDeprecationProperties(System.DateTimeOffset? fineTune = default(System.DateTimeOffset?), System.DateTimeOffset? inference = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelProperties EndpointModelProperties(System.Collections.Generic.IReadOnlyDictionary capabilities = null, Azure.ResourceManager.MachineLearning.Models.EndpointModelDeprecationProperties deprecation = null, System.Collections.Generic.IReadOnlyDictionary finetuneCapabilities = null, string format = null, bool? isDefaultVersion = default(bool?), Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus? lifecycleStatus = default(Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus?), int? maxCapacity = default(int?), string name = null, System.Collections.Generic.IEnumerable skus = null, Azure.ResourceManager.Models.SystemData systemData = null, string version = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuCapacityProperties EndpointModelSkuCapacityProperties(int? @default = default(int?), int? maximum = default(int?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuProperties EndpointModelSkuProperties(Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuCapacityProperties capacity = null, System.Collections.Generic.IEnumerable connectionIds = null, System.DateTimeOffset? deprecationOn = default(System.DateTimeOffset?), string name = null, System.Collections.Generic.IEnumerable rateLimits = null, string usageName = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitProperties EndpointModelSkuRateLimitProperties(float? count = default(float?), float? renewalPeriod = default(float?), System.Collections.Generic.IEnumerable rules = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRulePatternProperties EndpointModelSkuRateLimitRulePatternProperties(string method = null, string path = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRuleProperties EndpointModelSkuRateLimitRuleProperties(float? count = default(float?), bool? dynamicThrottlingEnabled = default(bool?), string key = null, System.Collections.Generic.IEnumerable matchPatterns = null, float? minCount = default(float?), float? renewalPeriod = default(float?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties EndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, string endpointType = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.EndpointResourcePropertiesBasicResourceData EndpointResourcePropertiesBasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.FeaturesetVersionBackfillResponse FeaturesetVersionBackfillResponse(System.Collections.Generic.IEnumerable jobIds = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningJob FineTuningJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), Azure.ResourceManager.MachineLearning.Models.FineTuningVertical fineTuningDetails = null, System.Collections.Generic.IEnumerable resourcesInstanceTypes = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), System.Collections.Generic.IDictionary outputs = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.FqdnOutboundRule FqdnOutboundRule(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? category = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory?), System.Collections.Generic.IEnumerable parentRuleNames = null, Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus?), string destination = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceForConsumptionDto GetBlobReferenceForConsumptionDto(System.Uri blobUri = null, Azure.ResourceManager.MachineLearning.Models.DataReferenceCredential credential = null, string storageAccountArmId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceSasResponseDto GetBlobReferenceSasResponseDto(Azure.ResourceManager.MachineLearning.Models.GetBlobReferenceForConsumptionDto blobReferenceForConsumption = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ImageMetadata ImageMetadata(string currentImageVersion = null, string latestImageVersion = null, bool? isLatestOSImageVersion = default(bool?), Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus osPatchingStatus = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAksCompute MachineLearningAksCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningAksComputeProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAksComputeProperties MachineLearningAksComputeProperties(string clusterFqdn = null, System.Collections.Generic.IEnumerable systemServices = null, int? agentCount = default(int?), string agentVmSize = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningClusterPurpose? clusterPurpose = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningClusterPurpose?), Azure.ResourceManager.MachineLearning.Models.MachineLearningSslConfiguration sslConfiguration = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningAksNetworkingConfiguration aksNetworkingConfiguration = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningLoadBalancerType? loadBalancerType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningLoadBalancerType?), string loadBalancerSubnet = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAksComputeSecrets MachineLearningAksComputeSecrets(string userKubeConfig = null, string adminKubeConfig = null, string imagePullSecretName = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAssetContainer MachineLearningAssetContainer(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), string accountName = null, string containerName = null, string endpoint = null, string protocol = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string resourceGroup = null, string subscriptionId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureDataLakeGen1Datastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string storeName = null, string resourceGroup = null, string subscriptionId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureDataLakeGen2Datastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), string accountName = null, string endpoint = null, string filesystem = null, string protocol = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string resourceGroup = null, string subscriptionId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningAzureFileDatastore MachineLearningAzureFileDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), string accountName = null, string endpoint = null, string fileShareName = null, string protocol = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?), string resourceGroup = null, string subscriptionId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningBatchDeploymentData MachineLearningBatchDeploymentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchDeploymentProperties properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchDeploymentProperties MachineLearningBatchDeploymentProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary properties = null, string compute = null, Azure.ResourceManager.MachineLearning.Models.BatchDeploymentConfiguration deploymentConfiguration = null, int? errorThreshold = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchLoggingLevel? loggingLevel = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchLoggingLevel?), int? maxConcurrencyPerInstance = default(int?), long? miniBatchSize = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningAssetReferenceBase model = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchOutputAction? outputAction = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchOutputAction?), string outputFileName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentResourceConfiguration resources = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchRetrySettings retrySettings = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningBatchEndpointData MachineLearningBatchEndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchEndpointProperties properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningBatchEndpointProperties MachineLearningBatchEndpointProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode authMode = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode), string description = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthKeys keys = null, System.Collections.Generic.IDictionary properties = null, System.Uri scoringUri = null, System.Uri swaggerUri = null, string defaultsDeploymentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState?)) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.MachineLearningCodeContainerData MachineLearningCodeContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeContainerProperties MachineLearningCodeContainerProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningCodeVersionData MachineLearningCodeVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeVersionProperties properties = null) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), bool? isAnonymous = default(bool?), System.Uri codeUri = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningCommandJob MachineLearningCommandJob(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string displayName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), string experimentName = null, System.Collections.Generic.IDictionary services = null, Azure.Core.ResourceIdentifier computeId = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, Azure.Core.ResourceIdentifier componentId = null, Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobResourceConfiguration resources = null, Azure.Core.ResourceIdentifier codeId = null, string command = null, Azure.Core.ResourceIdentifier environmentId = null, System.Collections.Generic.IDictionary inputs = null, System.Collections.Generic.IDictionary outputs = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDistributionConfiguration distribution = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCommandJobLimits limits = null, System.Collections.Generic.IDictionary environmentVariables = null, System.BinaryData parameters = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?)) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Uri codeUri = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningCommandJob MachineLearningCommandJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), Azure.Core.ResourceIdentifier codeId = null, string command = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDistributionConfiguration distribution = null, Azure.Core.ResourceIdentifier environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary inputs = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCommandJobLimits limits = null, System.Collections.Generic.IDictionary outputs = null, System.BinaryData parameters = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), Azure.ResourceManager.MachineLearning.Models.MachineLearningJobResourceConfiguration resources = null) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.MachineLearningComponentContainerData MachineLearningComponentContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentContainerProperties MachineLearningComponentContainerProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningComponentVersionData MachineLearningComponentVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentVersionProperties properties = null) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), bool? isAnonymous = default(bool?), System.BinaryData componentSpec = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.BinaryData componentSpec = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.MachineLearningComputeData MachineLearningComputeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstance MachineLearningComputeInstance(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceApplication MachineLearningComputeInstanceApplication(string displayName = null, System.Uri endpointUri = null) { throw null; } @@ -2388,7 +2905,6 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceContainer MachineLearningComputeInstanceContainer(string name = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceAutosave? autosave = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceAutosave?), string gpu = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningNetwork? network = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningNetwork?), Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceEnvironmentInfo environment = null, System.Collections.Generic.IEnumerable services = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceCreatedBy MachineLearningComputeInstanceCreatedBy(string userName = null, string userOrgId = null, string userId = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceDataDisk MachineLearningComputeInstanceDataDisk(Azure.ResourceManager.MachineLearning.Models.MachineLearningCachingType? caching = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningCachingType?), int? diskSizeGB = default(int?), int? lun = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningStorageAccountType? storageAccountType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningStorageAccountType?)) { throw null; } - public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceDataMount MachineLearningComputeInstanceDataMount(string source = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSourceType? sourceType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningSourceType?), string mountName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningMountAction? mountAction = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningMountAction?), string createdBy = null, string mountPath = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningMountState? mountState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningMountState?), System.DateTimeOffset? mountedOn = default(System.DateTimeOffset?), string error = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceEnvironmentInfo MachineLearningComputeInstanceEnvironmentInfo(string name = null, string version = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceLastOperation MachineLearningComputeInstanceLastOperation(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName? operationName = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName?), System.DateTimeOffset? operationOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus? operationStatus = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationTrigger? operationTrigger = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationTrigger?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceSshSettings MachineLearningComputeInstanceSshSettings(Azure.ResourceManager.MachineLearning.Models.MachineLearningSshPublicAccess? sshPublicAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningSshPublicAccess?), string adminUserName = null, int? sshPort = default(int?), string adminPublicKey = null) { throw null; } @@ -2403,7 +2919,11 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDataFactoryCompute MachineLearningDataFactoryCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDataLakeAnalytics MachineLearningDataLakeAnalytics(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), string dataLakeStoreAccountName = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningDatastoreData MachineLearningDatastoreData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreProperties properties = null) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string datastoreType = null, bool? isDefault = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, string datastoreType = null, bool? isDefault = default(bool?)) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.MachineLearningDataVersionData MachineLearningDataVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDataVersionProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentLogs MachineLearningDeploymentLogs(string content = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningDiagnoseResult MachineLearningDiagnoseResult(string code = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDiagnoseResultLevel? level = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDiagnoseResultLevel?), string message = null) { throw null; } @@ -2414,34 +2934,58 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.MachineLearningEnvironmentContainerData MachineLearningEnvironmentContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentContainerProperties MachineLearningEnvironmentContainerProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningEnvironmentVersionData MachineLearningEnvironmentVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentVersionProperties properties = null) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), bool? isAnonymous = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentType? environmentType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentType?), string image = null, string condaFile = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningBuildContext build = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOperatingSystemType? osType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperatingSystemType?), Azure.ResourceManager.MachineLearning.Models.MachineLearningInferenceContainerProperties inferenceConfig = null, Azure.ResourceManager.MachineLearning.Models.AutoRebuildSetting? autoRebuild = default(Azure.ResourceManager.MachineLearning.Models.AutoRebuildSetting?), Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.AutoRebuildSetting? autoRebuild = default(Azure.ResourceManager.MachineLearning.Models.AutoRebuildSetting?), Azure.ResourceManager.MachineLearning.Models.MachineLearningBuildContext build = null, string condaFile = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentType? environmentType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEnvironmentType?), string image = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningInferenceContainerProperties inferenceConfig = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOperatingSystemType? osType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningOperatingSystemType?), Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.Models.MachineLearningError MachineLearningError(Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningEstimatedVmPrice MachineLearningEstimatedVmPrice(double retailPrice = 0, Azure.ResourceManager.MachineLearning.Models.MachineLearningVmPriceOSType osType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningVmPriceOSType), Azure.ResourceManager.MachineLearning.Models.MachineLearningVmTier vmTier = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningVmTier)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningEstimatedVmPrices MachineLearningEstimatedVmPrices(Azure.ResourceManager.MachineLearning.Models.MachineLearningBillingCurrency billingCurrency = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningBillingCurrency), Azure.ResourceManager.MachineLearning.Models.MachineLearningUnitOfMeasure unitOfMeasure = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningUnitOfMeasure), System.Collections.Generic.IEnumerable values = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningFeatureData MachineLearningFeatureData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningFeatureSetContainerData MachineLearningFeatureSetContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetContainerProperties properties = null) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetContainerProperties MachineLearningFeatureSetContainerProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningFeatureSetVersionData MachineLearningFeatureSetVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetVersionProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), bool? isAnonymous = default(bool?), string specificationPath = null, Azure.ResourceManager.MachineLearning.Models.MaterializationSettings materializationSettings = null, string stage = null, System.Collections.Generic.IEnumerable entities = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetContainerProperties MachineLearningFeatureSetContainerProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningFeatureSetVersionData MachineLearningFeatureSetVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetVersionProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Collections.Generic.IEnumerable entities = null, Azure.ResourceManager.MachineLearning.Models.MaterializationSettings materializationSettings = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string specificationPath = null, string stage = null) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.MachineLearningFeatureStoreEntityContainerData MachineLearningFeatureStoreEntityContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureStoreEntityContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureStoreEntityContainerProperties MachineLearningFeatureStoreEntityContainerProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningFeaturestoreEntityVersionData MachineLearningFeaturestoreEntityVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureStoreEntityVersionProperties properties = null) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), bool? isAnonymous = default(bool?), System.Collections.Generic.IEnumerable indexColumns = null, string stage = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Collections.Generic.IEnumerable indexColumns = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFqdnEndpoint MachineLearningFqdnEndpoint(string domainName = null, System.Collections.Generic.IEnumerable endpointDetails = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFqdnEndpointDetail MachineLearningFqdnEndpointDetail(int? port = default(int?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFqdnEndpoints MachineLearningFqdnEndpoints(Azure.ResourceManager.MachineLearning.Models.MachineLearningFqdnEndpointsProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFqdnEndpointsProperties MachineLearningFqdnEndpointsProperties(string category = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningHDInsightCompute MachineLearningHDInsightCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningHDInsightProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningJobData MachineLearningJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties properties = null) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties MachineLearningJobProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string jobType = null, string displayName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), string experimentName = null, System.Collections.Generic.IDictionary services = null, Azure.Core.ResourceIdentifier computeId = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, Azure.Core.ResourceIdentifier componentId = null, Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobService MachineLearningJobService(string jobServiceType = null, int? port = default(int?), string endpoint = null, string status = null, string errorMessage = null, System.Collections.Generic.IDictionary properties = null, Azure.ResourceManager.MachineLearning.Models.JobNodes nodes = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningKubernetesCompute MachineLearningKubernetesCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningKubernetesProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningKubernetesOnlineDeployment MachineLearningKubernetesOnlineDeployment(string description = null, System.Collections.Generic.IDictionary properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineScaleSettings scaleSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineRequestSettings requestSettings = null, string modelMountPath = null, bool? appInsightsEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings livenessProbe = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings readinessProbe = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?), string instanceType = null, string model = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType?), Azure.ResourceManager.MachineLearning.Models.DataCollector dataCollector = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningContainerResourceRequirements containerResourceRequirements = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningManagedIdentityAuthTypeWorkspaceConnection MachineLearningManagedIdentityAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), string target = null, System.Collections.Generic.IDictionary metadata = null, System.Collections.Generic.IEnumerable sharedUserList = null, string value = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat? valueFormat = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat?), Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionManagedIdentity credentials = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningManagedOnlineDeployment MachineLearningManagedOnlineDeployment(string description = null, System.Collections.Generic.IDictionary properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineScaleSettings scaleSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineRequestSettings requestSettings = null, string modelMountPath = null, bool? appInsightsEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings livenessProbe = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings readinessProbe = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?), string instanceType = null, string model = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType?), Azure.ResourceManager.MachineLearning.Models.DataCollector dataCollector = null) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties MachineLearningJobProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), string jobType = null, Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningJobService MachineLearningJobService(string endpoint = null, string errorMessage = null, string jobServiceType = null, Azure.ResourceManager.MachineLearning.Models.JobNodes nodes = null, int? port = default(int?), System.Collections.Generic.IDictionary properties = null, string status = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningKubernetesCompute MachineLearningKubernetesCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningKubernetesProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningKubernetesOnlineDeployment MachineLearningKubernetesOnlineDeployment(Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary properties = null, bool? appInsightsEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.DataCollector dataCollector = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType?), string instanceType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings livenessProbe = null, string model = null, string modelMountPath = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings readinessProbe = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineRequestSettings requestSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineScaleSettings scaleSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningContainerResourceRequirements containerResourceRequirements = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningManagedIdentityAuthTypeWorkspaceConnection MachineLearningManagedIdentityAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionManagedIdentity credentials = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningManagedOnlineDeployment MachineLearningManagedOnlineDeployment(Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary properties = null, bool? appInsightsEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.DataCollector dataCollector = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType?), string instanceType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings livenessProbe = null, string model = null, string modelMountPath = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings readinessProbe = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineRequestSettings requestSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineScaleSettings scaleSettings = null) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.MachineLearningModelContainerData MachineLearningModelContainerData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningModelContainerProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningModelContainerProperties MachineLearningModelContainerProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), string latestVersion = null, string nextVersion = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningModelVersionData MachineLearningModelVersionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningModelVersionProperties properties = null) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, bool? isArchived = default(bool?), bool? isAnonymous = default(bool?), System.Collections.Generic.IDictionary flavors = null, string modelType = null, System.Uri modelUri = null, string jobName = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningNodeStateCounts MachineLearningNodeStateCounts(int? idleNodeCount = default(int?), int? runningNodeCount = default(int?), int? preparingNodeCount = default(int?), int? unusableNodeCount = default(int?), int? leavingNodeCount = default(int?), int? preemptedNodeCount = default(int?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningNoneAuthTypeWorkspaceConnection MachineLearningNoneAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), string target = null, System.Collections.Generic.IDictionary metadata = null, System.Collections.Generic.IEnumerable sharedUserList = null, string value = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat? valueFormat = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat?)) { throw null; } @@ -2461,29 +3005,66 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceName MachineLearningResourceName(string value = null, string localizedValue = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceQuota MachineLearningResourceQuota(string id = null, string amlWorkspaceLocation = null, string resourceQuotaType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceName name = null, long? limit = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit? unit = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSasAuthTypeWorkspaceConnection MachineLearningSasAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), string target = null, System.Collections.Generic.IDictionary metadata = null, System.Collections.Generic.IEnumerable sharedUserList = null, string value = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat? valueFormat = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat?), string credentialsSas = null) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, bool? isAnonymous = default(bool?), bool? isArchived = default(bool?), System.Collections.Generic.IDictionary flavors = null, string jobName = null, string modelType = null, System.Uri modelUri = null, Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.RegistryAssetProvisioningState?), string stage = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningNodeStateCounts MachineLearningNodeStateCounts(int? idleNodeCount = default(int?), int? runningNodeCount = default(int?), int? preparingNodeCount = default(int?), int? unusableNodeCount = default(int?), int? leavingNodeCount = default(int?), int? preemptedNodeCount = default(int?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningNoneAuthTypeWorkspaceConnection MachineLearningNoneAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningNotebookPreparationError MachineLearningNotebookPreparationError(string errorMessage = null, int? statusCode = default(int?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningNotebookResourceInfo MachineLearningNotebookResourceInfo(string fqdn = null, bool? isPrivateLinkEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningNotebookPreparationError notebookPreparationError = null, string resourceId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningOnlineDeploymentData MachineLearningOnlineDeploymentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineDeploymentProperties properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineDeploymentProperties MachineLearningOnlineDeploymentProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IDictionary properties = null, bool? appInsightsEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.DataCollector dataCollector = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEgressPublicNetworkAccessType?), string endpointComputeType = null, string instanceType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings livenessProbe = null, string model = null, string modelMountPath = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningDeploymentProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProbeSettings readinessProbe = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineRequestSettings requestSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineScaleSettings scaleSettings = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningOnlineEndpointData MachineLearningOnlineEndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineEndpointProperties properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOnlineEndpointProperties MachineLearningOnlineEndpointProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode authMode = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode), string description = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthKeys keys = null, System.Collections.Generic.IDictionary properties = null, System.Uri scoringUri = null, System.Uri swaggerUri = null, string compute = null, System.Collections.Generic.IDictionary mirrorTraffic = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType? publicNetworkAccess = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType?), System.Collections.Generic.IDictionary traffic = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOutboundRule MachineLearningOutboundRule(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? category = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory?), System.Collections.Generic.IEnumerable parentRuleNames = null, Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus?), string outboundRuleType = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningOutboundRuleBasicData MachineLearningOutboundRuleBasicData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningOutboundRule properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPasswordDetail MachineLearningPasswordDetail(string name = null, string value = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPatAuthTypeWorkspaceConnection MachineLearningPatAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsPat = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPipelineJob MachineLearningPipelineJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), System.Collections.Generic.IDictionary inputs = null, System.Collections.Generic.IDictionary jobs = null, System.Collections.Generic.IDictionary outputs = null, System.BinaryData settings = null, Azure.Core.ResourceIdentifier sourceJobId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpoint MachineLearningPrivateEndpoint(Azure.Core.ResourceIdentifier id = null, Azure.Core.ResourceIdentifier subnetArmId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningPrivateEndpointConnectionData MachineLearningPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpoint privateEndpoint = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateEndpointConnectionProvisioningState?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningPrivateLinkResource MachineLearningPrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningRegistryData MachineLearningRegistryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, System.Uri discoveryUri = null, string intellectualPropertyPublisher = null, Azure.Core.ResourceIdentifier managedResourceId = null, System.Collections.Generic.IEnumerable managedResourceGroupAssignedIdentities = null, System.Uri mlFlowRegistryUri = null, System.Collections.Generic.IEnumerable registryPrivateEndpointConnections = null, string publicNetworkAccess = null, System.Collections.Generic.IEnumerable regionDetails = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceName MachineLearningResourceName(string value = null, string localizedValue = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceQuota MachineLearningResourceQuota(string id = null, string amlWorkspaceLocation = null, string resourceQuotaType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningResourceName name = null, long? limit = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit? unit = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSasAuthTypeWorkspaceConnection MachineLearningSasAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), string credentialsSas = null) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.MachineLearningScheduleData MachineLearningScheduleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProperties MachineLearningScheduleProperties(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string displayName = null, bool? isEnabled = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningTriggerBase trigger = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleAction action = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProvisioningStatus? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningScheduleProvisioningStatus?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuCapacity MachineLearningSkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? @default = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuScaleType? scaleType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuScaleType?)) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuDetail MachineLearningSkuDetail(string resourceType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuSetting sku = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuCapacity capacity = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuSetting MachineLearningSkuSetting(string name = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuTier? tier = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningSkuTier?)) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSweepJob MachineLearningSweepJob(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string displayName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), string experimentName = null, System.Collections.Generic.IDictionary services = null, Azure.Core.ResourceIdentifier computeId = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, Azure.Core.ResourceIdentifier componentId = null, Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.BinaryData searchSpace = null, Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithm samplingAlgorithm = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSweepJobLimits limits = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEarlyTerminationPolicy earlyTermination = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningObjective objective = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTrialComponent trial = null, System.Collections.Generic.IDictionary inputs = null, System.Collections.Generic.IDictionary outputs = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?)) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSweepJob MachineLearningSweepJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEarlyTerminationPolicy earlyTermination = null, System.Collections.Generic.IDictionary inputs = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSweepJobLimits limits = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningObjective objective = null, System.Collections.Generic.IDictionary outputs = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithm samplingAlgorithm = null, System.BinaryData searchSpace = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTrialComponent trial = null) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.Models.MachineLearningSynapseSpark MachineLearningSynapseSpark(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningSynapseSparkProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningUsage MachineLearningUsage(string id = null, string amlWorkspaceLocation = null, string usageType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningUsageUnit? unit = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningUsageUnit?), long? currentValue = default(long?), long? limit = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningUsageName name = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningUsageName MachineLearningUsageName(string value = null, string localizedValue = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningUserFeature MachineLearningUserFeature(string id = null, string displayName = null, string description = null) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningUsernamePasswordAuthTypeWorkspaceConnection MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), string target = null, System.Collections.Generic.IDictionary metadata = null, System.Collections.Generic.IEnumerable sharedUserList = null, string value = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat? valueFormat = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat?), Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionUsernamePassword credentials = null) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningUsernamePasswordAuthTypeWorkspaceConnection MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionUsernamePassword credentials = null) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.Models.MachineLearningVirtualMachineCompute MachineLearningVirtualMachineCompute(string computeLocation = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), string description = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? modifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier resourceId = null, System.Collections.Generic.IEnumerable provisioningErrors = null, bool? isAttachedCompute = default(bool?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningVirtualMachineProperties properties = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningVirtualMachineSecrets MachineLearningVirtualMachineSecrets(Azure.ResourceManager.MachineLearning.Models.MachineLearningVmSshCredentials administratorAccount = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningVmSize MachineLearningVmSize(string name = null, string family = null, int? vCpus = default(int?), int? gpus = default(int?), int? osVhdSizeMB = default(int?), int? maxResourceVolumeMB = default(int?), double? memoryGB = default(double?), bool? lowPriorityCapable = default(bool?), bool? isPremiumIOSupported = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEstimatedVmPrices estimatedVmPrices = null, System.Collections.Generic.IEnumerable supportedComputeTypes = null) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceConnectionData MachineLearningWorkspaceConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties properties = null) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties MachineLearningWorkspaceConnectionProperties(string authType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), string target = null, System.Collections.Generic.IDictionary metadata = null, System.Collections.Generic.IEnumerable sharedUserList = null, string value = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat? valueFormat = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningValueFormat?)) { throw null; } public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceData MachineLearningWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, string workspaceId = null, string description = null, string friendlyName = null, string keyVault = null, string applicationInsights = null, string containerRegistry = null, string storageAccount = null, System.Uri discoveryUri = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEncryptionSetting encryption = null, bool? isHbiWorkspace = default(bool?), string serviceProvisionedResourceGroup = null, int? privateLinkCount = default(int?), string imageBuildCompute = null, bool? allowPublicAccessWhenBehindVnet = default(bool?), Azure.ResourceManager.MachineLearning.Models.PublicNetworkAccess? publicNetworkAccessType = default(Azure.ResourceManager.MachineLearning.Models.PublicNetworkAccess?), System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings serverlessComputeSettings = null, System.Collections.Generic.IEnumerable sharedPrivateLinkResources = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningNotebookResourceInfo notebookInfo = null, int? cosmosDbCollectionsThroughput = default(int?), string primaryUserAssignedIdentity = null, System.Guid? tenantId = default(System.Guid?), bool? isStorageHnsEnabled = default(bool?), System.Uri mlFlowTrackingUri = null, bool? isV1LegacyMode = default(bool?), Azure.ResourceManager.MachineLearning.Models.ManagedNetworkSettings managedNetwork = null, Azure.ResourceManager.MachineLearning.Models.FeatureStoreSettings featureStoreSettings = null, System.Collections.Generic.IEnumerable associatedWorkspaces = null, bool? enableDataIsolation = default(bool?), Azure.Core.ResourceIdentifier hubResourceId = null, Azure.ResourceManager.MachineLearning.Models.WorkspaceHubConfig workspaceHubConfig = null) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties MachineLearningWorkspaceConnectionProperties(string authType = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.MachineLearningWorkspaceData MachineLearningWorkspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null, bool? allowPublicAccessWhenBehindVnet = default(bool?), bool? allowRoleAssignmentOnRG = default(bool?), string applicationInsights = null, System.Collections.Generic.IEnumerable associatedWorkspaces = null, System.Collections.Generic.IEnumerable containerRegistries = null, string containerRegistry = null, string description = null, System.Uri discoveryUri = null, bool? enableDataIsolation = default(bool?), bool? enableServiceSideCMKEncryption = default(bool?), bool? enableSimplifiedCmk = default(bool?), bool? enableSoftwareBillOfMaterials = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEncryptionSetting encryption = null, System.Collections.Generic.IEnumerable existingWorkspaces = null, Azure.ResourceManager.MachineLearning.Models.FeatureStoreSettings featureStoreSettings = null, string friendlyName = null, bool? isHbiWorkspace = default(bool?), Azure.Core.ResourceIdentifier hubResourceId = null, string imageBuildCompute = null, System.Collections.Generic.IEnumerable ipAllowlist = null, string keyVault = null, System.Collections.Generic.IEnumerable keyVaults = null, Azure.ResourceManager.MachineLearning.Models.ManagedNetworkSettings managedNetwork = null, System.Uri mlFlowTrackingUri = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningNotebookResourceInfo notebookInfo = null, string primaryUserAssignedIdentity = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, int? privateLinkCount = default(int?), Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType? publicNetworkAccessType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType?), Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings serverlessComputeSettings = null, int? cosmosDbCollectionsThroughput = default(int?), string serviceProvisionedResourceGroup = null, System.Collections.Generic.IEnumerable sharedPrivateLinkResources = null, int? softDeleteRetentionInDays = default(int?), string storageAccount = null, System.Collections.Generic.IEnumerable storageAccounts = null, bool? isStorageHnsEnabled = default(bool?), string systemDatastoresAuthMode = null, System.Guid? tenantId = default(System.Guid?), bool? isV1LegacyMode = default(bool?), Azure.ResourceManager.MachineLearning.Models.WorkspaceHubConfig workspaceHubConfig = null, string workspaceId = null) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceDiagnoseResult MachineLearningWorkspaceDiagnoseResult(Azure.ResourceManager.MachineLearning.Models.MachineLearningDiagnoseResultValue value = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceGetKeysResult MachineLearningWorkspaceGetKeysResult(string userStorageKey = null, string userStorageResourceId = null, string appInsightsInstrumentationKey = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningContainerRegistryCredentials containerRegistryCredentials = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceGetNotebookKeysResult notebookAccessKeys = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceGetNotebookKeysResult MachineLearningWorkspaceGetNotebookKeysResult(string primaryAccessKey = null, string secondaryAccessKey = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceGetStorageAccountKeysResult MachineLearningWorkspaceGetStorageAccountKeysResult(string userStorageKey = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceNotebookAccessTokenResult MachineLearningWorkspaceNotebookAccessTokenResult(string notebookResourceId = null, string hostName = null, string publicDns = null, string accessToken = null, string tokenType = null, int? expiresIn = default(int?), string refreshToken = null, string scope = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceQuotaUpdate MachineLearningWorkspaceQuotaUpdate(string id = null, string updateWorkspaceQuotasType = null, long? limit = default(long?), Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit? unit = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningQuotaUnit?), Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceQuotaStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceQuotaStatus?)) { throw null; } +<<<<<<< HEAD public static Azure.ResourceManager.MachineLearning.Models.ManagedIdentityCredential ManagedIdentityCredential(string managedIdentityType = null, string userManagedIdentityResourceId = null, string userManagedIdentityClientId = null, string userManagedIdentityPrincipalId = null, string userManagedIdentityTenantId = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.ManagedNetworkSettings ManagedNetworkSettings(Azure.ResourceManager.MachineLearning.Models.IsolationMode? isolationMode = default(Azure.ResourceManager.MachineLearning.Models.IsolationMode?), string networkId = null, System.Collections.Generic.IDictionary outboundRules = null, Azure.ResourceManager.MachineLearning.Models.ManagedNetworkProvisionStatus status = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.MarketplacePlan MarketplacePlan(string publisherId = null, string offerId = null, string planId = null) { throw null; } @@ -2504,6 +3085,43 @@ public static partial class ArmMachineLearningModelFactory public static Azure.ResourceManager.MachineLearning.Models.SparkJob SparkJob(string description = null, System.Collections.Generic.IDictionary tags = null, System.Collections.Generic.IDictionary properties = null, string displayName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), string experimentName = null, System.Collections.Generic.IDictionary services = null, Azure.Core.ResourceIdentifier computeId = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, Azure.Core.ResourceIdentifier componentId = null, Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, Azure.ResourceManager.MachineLearning.Models.SparkResourceConfiguration resources = null, string args = null, Azure.Core.ResourceIdentifier codeId = null, Azure.ResourceManager.MachineLearning.Models.SparkJobEntry entry = null, Azure.Core.ResourceIdentifier environmentId = null, System.Collections.Generic.IDictionary inputs = null, System.Collections.Generic.IDictionary outputs = null, System.Collections.Generic.IEnumerable pyFiles = null, System.Collections.Generic.IEnumerable jars = null, System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IEnumerable archives = null, System.Collections.Generic.IDictionary conf = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), System.Collections.Generic.IDictionary environmentVariables = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.TextClassificationMultilabel TextClassificationMultilabel(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity? logVerbosity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity?), Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData = null, string targetColumnName = null, Azure.ResourceManager.MachineLearning.Models.ClassificationMultilabelPrimaryMetric? primaryMetric = default(Azure.ResourceManager.MachineLearning.Models.ClassificationMultilabelPrimaryMetric?), Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings limitSettings = null, string featurizationDatasetLanguage = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput validationData = null) { throw null; } public static Azure.ResourceManager.MachineLearning.Models.TextNer TextNer(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity? logVerbosity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity?), Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData = null, string targetColumnName = null, Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric? primaryMetric = default(Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric?), Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings limitSettings = null, string featurizationDatasetLanguage = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput validationData = null) { throw null; } +======= + public static Azure.ResourceManager.MachineLearning.Models.ManagedIdentityCredential ManagedIdentityCredential(string managedIdentityType = null, string userManagedIdentityClientId = null, string userManagedIdentityPrincipalId = null, string userManagedIdentityResourceId = null, string userManagedIdentityTenantId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedNetworkSettings ManagedNetworkSettings(Azure.ResourceManager.MachineLearning.Models.IsolationMode? isolationMode = default(Azure.ResourceManager.MachineLearning.Models.IsolationMode?), string networkId = null, System.Collections.Generic.IDictionary outboundRules = null, Azure.ResourceManager.MachineLearning.Models.ManagedNetworkProvisionStatus status = null, System.Collections.Generic.IEnumerable changeableIsolationModes = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointDeploymentResourceProperties ManagedOnlineEndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointComputeType? endpointComputeType = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointComputeType?), string model = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointResourceProperties ManagedOnlineEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?), Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode? authMode = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode?), string compute = null, string description = null, System.Collections.Generic.IDictionary mirrorTraffic = null, System.Uri scoringUri = null, System.Collections.Generic.IDictionary traffic = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedResourceGroupAssignedIdentities ManagedResourceGroupAssignedIdentities(System.Guid? principalId = default(System.Guid?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MarketplacePlan MarketplacePlan(string offerId = null, string planId = null, string publisherId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.MarketplaceSubscriptionData MarketplaceSubscriptionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProperties MarketplaceSubscriptionProperties(Azure.ResourceManager.MachineLearning.Models.MarketplacePlan marketplacePlan = null, Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionStatus?), string modelId = null, Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MarketplaceSubscriptionProvisioningState?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OAuth2AuthTypeWorkspaceConnectionProperties OAuth2AuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.MachineLearning.Models.WorkspaceConnectionOAuth2 credentials = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OneLakeDatastore OneLakeDatastore(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningDatastoreCredentials credentials = null, bool? isDefault = default(bool?), Azure.ResourceManager.MachineLearning.Models.OneLakeArtifact artifact = null, string endpoint = null, string oneLakeWorkspaceName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningServiceDataAccessAuthIdentity?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointDeploymentResourceProperties OpenAIEndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model = null, string raiPolicyName = null, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? versionUpgradeOption = default(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointResourceProperties OpenAIEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus OSPatchingStatus(Azure.ResourceManager.MachineLearning.Models.PatchStatus? patchStatus = default(Azure.ResourceManager.MachineLearning.Models.PatchStatus?), System.DateTimeOffset? latestPatchOn = default(System.DateTimeOffset?), bool? rebootPending = default(bool?), System.DateTimeOffset? scheduledRebootOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable osPatchingErrors = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.PendingUploadResponseDto PendingUploadResponseDto(Azure.ResourceManager.MachineLearning.Models.BlobReferenceForConsumptionDto blobReferenceForConsumption = null, string pendingUploadId = null, Azure.ResourceManager.MachineLearning.Models.PendingUploadType? pendingUploadType = default(Azure.ResourceManager.MachineLearning.Models.PendingUploadType?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.PrivateEndpointBase PrivateEndpointBase(Azure.Core.ResourceIdentifier id = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.PrivateEndpointOutboundRule PrivateEndpointOutboundRule(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? category = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory?), System.Collections.Generic.IEnumerable parentRuleNames = null, Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus?), Azure.ResourceManager.MachineLearning.Models.PrivateEndpointDestination destination = null, System.Collections.Generic.IEnumerable fqdns = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.RaiBlocklistItemPropertiesBasicResourceData RaiBlocklistItemPropertiesBasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.RaiBlocklistPropertiesBasicResourceData RaiBlocklistPropertiesBasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string raiBlocklistDescription = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.RaiPolicyPropertiesBasicResourceData RaiPolicyPropertiesBasicResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.MachineLearning.Models.RaiPolicyProperties properties = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.RegistryPrivateEndpoint RegistryPrivateEndpoint(Azure.Core.ResourceIdentifier id = null, Azure.Core.ResourceIdentifier subnetArmId = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.SasCredential SasCredential(System.Uri sasUri = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.SasCredentialDto SasCredentialDto(System.Uri sasUri = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.ServerlessEndpointData ServerlessEndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, string kind = null, Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointProperties properties = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningSku sku = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointInferenceEndpoint ServerlessEndpointInferenceEndpoint(System.Collections.Generic.IReadOnlyDictionary headers = null, System.Uri uri = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointProperties ServerlessEndpointProperties(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode authMode = default(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode), Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus? contentSafetyStatus = default(Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus?), Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState? endpointState = default(Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState?), Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpoint inferenceEndpoint = null, string marketplaceSubscriptionId = null, string modelId = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointProvisioningState?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointResourceProperties ServerlessEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?), Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode? authMode = default(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode?), Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointCapacityReservation capacityReservation = null, Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus? contentSafetyStatus = default(Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus?), Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState? endpointState = default(Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState?), Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointInferenceEndpoint inferenceEndpoint = null, string marketplaceSubscriptionId = null, System.BinaryData metadata = null, string modelId = null, Azure.ResourceManager.MachineLearning.Models.ServerlessOffer offer = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpoint ServerlessInferenceEndpoint(System.Collections.Generic.IReadOnlyDictionary headers = null, System.Uri uri = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServicePrincipalAuthTypeWorkspaceConnectionProperties ServicePrincipalAuthTypeWorkspaceConnectionProperties(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? category = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory?), Azure.Core.ResourceIdentifier createdByWorkspaceArmId = null, string error = null, System.DateTimeOffset? expiryOn = default(System.DateTimeOffset?), Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? group = default(Azure.ResourceManager.MachineLearning.Models.ConnectionGroup?), bool? isSharedToAll = default(bool?), System.Collections.Generic.IDictionary metadata = null, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? peRequirement = default(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement?), Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? peStatus = default(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus?), System.Collections.Generic.IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = default(bool?), Azure.ResourceManager.MachineLearning.Models.WorkspaceConnectionServicePrincipal credentials = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServiceTagDestination ServiceTagDestination(Azure.ResourceManager.MachineLearning.Models.NetworkingRuleAction? action = default(Azure.ResourceManager.MachineLearning.Models.NetworkingRuleAction?), System.Collections.Generic.IEnumerable addressPrefixes = null, string portRanges = null, string protocol = null, string serviceTag = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServiceTagOutboundRule ServiceTagOutboundRule(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? category = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory?), System.Collections.Generic.IEnumerable parentRuleNames = null, Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? status = default(Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus?), Azure.ResourceManager.MachineLearning.Models.ServiceTagDestination destination = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.SparkJob SparkJob(string description = null, System.Collections.Generic.IDictionary properties = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.ResourceIdentifier componentId = null, Azure.Core.ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningIdentityConfiguration identity = null, bool? isArchived = default(bool?), Azure.ResourceManager.MachineLearning.Models.NotificationSetting notificationSetting = null, System.Collections.Generic.IDictionary services = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus? status = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobStatus?), System.Collections.Generic.IEnumerable archives = null, string args = null, Azure.Core.ResourceIdentifier codeId = null, System.Collections.Generic.IDictionary conf = null, Azure.ResourceManager.MachineLearning.Models.SparkJobEntry entry = null, Azure.Core.ResourceIdentifier environmentId = null, System.Collections.Generic.IDictionary environmentVariables = null, System.Collections.Generic.IEnumerable files = null, System.Collections.Generic.IDictionary inputs = null, System.Collections.Generic.IEnumerable jars = null, System.Collections.Generic.IDictionary outputs = null, System.Collections.Generic.IEnumerable pyFiles = null, Azure.ResourceManager.MachineLearning.Models.JobTier? queueJobTier = default(Azure.ResourceManager.MachineLearning.Models.JobTier?), Azure.ResourceManager.MachineLearning.Models.SparkResourceConfiguration resources = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.SpeechEndpointDeploymentResourceProperties SpeechEndpointDeploymentResourceProperties(string failureReason = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model = null, string raiPolicyName = null, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? versionUpgradeOption = default(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.SpeechEndpointResourceProperties SpeechEndpointResourceProperties(Azure.Core.ResourceIdentifier associatedResourceId = null, System.Collections.Generic.IEnumerable deployments = null, System.Uri endpointUri = null, string failureReason = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string name = null, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? provisioningState = default(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState?), bool? shouldCreateAiServicesEndpoint = default(bool?)) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.TextClassificationMultilabel TextClassificationMultilabel(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity? logVerbosity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity?), string targetColumnName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData = null, Azure.ResourceManager.MachineLearning.Models.ClassificationMultilabelPrimaryMetric? primaryMetric = default(Azure.ResourceManager.MachineLearning.Models.ClassificationMultilabelPrimaryMetric?), string featurizationDatasetLanguage = null, Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings limitSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput validationData = null) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.TextNer TextNer(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity? logVerbosity = default(Azure.ResourceManager.MachineLearning.Models.MachineLearningLogVerbosity?), string targetColumnName = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData = null, Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric? primaryMetric = default(Azure.ResourceManager.MachineLearning.Models.ClassificationPrimaryMetric?), string featurizationDatasetLanguage = null, Azure.ResourceManager.MachineLearning.Models.NlpVerticalLimitSettings limitSettings = null, Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput validationData = null) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } public partial class AutoForecastHorizon : Azure.ResourceManager.MachineLearning.Models.ForecastHorizon, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -2670,6 +3288,31 @@ public AzureDevOpsWebhook() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + public partial class AzureOpenAiFineTuning : Azure.ResourceManager.MachineLearning.Models.FineTuningVertical, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureOpenAiFineTuning(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType taskType, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput trainingData, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput model) : base (default(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType), default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput), default(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput)) { } + public Azure.ResourceManager.MachineLearning.Models.AzureOpenAiHyperParameters HyperParameters { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.AzureOpenAiFineTuning System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.AzureOpenAiFineTuning System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzureOpenAiHyperParameters : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzureOpenAiHyperParameters() { } + public int? BatchSize { get { throw null; } set { } } + public double? LearningRateMultiplier { get { throw null; } set { } } + public int? NEpochs { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.AzureOpenAiHyperParameters System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.AzureOpenAiHyperParameters System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class BanditPolicy : Azure.ResourceManager.MachineLearning.Models.MachineLearningEarlyTerminationPolicy, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public BanditPolicy() { } @@ -3091,6 +3734,30 @@ public ContainerEndpoint() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + public partial class ContentSafetyEndpointDeploymentResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContentSafetyEndpointDeploymentResourceProperties(Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model) { } + public Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel Model { get { throw null; } set { } } + public string RaiPolicyName { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointDeploymentResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointDeploymentResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContentSafetyEndpointResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContentSafetyEndpointResourceProperties() { } + Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ContentSafetyEndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ContentSafetyStatus : System.IEquatable { @@ -3160,6 +3827,16 @@ public CustomMetricThreshold(string metric) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class CustomModelFineTuning : Azure.ResourceManager.MachineLearning.Models.FineTuningVertical, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CustomModelFineTuning(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType taskType, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput trainingData, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput model) : base (default(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType), default(Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput), default(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput)) { } + public System.Collections.Generic.IDictionary HyperParameters { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.CustomModelFineTuning System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.CustomModelFineTuning System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class CustomMonitoringSignal : Azure.ResourceManager.MachineLearning.Models.MonitoringSignalBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CustomMonitoringSignal(string componentId, System.Collections.Generic.IEnumerable metricThresholds) { } @@ -3201,6 +3878,7 @@ public CustomService() { } public System.Collections.Generic.IList Endpoints { get { throw null; } } public System.Collections.Generic.IDictionary EnvironmentVariables { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.ImageSetting Image { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.JupyterKernelConfig Kernel { get { throw null; } set { } } public string Name { get { throw null; } set { } } public System.Collections.Generic.IList Volumes { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.CustomService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3351,6 +4029,54 @@ protected DataReferenceCredential() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DefaultResourceProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DefaultResourceProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Disabled { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState NotStarted { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Scaling { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState left, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState left, Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DeploymentModelVersionUpgradeOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DeploymentModelVersionUpgradeOption(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption NoAutoUpgrade { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption OnceCurrentVersionExpired { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption OnceNewDefaultVersionAvailable { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption left, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption left, Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption right) { throw null; } + public override string ToString() { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class DestinationAsset : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DestinationAsset() { } @@ -3425,6 +4151,7 @@ public EncryptionUpdateProperties(string keyIdentifier) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct EndpointServiceConnectionStatus : System.IEquatable { @@ -3436,13 +4163,180 @@ public EncryptionUpdateProperties(string keyIdentifier) { } public static Azure.ResourceManager.MachineLearning.Models.EndpointServiceConnectionStatus Pending { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.EndpointServiceConnectionStatus Rejected { get { throw null; } } public bool Equals(Azure.ResourceManager.MachineLearning.Models.EndpointServiceConnectionStatus other) { throw null; } +======= + public partial class EndpointDeploymentModel : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EndpointDeploymentModel() { } + public string Format { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public string Source { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class EndpointDeploymentResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected EndpointDeploymentResourceProperties() { } + public string FailureReason { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? ProvisioningState { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointKeys : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointKeys() { } + public Azure.ResourceManager.MachineLearning.Models.AccountApiKeys Keys { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointKeys System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointKeys System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelDeprecationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelDeprecationProperties() { } + public System.DateTimeOffset? FineTune { get { throw null; } } + public System.DateTimeOffset? Inference { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelDeprecationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelDeprecationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelProperties() { } + public System.Collections.Generic.IReadOnlyDictionary Capabilities { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.EndpointModelDeprecationProperties Deprecation { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary FinetuneCapabilities { get { throw null; } } + public string Format { get { throw null; } } + public bool? IsDefaultVersion { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus? LifecycleStatus { get { throw null; } } + public int? MaxCapacity { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Skus { get { throw null; } } + public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + public string Version { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelSkuCapacityProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelSkuCapacityProperties() { } + public int? Default { get { throw null; } } + public int? Maximum { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuCapacityProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuCapacityProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelSkuProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelSkuProperties() { } + public Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuCapacityProperties Capacity { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ConnectionIds { get { throw null; } } + public System.DateTimeOffset? DeprecationOn { get { throw null; } } + public string Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RateLimits { get { throw null; } } + public string UsageName { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelSkuRateLimitProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelSkuRateLimitProperties() { } + public float? Count { get { throw null; } } + public float? RenewalPeriod { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Rules { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelSkuRateLimitRulePatternProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelSkuRateLimitRulePatternProperties() { } + public string Method { get { throw null; } } + public string Path { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRulePatternProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRulePatternProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointModelSkuRateLimitRuleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal EndpointModelSkuRateLimitRuleProperties() { } + public float? Count { get { throw null; } } + public bool? DynamicThrottlingEnabled { get { throw null; } } + public string Key { get { throw null; } } + public System.Collections.Generic.IReadOnlyList MatchPatterns { get { throw null; } } + public float? MinCount { get { throw null; } } + public float? RenewalPeriod { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointModelSkuRateLimitRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class EndpointResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected EndpointResourceProperties() { } + public Azure.Core.ResourceIdentifier AssociatedResourceId { get { throw null; } set { } } + public System.Collections.Generic.IList Deployments { get { throw null; } } + public System.Uri EndpointUri { get { throw null; } set { } } + public string FailureReason { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.DefaultResourceProvisioningState? ProvisioningState { get { throw null; } } + public bool? ShouldCreateAiServicesEndpoint { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EndpointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EndpointType(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType AzureContentSafety { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType AzureLlama { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType AzureOpenAI { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType AzureSpeech { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType ManagedOnlineEndpoint { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.EndpointType ServerlessEndpoint { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.EndpointType other) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override bool Equals(object obj) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public override int GetHashCode() { throw null; } +<<<<<<< HEAD public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.EndpointServiceConnectionStatus left, Azure.ResourceManager.MachineLearning.Models.EndpointServiceConnectionStatus right) { throw null; } public static implicit operator Azure.ResourceManager.MachineLearning.Models.EndpointServiceConnectionStatus (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.EndpointServiceConnectionStatus left, Azure.ResourceManager.MachineLearning.Models.EndpointServiceConnectionStatus right) { throw null; } +======= + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.EndpointType left, Azure.ResourceManager.MachineLearning.Models.EndpointType right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.EndpointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.EndpointType left, Azure.ResourceManager.MachineLearning.Models.EndpointType right) { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public override string ToString() { throw null; } } public partial class EnvironmentVariable : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel @@ -3476,7 +4370,11 @@ public EnvironmentVariable() { } } public partial class FeatureAttributionDriftMonitoringSignal : Azure.ResourceManager.MachineLearning.Models.MonitoringSignalBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { +<<<<<<< HEAD public FeatureAttributionDriftMonitoringSignal(Azure.ResourceManager.MachineLearning.Models.FeatureAttributionMetricThreshold metricThreshold, Azure.ResourceManager.MachineLearning.Models.FeatureImportanceSettings featureImportanceSettings, System.Collections.Generic.IEnumerable productionData, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase referenceData) { } +======= + public FeatureAttributionDriftMonitoringSignal(Azure.ResourceManager.MachineLearning.Models.FeatureImportanceSettings featureImportanceSettings, Azure.ResourceManager.MachineLearning.Models.FeatureAttributionMetricThreshold metricThreshold, System.Collections.Generic.IEnumerable productionData, Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase referenceData) { } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public System.Collections.Generic.IDictionary FeatureDataTypeOverride { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.FeatureImportanceSettings FeatureImportanceSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.FeatureAttributionMetricThreshold MetricThreshold { get { throw null; } set { } } @@ -3630,6 +4528,62 @@ public FeatureWindow() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + public partial class FineTuningJob : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FineTuningJob(Azure.ResourceManager.MachineLearning.Models.FineTuningVertical fineTuningDetails, System.Collections.Generic.IDictionary outputs) { } + public Azure.ResourceManager.MachineLearning.Models.FineTuningVertical FineTuningDetails { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Outputs { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.JobTier? QueueJobTier { get { throw null; } set { } } + public System.Collections.Generic.IList ResourcesInstanceTypes { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.FineTuningJob System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.FineTuningJob System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FineTuningTaskType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FineTuningTaskType(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType ChatCompletion { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType ImageClassification { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType ImageInstanceSegmentation { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType ImageObjectDetection { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType QuestionAnswering { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TextClassification { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TextCompletion { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TextSummarization { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TextTranslation { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TokenClassification { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType VideoMultiObjectTracking { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType left, Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType left, Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class FineTuningVertical : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected FineTuningVertical(Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType taskType, Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput trainingData, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput model) { } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowModelJobInput Model { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.FineTuningTaskType TaskType { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput TrainingData { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput ValidationData { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.FineTuningVertical System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.FineTuningVertical System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class FixedInputData : Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public FixedInputData(Azure.ResourceManager.MachineLearning.Models.JobInputType jobInputType, System.Uri uri) : base (default(Azure.ResourceManager.MachineLearning.Models.JobInputType), default(System.Uri)) { } @@ -3797,6 +4751,19 @@ public GridSamplingAlgorithm() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + public partial class IdleShutdownSetting : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IdleShutdownSetting() { } + public string IdleTimeBeforeShutdown { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.IdleShutdownSetting System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.IdleShutdownSetting System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class ImageClassification : Azure.ResourceManager.MachineLearning.Models.AutoMLVertical, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ImageClassification(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput trainingData, Azure.ResourceManager.MachineLearning.Models.ImageLimitSettings limitSettings) : base (default(Azure.ResourceManager.MachineLearning.Models.MachineLearningTableJobInput)) { } @@ -3863,6 +4830,7 @@ internal ImageMetadata() { } public string CurrentImageVersion { get { throw null; } } public bool? IsLatestOSImageVersion { get { throw null; } } public string LatestImageVersion { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus OSPatchingStatus { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.ImageMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.ImageMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4039,6 +5007,7 @@ public ImageSetting() { } public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.ImageType? ImageType { get { throw null; } set { } } public string Reference { get { throw null; } set { } } + public string Version { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.ImageSetting System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.ImageSetting System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4183,6 +5152,21 @@ protected JobNodes() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.JobTier left, Azure.ResourceManager.MachineLearning.Models.JobTier right) { throw null; } public override string ToString() { throw null; } } +<<<<<<< HEAD +======= + public partial class JupyterKernelConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public JupyterKernelConfig() { } + public System.Collections.Generic.IList Argv { get { throw null; } } + public string DisplayName { get { throw null; } set { } } + public string Language { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.JupyterKernelConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.JupyterKernelConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class LakeHouseArtifact : Azure.ResourceManager.MachineLearning.Models.OneLakeArtifact, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LakeHouseArtifact(string artifactName) : base (default(string)) { } @@ -4831,16 +5815,17 @@ internal MachineLearningComputeInstanceDataDisk() { } } public partial class MachineLearningComputeInstanceDataMount : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MachineLearningComputeInstanceDataMount() { } - public string CreatedBy { get { throw null; } } - public string Error { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningMountAction? MountAction { get { throw null; } } - public System.DateTimeOffset? MountedOn { get { throw null; } } - public string MountName { get { throw null; } } - public string MountPath { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningMountState? MountState { get { throw null; } } - public string Source { get { throw null; } } - public Azure.ResourceManager.MachineLearning.Models.MachineLearningSourceType? SourceType { get { throw null; } } + public MachineLearningComputeInstanceDataMount() { } + public string CreatedBy { get { throw null; } set { } } + public string Error { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningMountAction? MountAction { get { throw null; } set { } } + public System.DateTimeOffset? MountedOn { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MountMode? MountMode { get { throw null; } set { } } + public string MountName { get { throw null; } set { } } + public string MountPath { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningMountState? MountState { get { throw null; } set { } } + public string Source { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningSourceType? SourceType { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceDataMount System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceDataMount System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4884,10 +5869,14 @@ public MachineLearningComputeInstanceProperties() { } public System.Collections.Generic.IReadOnlyList DataDisks { get { throw null; } } public System.Collections.Generic.IReadOnlyList DataMounts { get { throw null; } } public bool? EnableNodePublicIP { get { throw null; } set { } } + public bool? EnableOSPatching { get { throw null; } set { } } + public bool? EnableRootAccess { get { throw null; } set { } } + public bool? EnableSso { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceLastOperation LastOperation { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.ImageMetadata OSImageMetadata { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceAssignedUser PersonalComputeInstanceAssignedUser { get { throw null; } set { } } + public bool? ReleaseQuotaOnStop { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList SchedulesComputeStartStop { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningScriptsToExecute Scripts { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceSshSettings SshSettings { get { throw null; } set { } } @@ -4924,6 +5913,7 @@ public MachineLearningComputeInstanceSshSettings() { } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState Creating { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState Deleting { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState JobRunning { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState Resizing { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState Restarting { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState Running { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningComputeInstanceState SettingUp { get { throw null; } } @@ -5986,6 +6976,27 @@ public MachineLearningFlavorData() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MachineLearningFlowAutoLogger : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MachineLearningFlowAutoLogger(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger Disabled { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger left, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger left, Azure.ResourceManager.MachineLearning.Models.MachineLearningFlowAutoLogger right) { throw null; } + public override string ToString() { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class MachineLearningFlowModelJobInput : Azure.ResourceManager.MachineLearning.Models.MachineLearningJobInput, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningFlowModelJobInput(System.Uri uri) { } @@ -6778,6 +7789,7 @@ protected MachineLearningOnlineScaleSettings() { } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Create { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Delete { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Reimage { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Resize { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Restart { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Start { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationName Stop { get { throw null; } } @@ -6801,6 +7813,7 @@ protected MachineLearningOnlineScaleSettings() { } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus DeleteFailed { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus InProgress { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus ReimageFailed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus ResizeFailed { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus RestartFailed { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus StartFailed { get { throw null; } } public static Azure.ResourceManager.MachineLearning.Models.MachineLearningOperationStatus StopFailed { get { throw null; } } @@ -6876,6 +7889,7 @@ public abstract partial class MachineLearningOutboundRule : System.ClientModel.P { protected MachineLearningOutboundRule() { } public Azure.ResourceManager.MachineLearning.Models.OutboundRuleCategory? Category { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList ParentRuleNames { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus? Status { get { throw null; } set { } } Azure.ResourceManager.MachineLearning.Models.MachineLearningOutboundRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -8329,12 +9343,22 @@ public abstract partial class MachineLearningWorkspaceConnectionProperties : Sys protected MachineLearningWorkspaceConnectionProperties() { } public Azure.ResourceManager.MachineLearning.Models.MachineLearningConnectionCategory? Category { get { throw null; } set { } } public Azure.Core.ResourceIdentifier CreatedByWorkspaceArmId { get { throw null; } } +<<<<<<< HEAD +======= + public string Error { get { throw null; } set { } } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public System.DateTimeOffset? ExpiryOn { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ConnectionGroup? Group { get { throw null; } } public bool? IsSharedToAll { get { throw null; } set { } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } +<<<<<<< HEAD +======= + public Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement? PeRequirement { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus? PeStatus { get { throw null; } set { } } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public System.Collections.Generic.IList SharedUserList { get { throw null; } } public string Target { get { throw null; } set { } } + public bool? UseWorkspaceManagedIdentity { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public string Value { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -8376,6 +9400,7 @@ public MachineLearningWorkspaceDiagnoseProperties() { } public System.Collections.Generic.IDictionary KeyVault { get { throw null; } } public System.Collections.Generic.IDictionary Nsg { get { throw null; } } public System.Collections.Generic.IDictionary Others { get { throw null; } } + public System.Collections.Generic.IDictionary RequiredResourceProviders { get { throw null; } } public System.Collections.Generic.IDictionary ResourceLock { get { throw null; } } public System.Collections.Generic.IDictionary StorageAccount { get { throw null; } } public System.Collections.Generic.IDictionary Udr { get { throw null; } } @@ -8450,21 +9475,28 @@ internal MachineLearningWorkspaceNotebookAccessTokenResult() { } public partial class MachineLearningWorkspacePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MachineLearningWorkspacePatch() { } + public bool? AllowRoleAssignmentOnRG { get { throw null; } set { } } public string ApplicationInsights { get { throw null; } set { } } public string ContainerRegistry { get { throw null; } set { } } public int? CosmosDbCollectionsThroughput { get { throw null; } set { } } public string Description { get { throw null; } set { } } public bool? EnableDataIsolation { get { throw null; } set { } } + public bool? EnableSoftwareBillOfMaterials { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.FeatureStoreSettings FeatureStoreSettings { get { throw null; } set { } } public string FriendlyName { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public string ImageBuildCompute { get { throw null; } set { } } + public System.Collections.Generic.IList IPAllowlist { get { throw null; } } public string KeyIdentifier { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.ManagedNetworkSettings ManagedNetwork { get { throw null; } set { } } public string PrimaryUserAssignedIdentity { get { throw null; } set { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } +<<<<<<< HEAD public Azure.ResourceManager.MachineLearning.Models.PublicNetworkAccess? PublicNetworkAccessType { get { throw null; } set { } } +======= + public Azure.ResourceManager.MachineLearning.Models.MachineLearningPublicNetworkAccessType? PublicNetworkAccessType { get { throw null; } set { } } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public Azure.ResourceManager.MachineLearning.Models.ServerlessComputeSettings ServerlessComputeSettings { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MachineLearningSku Sku { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } @@ -8561,6 +9593,7 @@ public ManagedNetworkProvisionStatus() { } public partial class ManagedNetworkSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ManagedNetworkSettings() { } + public System.Collections.Generic.IReadOnlyList ChangeableIsolationModes { get { throw null; } } public Azure.ResourceManager.MachineLearning.Models.IsolationMode? IsolationMode { get { throw null; } set { } } public string NetworkId { get { throw null; } } public System.Collections.Generic.IDictionary OutboundRules { get { throw null; } set { } } @@ -8589,6 +9622,83 @@ public ManagedNetworkSettings() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ManagedNetworkStatus left, Azure.ResourceManager.MachineLearning.Models.ManagedNetworkStatus right) { throw null; } public override string ToString() { throw null; } } +<<<<<<< HEAD +======= + public partial class ManagedOnlineEndpointDeploymentResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedOnlineEndpointDeploymentResourceProperties() { } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointComputeType? EndpointComputeType { get { throw null; } set { } } + public string Model { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointDeploymentResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointDeploymentResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ManagedOnlineEndpointResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedOnlineEndpointResourceProperties() { } + public Azure.ResourceManager.MachineLearning.Models.MachineLearningEndpointAuthMode? AuthMode { get { throw null; } set { } } + public string Compute { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public System.Collections.Generic.IDictionary MirrorTraffic { get { throw null; } } + public System.Uri ScoringUri { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Traffic { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ManagedOnlineEndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedPERequirement : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedPERequirement(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement NotApplicable { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement NotRequired { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement Required { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement left, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement left, Azure.ResourceManager.MachineLearning.Models.ManagedPERequirement right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ManagedPEStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ManagedPEStatus(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus Active { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus Inactive { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus NotApplicable { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus left, Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus left, Azure.ResourceManager.MachineLearning.Models.ManagedPEStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ManagedResourceGroupAssignedIdentities : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ManagedResourceGroupAssignedIdentities() { } + public System.Guid? PrincipalId { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.ManagedResourceGroupAssignedIdentities System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ManagedResourceGroupAssignedIdentities System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class MarketplacePlan : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MarketplacePlan() { } @@ -8698,6 +9808,27 @@ public MedianStoppingPolicy() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ModelLifecycleStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ModelLifecycleStatus(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus GenerallyAvailable { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus Preview { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus left, Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus left, Azure.ResourceManager.MachineLearning.Models.ModelLifecycleStatus right) { throw null; } + public override string ToString() { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ModelTaskType : System.IEquatable { @@ -8736,7 +9867,11 @@ protected MonitorComputeIdentityBase() { } } public partial class MonitorDefinition : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { +<<<<<<< HEAD public MonitorDefinition(System.Collections.Generic.IDictionary signals, Azure.ResourceManager.MachineLearning.Models.MonitorComputeConfigurationBase computeConfiguration) { } +======= + public MonitorDefinition(Azure.ResourceManager.MachineLearning.Models.MonitorComputeConfigurationBase computeConfiguration, System.Collections.Generic.IDictionary signals) { } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public Azure.ResourceManager.MachineLearning.Models.MonitorComputeConfigurationBase ComputeConfiguration { get { throw null; } set { } } public System.Collections.Generic.IList Emails { get { throw null; } set { } } public Azure.ResourceManager.MachineLearning.Models.MonitoringTarget MonitoringTarget { get { throw null; } set { } } @@ -8851,6 +9986,24 @@ public MountBindOptions() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MountMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MountMode(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.MountMode ReadOnly { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.MountMode ReadWrite { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.MountMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.MountMode left, Azure.ResourceManager.MachineLearning.Models.MountMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.MountMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.MountMode left, Azure.ResourceManager.MachineLearning.Models.MountMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class MpiDistributionConfiguration : Azure.ResourceManager.MachineLearning.Models.MachineLearningDistributionConfiguration, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MpiDistributionConfiguration() { } @@ -9051,6 +10204,44 @@ public OneLakeDatastore(Azure.ResourceManager.MachineLearning.Models.MachineLear string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + public partial class OpenAIEndpointDeploymentResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenAIEndpointDeploymentResourceProperties(Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model) { } + public Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel Model { get { throw null; } set { } } + public string RaiPolicyName { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointDeploymentResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointDeploymentResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OpenAIEndpointResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public OpenAIEndpointResourceProperties() { } + Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.OpenAIEndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class OSPatchingStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal OSPatchingStatus() { } + public System.DateTimeOffset? LatestPatchOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList OSPatchingErrors { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.PatchStatus? PatchStatus { get { throw null; } } + public bool? RebootPending { get { throw null; } } + public System.DateTimeOffset? ScheduledRebootOn { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.OSPatchingStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct OutboundRuleCategory : System.IEquatable { @@ -9089,6 +10280,30 @@ public OneLakeDatastore(Azure.ResourceManager.MachineLearning.Models.MachineLear public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus left, Azure.ResourceManager.MachineLearning.Models.OutboundRuleStatus right) { throw null; } public override string ToString() { throw null; } } +<<<<<<< HEAD +======= + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatchStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchStatus(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.PatchStatus CompletedWithWarnings { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.PatchStatus Failed { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.PatchStatus InProgress { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.PatchStatus Succeeded { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.PatchStatus Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.PatchStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.PatchStatus left, Azure.ResourceManager.MachineLearning.Models.PatchStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.PatchStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.PatchStatus left, Azure.ResourceManager.MachineLearning.Models.PatchStatus right) { throw null; } + public override string ToString() { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public abstract partial class PendingUploadCredentialDto : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected PendingUploadCredentialDto() { } @@ -9189,12 +10404,14 @@ public partial class PrivateEndpointOutboundRule : Azure.ResourceManager.Machine { public PrivateEndpointOutboundRule() { } public Azure.ResourceManager.MachineLearning.Models.PrivateEndpointDestination Destination { get { throw null; } set { } } + public System.Collections.Generic.IList Fqdns { get { throw null; } } Azure.ResourceManager.MachineLearning.Models.PrivateEndpointOutboundRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.MachineLearning.Models.PrivateEndpointOutboundRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PublicNetworkAccess : System.IEquatable { @@ -9213,6 +10430,8 @@ public PrivateEndpointOutboundRule() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.PublicNetworkAccess left, Azure.ResourceManager.MachineLearning.Models.PublicNetworkAccess right) { throw null; } public override string ToString() { throw null; } } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class PyTorchDistributionConfiguration : Azure.ResourceManager.MachineLearning.Models.MachineLearningDistributionConfiguration, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PyTorchDistributionConfiguration() { } @@ -9223,6 +10442,133 @@ public PyTorchDistributionConfiguration() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class RaiBlocklistConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistConfig() { } + public bool? Blocking { get { throw null; } set { } } + public string BlocklistName { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiBlocklistItemBulkRequest : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistItemBulkRequest() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties Properties { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemBulkRequest System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemBulkRequest System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiBlocklistItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistItemProperties() { } + public bool? IsRegex { get { throw null; } set { } } + public string Pattern { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiBlocklistProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiBlocklistProperties() { } + public string Description { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiBlocklistProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RaiPolicyContentFilter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiPolicyContentFilter() { } + public Azure.ResourceManager.MachineLearning.Models.AllowedContentLevel? AllowedContentLevel { get { throw null; } set { } } + public bool? Blocking { get { throw null; } set { } } + public bool? Enabled { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource? Source { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentFilter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentFilter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RaiPolicyContentSource : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RaiPolicyContentSource(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource Completion { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource Prompt { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyContentSource right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RaiPolicyMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RaiPolicyMode(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode Blocking { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode Default { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode Deferred { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RaiPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RaiPolicyProperties() { } + public string BasePolicyName { get { throw null; } set { } } + public System.Collections.Generic.IList CompletionBlocklists { get { throw null; } } + public System.Collections.Generic.IList ContentFilters { get { throw null; } } + public Azure.ResourceManager.MachineLearning.Models.RaiPolicyMode? Mode { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.RaiPolicyType? PolicyType { get { throw null; } set { } } + public System.Collections.Generic.IList PromptBlocklists { get { throw null; } } + Azure.ResourceManager.MachineLearning.Models.RaiPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RaiPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RaiPolicyType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RaiPolicyType(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyType SystemManaged { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.RaiPolicyType UserManaged { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.RaiPolicyType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.RaiPolicyType left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyType right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.RaiPolicyType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.RaiPolicyType left, Azure.ResourceManager.MachineLearning.Models.RaiPolicyType right) { throw null; } + public override string ToString() { throw null; } + } public partial class RandomSamplingAlgorithm : Azure.ResourceManager.MachineLearning.Models.SamplingAlgorithm, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RandomSamplingAlgorithm() { } @@ -9252,6 +10598,19 @@ public RandomSamplingAlgorithm() { } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.RandomSamplingAlgorithmRule left, Azure.ResourceManager.MachineLearning.Models.RandomSamplingAlgorithmRule right) { throw null; } public override string ToString() { throw null; } } +<<<<<<< HEAD +======= + public partial class RegenerateServiceAccountKeyContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RegenerateServiceAccountKeyContent() { } + public Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName? KeyName { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.RegenerateServiceAccountKeyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.RegenerateServiceAccountKeyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class RegistryAcrDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RegistryAcrDetails() { } @@ -9345,6 +10704,19 @@ public RegressionTrainingSettings() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + public partial class ResizeSchema : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ResizeSchema() { } + public string TargetVmSize { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ResizeSchema System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ResizeSchema System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class RollingInputData : Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public RollingInputData(Azure.ResourceManager.MachineLearning.Models.JobInputType jobInputType, System.Uri uri, System.TimeSpan windowOffset, System.TimeSpan windowSize) : base (default(Azure.ResourceManager.MachineLearning.Models.JobInputType), default(System.Uri)) { } @@ -9426,8 +10798,24 @@ internal SasCredentialDto() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD + public partial class ServerlessComputeSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { +======= + public partial class SecretExpiry : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SecretExpiry() { } + public bool? ExpirableSecret { get { throw null; } set { } } + public int? ExpireAfterHours { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.SecretExpiry System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.SecretExpiry System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ServerlessComputeSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public ServerlessComputeSettings() { } public bool? HasNoPublicIP { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ServerlessComputeCustomSubnet { get { throw null; } set { } } @@ -9437,6 +10825,31 @@ public ServerlessComputeSettings() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + public partial class ServerlessEndpointCapacityReservation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessEndpointCapacityReservation(string capacityReservationGroupId) { } + public string CapacityReservationGroupId { get { throw null; } set { } } + public int? EndpointReservedCapacity { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointCapacityReservation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointCapacityReservation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ServerlessEndpointInferenceEndpoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessEndpointInferenceEndpoint(System.Uri uri) { } + public System.Collections.Generic.IReadOnlyDictionary Headers { get { throw null; } } + public System.Uri Uri { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointInferenceEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointInferenceEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class ServerlessEndpointPatch : Azure.ResourceManager.MachineLearning.Models.MachineLearningResourcePatch, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ServerlessEndpointPatch() { } @@ -9464,6 +10877,27 @@ public ServerlessEndpointProperties(Azure.ResourceManager.MachineLearning.Models string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } +<<<<<<< HEAD +======= + public partial class ServerlessEndpointResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessEndpointResourceProperties() { } + public Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode? AuthMode { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointCapacityReservation CapacityReservation { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ContentSafetyStatus? ContentSafetyStatus { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointState? EndpointState { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointInferenceEndpoint InferenceEndpoint { get { throw null; } set { } } + public string MarketplaceSubscriptionId { get { throw null; } set { } } + public System.BinaryData Metadata { get { throw null; } set { } } + public string ModelId { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.ServerlessOffer Offer { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessEndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ServerlessEndpointState : System.IEquatable { @@ -9516,6 +10950,38 @@ internal ServerlessInferenceEndpoint() { } public static implicit operator Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode left, Azure.ResourceManager.MachineLearning.Models.ServerlessInferenceEndpointAuthMode right) { throw null; } public override string ToString() { throw null; } +<<<<<<< HEAD +======= + } + public partial class ServerlessOffer : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ServerlessOffer(string offerName, string publisher) { } + public string OfferName { get { throw null; } set { } } + public string Publisher { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.ServerlessOffer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.ServerlessOffer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ServiceAccountKeyName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ServiceAccountKeyName(string value) { throw null; } + public static Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName Key1 { get { throw null; } } + public static Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName Key2 { get { throw null; } } + public bool Equals(Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName left, Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName right) { throw null; } + public static implicit operator Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName left, Azure.ResourceManager.MachineLearning.Models.ServiceAccountKeyName right) { throw null; } + public override string ToString() { throw null; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } public partial class ServicePrincipalAuthTypeWorkspaceConnectionProperties : Azure.ResourceManager.MachineLearning.Models.MachineLearningWorkspaceConnectionProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { @@ -9614,6 +11080,27 @@ public SparkResourceConfiguration() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SpeechEndpointDeploymentResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SpeechEndpointDeploymentResourceProperties(Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel model) { } + public Azure.ResourceManager.MachineLearning.Models.EndpointDeploymentModel Model { get { throw null; } set { } } + public string RaiPolicyName { get { throw null; } set { } } + public Azure.ResourceManager.MachineLearning.Models.DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get { throw null; } set { } } + Azure.ResourceManager.MachineLearning.Models.SpeechEndpointDeploymentResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.SpeechEndpointDeploymentResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SpeechEndpointResourceProperties : Azure.ResourceManager.MachineLearning.Models.EndpointResourceProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SpeechEndpointResourceProperties() { } + Azure.ResourceManager.MachineLearning.Models.SpeechEndpointResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.MachineLearning.Models.SpeechEndpointResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class StaticInputData : Azure.ResourceManager.MachineLearning.Models.MonitoringInputDataBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public StaticInputData(Azure.ResourceManager.MachineLearning.Models.JobInputType jobInputType, System.Uri uri, System.DateTimeOffset windowStart, System.DateTimeOffset windowEnd) : base (default(Azure.ResourceManager.MachineLearning.Models.JobInputType), default(System.Uri)) { } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResource.cs new file mode 100644 index 000000000000..b85a2edf37c2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResource.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_EndpointResourcePropertiesBasicResource + { + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + EndpointResourcePropertiesBasicResource result = await endpointResourcePropertiesBasicResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/create.json + // this example is just showing the usage of "Endpoint_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + EndpointResourcePropertiesBasicResourceData data = new EndpointResourcePropertiesBasicResourceData(new OpenAIEndpointResourceProperties() + { + AssociatedResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/test-rg/providers/Microsoft.CognitiveService/account/account-1"), + Name = "Azure.OpenAI", + }); + ArmOperation lro = await endpointResourcePropertiesBasicResource.UpdateAsync(WaitUntil.Completed, data); + EndpointResourcePropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // List Endpoint Keys + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetKeys_ListEndpointKeys() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/listKeys.json + // this example is just showing the usage of "Endpoint_ListKeys" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + EndpointKeys result = await endpointResourcePropertiesBasicResource.GetKeysAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Endpoint Models + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetModels_GetEndpointModels() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/getModels.json + // this example is just showing the usage of "Endpoint_GetModels" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation and iterate over the result + await foreach (EndpointModelProperties item in endpointResourcePropertiesBasicResource.GetModelsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Regenerate Endpoint Keys + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task RegenerateKeys_RegenerateEndpointKeys() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/regenerateKey.json + // this example is just showing the usage of "Endpoint_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // invoke the operation + RegenerateServiceAccountKeyContent content = new RegenerateServiceAccountKeyContent() + { + KeyName = ServiceAccountKeyName.Key1, + }; + AccountApiKeys result = await endpointResourcePropertiesBasicResource.RegenerateKeysAsync(content); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResourceCollection.cs new file mode 100644 index 000000000000..c87bb000906f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_EndpointResourcePropertiesBasicResourceCollection.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_EndpointResourcePropertiesBasicResourceCollection + { + // List Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/list.json + // this example is just showing the usage of "Endpoint_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation and iterate over the result + EndpointType? endpointType = EndpointType.AzureOpenAI; + string skip = "skip_string"; + await foreach (EndpointResourcePropertiesBasicResource item in collection.GetAllAsync(endpointType: endpointType, skip: skip)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + EndpointResourcePropertiesBasicResource result = await collection.GetAsync(endpointName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + bool result = await collection.ExistsAsync(endpointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/get.json + // this example is just showing the usage of "Endpoint_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + NullableResponse response = await collection.GetIfExistsAsync(endpointName); + EndpointResourcePropertiesBasicResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Endpoint + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateEndpoint() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/create.json + // this example is just showing the usage of "Endpoint_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this EndpointResourcePropertiesBasicResource + EndpointResourcePropertiesBasicResourceCollection collection = machineLearningWorkspace.GetEndpointResourcePropertiesBasicResources(); + + // invoke the operation + string endpointName = "Azure.OpenAI"; + EndpointResourcePropertiesBasicResourceData data = new EndpointResourcePropertiesBasicResourceData(new OpenAIEndpointResourceProperties() + { + AssociatedResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/test-rg/providers/Microsoft.CognitiveService/account/account-1"), + Name = "Azure.OpenAI", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, endpointName, data); + EndpointResourcePropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs index fc43481eced3..49beea0cbcc8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearninRegistryComponentContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs index 6700ed192cdd..9565f87beb12 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearninRegistryComponentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetRegistryComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs index 6a3241b7b032..b83f5b7ff5d3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionCollection.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearninRegistryComponentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentVersion/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +65,11 @@ public async Task GetAll_ListRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +105,11 @@ public async Task Get_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +141,11 @@ public async Task Exists_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +189,11 @@ public async Task GetIfExists_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs index 3358e3c84feb..b91ae620e11d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearninRegistryComponentVersionResource.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearninRegistryComponentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentVersion/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +54,11 @@ public async Task Delete_DeleteRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +91,11 @@ public async Task Get_GetRegistryComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ComponentVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ComponentVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryComponentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs index 30e3ca78d4c4..d02a605f02e3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentCollection.cs @@ -23,7 +23,11 @@ public partial class Sample_MachineLearningBatchDeploymentCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceBatchDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchDeployment/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchDeployments_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -63,7 +67,11 @@ public async Task GetAll_ListWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +107,11 @@ public async Task Get_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceBatchDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -131,7 +143,11 @@ public async Task Exists_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceBatchDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,7 +191,11 @@ public async Task GetIfExists_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceBatchDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchDeployment/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchDeployments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs index a47a0a18ba60..706384fcfbd6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchDeploymentResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningBatchDeploymentResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceBatchDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchDeployment/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchDeployments_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetWorkspaceBatchDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceBatchDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchDeployment/update.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchDeployment/update.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchDeployments_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs index 5432d00ab2b6..6747591abd70 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointCollection.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearningBatchEndpointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceBatchEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchEndpoint/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchEndpoints_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +63,11 @@ public async Task GetAll_ListWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +102,11 @@ public async Task Get_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceBatchEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +137,11 @@ public async Task Exists_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceBatchEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +184,11 @@ public async Task GetIfExists_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceBatchEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchEndpoint/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchEndpoints_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs index 6962f39920d6..d2cb00f73c93 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningBatchEndpointResource.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearningBatchEndpointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceBatchEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchEndpoint/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchEndpoints_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceBatchEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +89,11 @@ public async Task Get_GetWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceBatchEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchEndpoint/update.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/update.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchEndpoints_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +142,11 @@ public async Task Update_UpdateWorkspaceBatchEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListKeysWorkspaceBatchEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/BatchEndpoint/listKeys.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/BatchEndpoint/listKeys.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "BatchEndpoints_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs index c84280ef13a2..434998f67e42 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningCodeContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs index b22a5de355ec..62eef9d06835 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningCodeContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetWorkspaceCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs index 71e13cca6974..4e38fb96cf2c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningCodeVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeVersion/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +64,11 @@ public async Task GetAll_ListWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +104,11 @@ public async Task Get_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +140,11 @@ public async Task Exists_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +188,11 @@ public async Task GetIfExists_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs index f3aafedc45b8..9f7e4dabf636 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningCodeVersionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningCodeVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeVersion/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +142,11 @@ public async Task Update_CreateOrUpdateWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Publish_PublishWorkspaceCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeVersion/publish.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/publish.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeVersions_Publish" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -151,9 +167,15 @@ public async Task Publish_PublishWorkspaceCodeVersion() // invoke the operation DestinationAsset body = new DestinationAsset() { +<<<<<<< HEAD RegistryName = "string", DestinationName = "string", DestinationVersion = "string", +======= + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 }; await machineLearningCodeVersion.PublishAsync(WaitUntil.Completed, body); @@ -165,7 +187,11 @@ public async Task Publish_PublishWorkspaceCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadWorkspaceCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/CodeVersion/createOrGetStartPendingUpload.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/CodeVersion/createOrGetStartPendingUpload.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "CodeVersions_CreateOrGetStartPendingUpload" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs index 80dde1d0e797..ec263154d875 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningComponentContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs index fa281ce7cedf..ff132fa9f216 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningComponentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetWorkspaceComponentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceComponentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs index 781e3dd95ea8..5ab0a946eb09 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionCollection.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearningComponentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentVersion/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +65,11 @@ public async Task GetAll_ListWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +105,11 @@ public async Task Get_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +141,11 @@ public async Task Exists_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +189,11 @@ public async Task GetIfExists_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs index b6a4ed3bb09b..b302d188fb72 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComponentVersionResource.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearningComponentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentVersion/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +54,11 @@ public async Task Delete_DeleteWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,7 +91,11 @@ public async Task Get_GetWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +146,11 @@ public async Task Update_CreateOrUpdateWorkspaceComponentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Publish_PublishWorkspaceComponentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ComponentVersion/publish.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ComponentVersion/publish.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ComponentVersions_Publish" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,9 +171,15 @@ public async Task Publish_PublishWorkspaceComponentVersion() // invoke the operation DestinationAsset body = new DestinationAsset() { +<<<<<<< HEAD RegistryName = "string", DestinationName = "string", DestinationVersion = "string", +======= + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 }; await machineLearningComponentVersion.PublishAsync(WaitUntil.Completed, body); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs index 6a461a382312..1788974f8a93 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeCollection.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearningComputeCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetComputes() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +62,11 @@ public async Task GetAll_GetComputes() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAKSCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/AKSCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +101,11 @@ public async Task Get_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAAKSCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/AKSCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +136,11 @@ public async Task Exists_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAAKSCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/AKSCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +183,11 @@ public async Task GetIfExists_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAMLCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/AmlCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -202,7 +222,11 @@ public async Task Get_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAAMLCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/AmlCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -233,7 +257,11 @@ public async Task Exists_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAAMLCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/AmlCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -276,7 +304,11 @@ public async Task GetIfExists_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAKubernetesCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/KubernetesCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -311,7 +343,11 @@ public async Task Get_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAKubernetesCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/KubernetesCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -342,7 +378,11 @@ public async Task Exists_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAKubernetesCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/KubernetesCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -385,7 +425,11 @@ public async Task GetIfExists_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnComputeInstance() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/ComputeInstance.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -420,7 +464,11 @@ public async Task Get_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAnComputeInstance() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/ComputeInstance.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -451,7 +499,11 @@ public async Task Exists_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAnComputeInstance() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/ComputeInstance.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -494,7 +546,11 @@ public async Task GetIfExists_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_AttachAKubernetesCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/createOrUpdate/KubernetesCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/KubernetesCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -567,7 +623,11 @@ public async Task CreateOrUpdate_AttachAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAAMLCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/createOrUpdate/BasicAmlCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/BasicAmlCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -624,7 +684,11 @@ public async Task CreateOrUpdate_CreateAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateADataFactoryCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/BasicDataFactoryCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -664,7 +728,11 @@ public async Task CreateOrUpdate_CreateADataFactoryCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnAKSCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/createOrUpdate/BasicAKSCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/BasicAKSCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -704,7 +772,11 @@ public async Task CreateOrUpdate_CreateAnAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnComputeInstanceCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/createOrUpdate/ComputeInstance.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/ComputeInstance.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -780,9 +852,22 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceCompute() Target = "/home/azureuser/cloudfiles", } }, +Kernel = new JupyterKernelConfig() +{ +Argv = +{ +"option1","option2","option3" +}, +DisplayName = "TestKernel", +Language = "python", +}, } }, ComputeInstanceAuthorizationType = MachineLearningComputeInstanceAuthorizationType.Personal, + EnableOSPatching = true, + EnableRootAccess = true, + EnableSso = true, + ReleaseQuotaOnStop = true, PersonalComputeInstanceAssignedUser = new MachineLearningComputeInstanceAssignedUser("00000000-0000-0000-0000-000000000000", Guid.Parse("00000000-0000-0000-0000-000000000000")), }, }, @@ -802,7 +887,11 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithSchedules() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/ComputeInstanceWithSchedules.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -855,7 +944,11 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithSchedules() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithMinimalInputs() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/ComputeInstanceMinimal.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -901,7 +994,11 @@ public async Task CreateOrUpdate_CreateAnComputeInstanceComputeWithMinimalInputs [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdateAAMLCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/createOrUpdate/AmlCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/AmlCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -952,7 +1049,11 @@ public async Task CreateOrUpdate_UpdateAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdateAnAKSCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/createOrUpdate/AKSCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/createOrUpdate/AKSCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs index 975442a2926a..531166df3422 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningComputeResource.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearningComputeResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAKSCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/AKSCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AKSCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +57,11 @@ public async Task Get_GetAAKSCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAAMLCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/AmlCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/AmlCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -85,7 +93,11 @@ public async Task Get_GetAAMLCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAKubernetesCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/KubernetesCompute.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/KubernetesCompute.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +129,11 @@ public async Task Get_GetAKubernetesCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAnComputeInstance() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/get/ComputeInstance.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/get/ComputeInstance.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +165,11 @@ public async Task Get_GetAnComputeInstance() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAAmlComputeCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/patch.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/patch.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -190,7 +210,11 @@ public async Task Update_UpdateAAmlComputeCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -214,12 +238,92 @@ public async Task Delete_DeleteCompute() Console.WriteLine($"Succeeded"); } +<<<<<<< HEAD +======= + // Update Custom Services + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task UpdateCustomServices_UpdateCustomServices() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/updateCustomServices.json + // this example is just showing the usage of "Compute_UpdateCustomServices" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation + IEnumerable customServices = new CustomService[] + { +new CustomService() +{ +Name = "rstudio-workbench", +Image = new ImageSetting() +{ +ImageType = ImageType.Docker, +Reference = "ghcr.io/azure/rstudio-workbench:latest", +}, +EnvironmentVariables = +{ +["RSP_LICENSE"] = new EnvironmentVariable() +{ +VariableType = EnvironmentVariableType.Local, +Value = "XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX", +}, +}, +Docker = new DockerSetting() +{ +Privileged = true, +}, +Endpoints = +{ +new ContainerEndpoint() +{ +Protocol = ContainerCommunicationProtocol.Http, +Name = "connect", +Target = 8787, +Published = 4444, +HostIP = null, +} +}, +Volumes = +{ +new VolumeDefinition() +{ +DefinitionType = VolumeDefinitionType.Bind, +ReadOnly = true, +Source = "/mnt/azureuser/", +Target = "/home/testuser/", +} +}, +} + }; + await machineLearningCompute.UpdateCustomServicesAsync(customServices); + + Console.WriteLine($"Succeeded"); + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // Get compute nodes information for a compute [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNodes_GetComputeNodesInformationForACompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/listNodes.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/listNodes.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_ListNodes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -250,7 +354,11 @@ public async Task GetNodes_GetComputeNodesInformationForACompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListAKSComputeKeys() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/listKeys.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/listKeys.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -273,12 +381,56 @@ public async Task GetKeys_ListAKSComputeKeys() Console.WriteLine($"Succeeded: {result}"); } + // Update Data Mounts + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task UpdateDataMounts_UpdateDataMounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/updateDataMounts.json + // this example is just showing the usage of "Compute_UpdateDataMounts" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation + IEnumerable dataMounts = new MachineLearningComputeInstanceDataMount[] + { +new MachineLearningComputeInstanceDataMount() +{ +Source = "azureml://subscriptions/some-sub/resourcegroups/some-rg/workspaces/some-ws/data/some-data-asset-name/versions/some-data-asset-version", +SourceType = MachineLearningSourceType.Uri, +MountName = "hello", +MountAction = MachineLearningMountAction.Mount, +MountMode = MountMode.ReadOnly, +MountPath = "/some/random/path/on/host", +} + }; + await machineLearningCompute.UpdateDataMountsAsync(dataMounts); + + Console.WriteLine($"Succeeded"); + } + // Start ComputeInstance Compute [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Start_StartComputeInstanceCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/start.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/start.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -306,7 +458,11 @@ public async Task Start_StartComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Stop_StopComputeInstanceCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/stop.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/stop.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Stop" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -334,7 +490,11 @@ public async Task Stop_StopComputeInstanceCompute() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Restart_RestartComputeInstanceCompute() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Compute/restart.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/restart.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Compute_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -356,5 +516,103 @@ public async Task Restart_RestartComputeInstanceCompute() Console.WriteLine($"Succeeded"); } +<<<<<<< HEAD +======= + + // Update idle shutdown setting of ComputeInstance + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task UpdateIdleShutdownSetting_UpdateIdleShutdownSettingOfComputeInstance() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/updateIdleShutdownSetting.json + // this example is just showing the usage of "Compute_UpdateIdleShutdownSetting" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation + IdleShutdownSetting idleShutdownSetting = new IdleShutdownSetting() + { + IdleTimeBeforeShutdown = "PT120M", + }; + await machineLearningCompute.UpdateIdleShutdownSettingAsync(idleShutdownSetting); + + Console.WriteLine($"Succeeded"); + } + + // List VM Sizes + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAllowedResizeSizes_ListVMSizes() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/getAllowedVMSizesForResize.json + // this example is just showing the usage of "Compute_GetAllowedResizeSizes" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation and iterate over the result + await foreach (MachineLearningVmSize item in machineLearningCompute.GetAllowedResizeSizesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // List VM Sizes + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Resize_ListVMSizes() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Compute/resize.json + // this example is just showing the usage of "Compute_Resize" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningComputeResource created on azure + // for more information of creating MachineLearningComputeResource, please refer to the document of MachineLearningComputeResource + string subscriptionId = "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + string computeName = "compute123"; + ResourceIdentifier machineLearningComputeResourceId = MachineLearningComputeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, computeName); + MachineLearningComputeResource machineLearningCompute = client.GetMachineLearningComputeResource(machineLearningComputeResourceId); + + // invoke the operation + ResizeSchema resizeSchema = new ResizeSchema() + { + TargetVmSize = "Standard_DS11_v2", + }; + await machineLearningCompute.ResizeAsync(WaitUntil.Completed, resizeSchema); + + Console.WriteLine($"Succeeded"); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs index 6f9601b08da1..ddd579974c1e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningDataContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs index 3ec589db2604..ae1ca4718875 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningDataContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetWorkspaceDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs index 9322c2bc5e5f..3b379dbfec4c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningDataVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataVersionBase/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -61,7 +65,11 @@ public async Task GetAll_ListWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataVersionBase/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +105,11 @@ public async Task Get_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataVersionBase/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +141,11 @@ public async Task Exists_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataVersionBase/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -173,7 +189,11 @@ public async Task GetIfExists_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataVersionBase/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs index 1abf5d688683..9ac95f3f3904 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDataVersionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningDataVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataVersionBase/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataVersionBase/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataVersionBase/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +141,11 @@ public async Task Update_CreateOrUpdateWorkspaceDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Publish_PublishWorkspaceDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/DataVersionBase/publish.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/DataVersionBase/publish.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "DataVersions_Publish" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -150,9 +166,15 @@ public async Task Publish_PublishWorkspaceDataVersionBase() // invoke the operation DestinationAsset body = new DestinationAsset() { +<<<<<<< HEAD RegistryName = "string", DestinationName = "string", DestinationVersion = "string", +======= + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 }; await machineLearningDataVersion.PublishAsync(WaitUntil.Completed, body); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs index 867501bd8575..2add7e0bc9bb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningDatastoreCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDatastore() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +59,11 @@ public async Task Get_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetDatastore() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +94,11 @@ public async Task Exists_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetDatastore() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +141,11 @@ public async Task GetIfExists_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen1WServicePrincipal() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -184,7 +200,11 @@ public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen1WServic [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen2WServicePrincipal() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -241,7 +261,11 @@ public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureDataLakeGen2WServic [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureFileStoreWAccountKey() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -294,7 +318,11 @@ public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureFileStoreWAccountKe [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateDatastoreAzureBlobWAccountKey() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs index aa8054b021d8..eab8f77173aa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningDatastoreResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningDatastoreResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteDatastore() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetDatastore() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetDatastore() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen1WServicePrincipal() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen1WServicePrincipal/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +144,11 @@ public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen1WServicePrincip [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen2WServicePrincipal() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureDataLakeGen2WServicePrincipal/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -186,7 +202,11 @@ public async Task Update_CreateOrUpdateDatastoreAzureDataLakeGen2WServicePrincip [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureFileStoreWAccountKey() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureFileWAccountKey/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -236,7 +256,11 @@ public async Task Update_CreateOrUpdateDatastoreAzureFileStoreWAccountKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateDatastoreAzureBlobWAccountKey() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/AzureBlobWAccountKey/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -288,7 +312,11 @@ public async Task Update_CreateOrUpdateDatastoreAzureBlobWAccountKey() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSecrets_GetDatastoreSecrets() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Datastore/listSecrets.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Datastore/listSecrets.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Datastores_ListSecrets" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -306,7 +334,12 @@ public async Task GetSecrets_GetDatastoreSecrets() MachineLearningDatastoreResource machineLearningDatastore = client.GetMachineLearningDatastoreResource(machineLearningDatastoreResourceId); // invoke the operation - MachineLearningDatastoreSecrets result = await machineLearningDatastore.GetSecretsAsync(); + SecretExpiry body = new SecretExpiry() + { + ExpirableSecret = false, + ExpireAfterHours = 1, + }; + MachineLearningDatastoreSecrets result = await machineLearningDatastore.GetSecretsAsync(body: body); Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs index f9b942a862b6..2f209d757ef6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningEnvironmentContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs index 8012a5d4768a..bf5eeeb97417 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningEnvironmentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetWorkspaceEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs index 69cf08303cea..67f679a2438f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningEnvironmentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentVersion/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +64,11 @@ public async Task GetAll_ListWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +104,11 @@ public async Task Get_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +140,11 @@ public async Task Exists_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +188,11 @@ public async Task GetIfExists_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs index 05d3c003acf2..80dda21d7862 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningEnvironmentVersionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningEnvironmentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentVersion/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +153,11 @@ public async Task Update_CreateOrUpdateWorkspaceEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Publish_PublishWorkspaceEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/EnvironmentVersion/publish.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/EnvironmentVersion/publish.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "EnvironmentVersions_Publish" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,9 +178,15 @@ public async Task Publish_PublishWorkspaceEnvironmentVersion() // invoke the operation DestinationAsset body = new DestinationAsset() { +<<<<<<< HEAD RegistryName = "string", DestinationName = "string", DestinationVersion = "string", +======= + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 }; await machineLearningEnvironmentVersion.PublishAsync(WaitUntil.Completed, body); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs index f608cb726715..f34dbc98bbdc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningFeatureCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListFeature() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Feature/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Features_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +64,11 @@ public async Task GetAll_ListFeature() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetFeature() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Feature/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Features_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -97,7 +105,11 @@ public async Task Get_GetFeature() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetFeature() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Feature/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Features_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +142,11 @@ public async Task Exists_GetFeature() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetFeature() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Feature/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Features_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs index cda6032613d6..3ca74bad19fd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureResource.cs @@ -19,7 +19,11 @@ public partial class Sample_MachineLearningFeatureResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetFeature() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Feature/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Feature/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Features_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs index 5fee07b04ef7..9f317c611d7c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningFeatureSetContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturesetContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +62,11 @@ public async Task GetAll_ListWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturesetContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetContainer/getEntity.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +101,11 @@ public async Task Get_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetEntityWorkspaceFeaturesetContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetContainer/getEntity.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +136,11 @@ public async Task Exists_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetEntityWorkspaceFeaturesetContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetContainer/getEntity.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +183,11 @@ public async Task GetIfExists_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturesetContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs index ce733de06b20..47ff04f366c8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningFeatureSetContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturesetContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturesetContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetContainer/getEntity.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/getEntity.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetEntityWorkspaceFeaturesetContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturesetContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs index 8829694e8938..990bc2344c9b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningFeatureSetVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturesetVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetVersion/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +63,11 @@ public async Task GetAll_ListWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturesetVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +103,11 @@ public async Task Get_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceFeaturesetVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +139,11 @@ public async Task Exists_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceFeaturesetVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +187,11 @@ public async Task GetIfExists_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturesetVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs index d844af9bb131..acfac62a4acf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureSetVersionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningFeatureSetVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturesetVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetVersion/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturesetVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturesetVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -179,7 +191,11 @@ public async Task Update_CreateOrUpdateWorkspaceFeaturesetVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Backfill_BackfillWorkspaceFeaturesetVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturesetVersion/backfill.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturesetVersion/backfill.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturesetVersions_Backfill" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,6 +216,14 @@ public async Task Backfill_BackfillWorkspaceFeaturesetVersion() // invoke the operation FeatureSetVersionBackfillContent content = new FeatureSetVersionBackfillContent() { +<<<<<<< HEAD +======= + DataAvailabilityStatus = +{ +DataAvailabilityStatus.None +}, + Description = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 DisplayName = "string", Description = "string", FeatureWindow = new FeatureWindow() @@ -207,6 +231,7 @@ public async Task Backfill_BackfillWorkspaceFeaturesetVersion() FeatureWindowStart = DateTimeOffset.Parse("2020-01-01T12:34:56.999+00:51"), FeatureWindowEnd = DateTimeOffset.Parse("2020-01-01T12:34:56.999+00:51"), }, +<<<<<<< HEAD DataAvailabilityStatus = { DataAvailabilityStatus.None @@ -216,6 +241,9 @@ public async Task Backfill_BackfillWorkspaceFeaturesetVersion() { ["string"] = "string", }, +======= + JobId = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ResourceInstanceType = "string", SparkConfiguration = { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs index acf6c88b8641..8622f3085aba 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningFeatureStoreEntityContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturestoreEntityContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +62,11 @@ public async Task GetAll_ListWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityContainer/getEntity.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +101,11 @@ public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetEntityWorkspaceFeaturestoreEntityContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityContainer/getEntity.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +136,11 @@ public async Task Exists_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetEntityWorkspaceFeaturestoreEntityContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityContainer/getEntity.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +183,11 @@ public async Task GetIfExists_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturestoreEntityContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs index 742b6d9c2599..98b9a2c02fed 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeatureStoreEntityContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningFeatureStoreEntityContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturestoreEntityContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityContainer/getEntity.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/getEntity.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityContainers_GetEntity" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetEntityWorkspaceFeaturestoreEntityContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturestoreEntityContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs index ca53970a0321..a9c869357af1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningFeaturestoreEntityVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceFeaturestoreEntityVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityVersion/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +63,11 @@ public async Task GetAll_ListWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturestoreEntityVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +103,11 @@ public async Task Get_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceFeaturestoreEntityVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +139,11 @@ public async Task Exists_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceFeaturestoreEntityVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +187,11 @@ public async Task GetIfExists_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceFeaturestoreEntityVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs index d21d51684ea0..8d8eaa4f69a1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningFeaturestoreEntityVersionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningFeaturestoreEntityVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceFeaturestoreEntityVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityVersion/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceFeaturestoreEntityVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetWorkspaceFeaturestoreEntityVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceFeaturestoreEntityVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/FeaturestoreEntityVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "FeaturestoreEntityVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs index 04fb61e60876..e51a6457a881 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobCollection.cs @@ -22,7 +22,11 @@ public partial class Sample_MachineLearningJobCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListAutoMLJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/AutoMLJob/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +63,11 @@ public async Task GetAll_ListAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListCommandJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/CommandJob/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,6 +90,49 @@ public async Task GetAll_ListCommandJob() string jobType = "string"; string tag = "string"; await foreach (MachineLearningJobResource item in collection.GetAllAsync(jobType: jobType, tag: tag)) +<<<<<<< HEAD +======= + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // List FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/list.json + // this example is just showing the usage of "Jobs_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation and iterate over the result + string jobType = "string"; + string tag = "string"; + MachineLearningListViewType? listViewType = MachineLearningListViewType.All; + await foreach (MachineLearningJobResource item in collection.GetAllAsync(jobType: jobType, tag: tag, listViewType: listViewType)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -98,7 +149,11 @@ public async Task GetAll_ListCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListPipelineJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/PipelineJob/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -137,7 +192,11 @@ public async Task GetAll_ListPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListSweepJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/SweepJob/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -176,7 +235,11 @@ public async Task GetAll_ListSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAutoMLJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/AutoMLJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -211,7 +274,11 @@ public async Task Get_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAutoMLJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/AutoMLJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -242,7 +309,11 @@ public async Task Exists_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAutoMLJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/AutoMLJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -285,7 +356,11 @@ public async Task GetIfExists_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetCommandJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/CommandJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -320,7 +395,11 @@ public async Task Get_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetCommandJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/CommandJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -351,7 +430,120 @@ public async Task Exists_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetCommandJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/CommandJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json + // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + NullableResponse response = await collection.GetIfExistsAsync(id); + MachineLearningJobResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json + // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + MachineLearningJobResource result = await collection.GetAsync(id); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json + // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + bool result = await collection.ExistsAsync(id); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -394,7 +586,11 @@ public async Task GetIfExists_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetPipelineJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/PipelineJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -429,7 +625,11 @@ public async Task Get_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetPipelineJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/PipelineJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -460,7 +660,11 @@ public async Task Exists_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetPipelineJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/PipelineJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -503,7 +707,11 @@ public async Task GetIfExists_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSweepJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/SweepJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -538,7 +746,11 @@ public async Task Get_GetSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetSweepJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/SweepJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -569,7 +781,11 @@ public async Task Exists_GetSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetSweepJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/SweepJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -612,7 +828,11 @@ public async Task GetIfExists_GetSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/AutoMLJob/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -643,6 +863,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() ValidationCropSize = 2, }, SearchSpace = +<<<<<<< HEAD { new ImageModelDistributionSettingsClassification() { @@ -652,6 +873,31 @@ public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() TargetColumnName = "string", }) { +======= +{ +new ImageModelDistributionSettingsClassification() +{ +ValidationCropSize = "choice(2, 360)", +} +}, + TargetColumnName = "string", + }) + { + EnvironmentId = "string", + EnvironmentVariables = +{ +["string"] = "string", +}, + Outputs = +{ +["string"] = new MachineLearningUriFileJobOutput() +{ +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, +Uri = new Uri("string"), +Description = "string", +}, +}, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Resources = new MachineLearningJobResourceConfiguration() { InstanceCount = 1, @@ -663,6 +909,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() ["9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad"] = null}), }, }, +<<<<<<< HEAD EnvironmentId = "string", EnvironmentVariables = { @@ -679,6 +926,13 @@ public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() }, DisplayName = "string", ExperimentName = "string", +======= + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Identity = new AmlToken(), + IsArchived = false, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Services = { ["string"] = new MachineLearningJobService() @@ -720,7 +974,11 @@ public async Task CreateOrUpdate_CreateOrUpdateAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateCommandJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/CommandJob/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -743,7 +1001,12 @@ public async Task CreateOrUpdate_CreateOrUpdateCommandJob() string id = "string"; MachineLearningJobData data = new MachineLearningJobData(new MachineLearningCommandJob("string", new ResourceIdentifier("string")) { +<<<<<<< HEAD Resources = new MachineLearningJobResourceConfiguration() +======= + CodeId = new ResourceIdentifier("string"), + Distribution = new TensorFlowDistributionConfiguration() +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { InstanceCount = 1, InstanceType = "string", @@ -766,11 +1029,16 @@ public async Task CreateOrUpdate_CreateOrUpdateCommandJob() { ["string"] = new MachineLearningUriFileJobOutput() { +<<<<<<< HEAD +======= +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri = new Uri("string"), Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, Description = "string", }, }, +<<<<<<< HEAD Distribution = new TensorFlowDistributionConfiguration() { WorkerCount = 1, @@ -786,6 +1054,23 @@ public async Task CreateOrUpdate_CreateOrUpdateCommandJob() }, DisplayName = "string", ExperimentName = "string", +======= + Resources = new MachineLearningJobResourceConfiguration() + { + InstanceCount = 1, + InstanceType = "string", + Properties = +{ +["string"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["e6b6493e-7d5e-4db3-be1e-306ec641327e"] = null}), +}, + }, + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Identity = new AmlToken(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Services = { ["string"] = new MachineLearningJobService() @@ -821,12 +1106,72 @@ public async Task CreateOrUpdate_CreateOrUpdateCommandJob() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // CreateOrUpdate FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // get the collection of this MachineLearningJobResource + MachineLearningJobCollection collection = machineLearningWorkspace.GetMachineLearningJobs(); + + // invoke the operation + string id = "string"; + MachineLearningJobData data = new MachineLearningJobData(new FineTuningJob(new CustomModelFineTuning(FineTuningTaskType.TextCompletion, new MachineLearningUriFileJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }, new MachineLearningFlowModelJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }), new Dictionary() + { + ["string"] = new MachineLearningFlowModelJobOutput() + { + Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, + Uri = new Uri("string"), + Description = "string", + }, + }) + { + ExperimentName = "llm-finetuning", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, id, data); + MachineLearningJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // CreateOrUpdate Pipeline Job. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdatePipelineJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/PipelineJob/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -909,7 +1254,11 @@ public async Task CreateOrUpdate_CreateOrUpdatePipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateSweepJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/SweepJob/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -930,22 +1279,39 @@ public async Task CreateOrUpdate_CreateOrUpdateSweepJob() // invoke the operation string id = "string"; +<<<<<<< HEAD MachineLearningJobData data = new MachineLearningJobData(new MachineLearningSweepJob(BinaryData.FromObjectAsJson(new Dictionary() +======= + MachineLearningJobData data = new MachineLearningJobData(new MachineLearningSweepJob(new MachineLearningObjective(MachineLearningGoal.Minimize, "string"), new GridSamplingAlgorithm(), BinaryData.FromObjectAsJson(new Dictionary() +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { ["string"] = new Dictionary() { } +<<<<<<< HEAD }), new GridSamplingAlgorithm(), new MachineLearningObjective("string", MachineLearningGoal.Minimize), new MachineLearningTrialComponent("string", new ResourceIdentifier("string")) { CodeId = new ResourceIdentifier("string"), +======= + }), new MachineLearningTrialComponent("string", new ResourceIdentifier("string")) + { + CodeId = new ResourceIdentifier("string"), + Distribution = new MpiDistributionConfiguration() + { + ProcessCountPerInstance = 1, + }, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 EnvironmentVariables = { ["string"] = "string", }, +<<<<<<< HEAD Distribution = new MpiDistributionConfiguration() { ProcessCountPerInstance = 1, }, +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Resources = new MachineLearningJobResourceConfiguration() { InstanceCount = 1, @@ -959,6 +1325,7 @@ public async Task CreateOrUpdate_CreateOrUpdateSweepJob() }, }) { +<<<<<<< HEAD Limits = new MachineLearningSweepJobLimits() { MaxTotalTrials = 1, @@ -970,6 +1337,20 @@ public async Task CreateOrUpdate_CreateOrUpdateSweepJob() EvaluationInterval = 1, DelayEvaluation = 1, }, +======= + EarlyTermination = new MedianStoppingPolicy() + { + DelayEvaluation = 1, + EvaluationInterval = 1, + }, + Limits = new MachineLearningSweepJobLimits() + { + MaxConcurrentTrials = 1, + MaxTotalTrials = 1, + TrialTimeout = XmlConvert.ToTimeSpan("PT1S"), + }, + ComputeId = new ResourceIdentifier("string"), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 DisplayName = "string", ExperimentName = "string", Services = diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs index b3a2e5057cbd..19c533f27234 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningJobResource.cs @@ -22,7 +22,11 @@ public partial class Sample_MachineLearningJobResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +54,11 @@ public async Task Delete_DeleteJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAutoMLJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/AutoMLJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,43 @@ public async Task Get_GetAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetCommandJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/CommandJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/get.json + // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobResource result = await machineLearningJob.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -114,7 +158,11 @@ public async Task Get_GetCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetPipelineJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/PipelineJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -146,7 +194,11 @@ public async Task Get_GetPipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSweepJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/SweepJob/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +230,11 @@ public async Task Get_GetSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateAutoMLJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/AutoMLJob/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/AutoMLJob/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -215,6 +271,7 @@ public async Task Update_CreateOrUpdateAutoMLJob() TargetColumnName = "string", }) { +<<<<<<< HEAD Resources = new MachineLearningJobResourceConfiguration() { InstanceCount = 1, @@ -226,6 +283,8 @@ public async Task Update_CreateOrUpdateAutoMLJob() ["9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad"] = null}), }, }, +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 EnvironmentId = "string", EnvironmentVariables = { @@ -235,6 +294,7 @@ public async Task Update_CreateOrUpdateAutoMLJob() { ["string"] = new MachineLearningUriFileJobOutput() { +<<<<<<< HEAD Uri = new Uri("string"), Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, Description = "string", @@ -242,19 +302,49 @@ public async Task Update_CreateOrUpdateAutoMLJob() }, DisplayName = "string", ExperimentName = "string", +======= +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, +Uri = new Uri("string"), +Description = "string", +}, +}, + Resources = new MachineLearningJobResourceConfiguration() + { + InstanceCount = 1, + InstanceType = "string", + Properties = +{ +["string"] = BinaryData.FromObjectAsJson(new Dictionary() +{ +["9bec0ab0-c62f-4fa9-a97c-7b24bbcc90ad"] = null}), +}, + }, + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Identity = new AmlToken(), + IsArchived = false, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Services = { ["string"] = new MachineLearningJobService() { +<<<<<<< HEAD JobServiceType = "string", Port = 1, Endpoint = "string", +======= +Endpoint = "string", +JobServiceType = "string", +Port = 1, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Properties = { ["string"] = "string", }, }, }, +<<<<<<< HEAD ComputeId = new ResourceIdentifier("string"), IsArchived = false, Identity = new AmlToken(), @@ -263,12 +353,24 @@ public async Task Update_CreateOrUpdateAutoMLJob() { ["string"] = "string", }, +======= + Description = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Properties = { ["string"] = "string", }, +<<<<<<< HEAD }); ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data, default); +======= + Tags = +{ +["string"] = "string", +}, + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningJobResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well @@ -283,7 +385,11 @@ public async Task Update_CreateOrUpdateAutoMLJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateCommandJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/CommandJob/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/CommandJob/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -303,6 +409,39 @@ public async Task Update_CreateOrUpdateCommandJob() // invoke the operation MachineLearningJobData data = new MachineLearningJobData(new MachineLearningCommandJob("string", new ResourceIdentifier("string")) { +<<<<<<< HEAD +======= + CodeId = new ResourceIdentifier("string"), + Distribution = new TensorFlowDistributionConfiguration() + { + ParameterServerCount = 1, + WorkerCount = 1, + }, + EnvironmentVariables = +{ +["string"] = "string", +}, + Inputs = +{ +["string"] = new MachineLearningLiteralJobInput("string") +{ +Description = "string", +}, +}, + Limits = new MachineLearningCommandJobLimits() + { + Timeout = XmlConvert.ToTimeSpan("PT5M"), + }, + Outputs = +{ +["string"] = new MachineLearningUriFileJobOutput() +{ +Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, +Uri = new Uri("string"), +Description = "string", +}, +}, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Resources = new MachineLearningJobResourceConfiguration() { InstanceCount = 1, @@ -314,6 +453,7 @@ public async Task Update_CreateOrUpdateCommandJob() ["e6b6493e-7d5e-4db3-be1e-306ec641327e"] = null}), }, }, +<<<<<<< HEAD CodeId = new ResourceIdentifier("string"), Inputs = { @@ -346,19 +486,32 @@ public async Task Update_CreateOrUpdateCommandJob() }, DisplayName = "string", ExperimentName = "string", +======= + ComputeId = new ResourceIdentifier("string"), + DisplayName = "string", + ExperimentName = "string", + Identity = new AmlToken(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Services = { ["string"] = new MachineLearningJobService() { +<<<<<<< HEAD JobServiceType = "string", Port = 1, Endpoint = "string", +======= +Endpoint = "string", +JobServiceType = "string", +Port = 1, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Properties = { ["string"] = "string", }, }, }, +<<<<<<< HEAD ComputeId = new ResourceIdentifier("string"), Identity = new AmlToken(), Description = "string", @@ -366,12 +519,77 @@ public async Task Update_CreateOrUpdateCommandJob() { ["string"] = "string", }, +======= + Description = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Properties = { ["string"] = "string", }, +<<<<<<< HEAD }); ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data, default); +======= + Tags = +{ +["string"] = "string", +}, + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); + MachineLearningJobResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // CreateOrUpdate FineTuning Job. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateOrUpdateFineTuningJob() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/FineTuningJob/createOrUpdate.json + // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningJobResource created on azure + // for more information of creating MachineLearningJobResource, please refer to the document of MachineLearningJobResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "my-aml-workspace"; + string id = "string"; + ResourceIdentifier machineLearningJobResourceId = MachineLearningJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, id); + MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); + + // invoke the operation + MachineLearningJobData data = new MachineLearningJobData(new FineTuningJob(new CustomModelFineTuning(FineTuningTaskType.TextCompletion, new MachineLearningUriFileJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }, new MachineLearningFlowModelJobInput(new Uri("azureml://registries/azureml-meta/models/Llama-2-7b/versions/11")) + { + Mode = MachineLearningInputDeliveryMode.ReadOnlyMount, + Description = null, + }), new Dictionary() + { + ["string"] = new MachineLearningFlowModelJobOutput() + { + Mode = MachineLearningOutputDeliveryMode.ReadWriteMount, + Uri = new Uri("string"), + Description = "string", + }, + }) + { + ExperimentName = "llm-finetuning", + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningJobResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well @@ -386,7 +604,11 @@ public async Task Update_CreateOrUpdateCommandJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdatePipelineJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/PipelineJob/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/PipelineJob/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -406,9 +628,12 @@ public async Task Update_CreateOrUpdatePipelineJob() // invoke the operation MachineLearningJobData data = new MachineLearningJobData(new MachineLearningPipelineJob() { +<<<<<<< HEAD Settings = BinaryData.FromObjectAsJson(new Dictionary() { }), +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Inputs = { ["string"] = new MachineLearningLiteralJobInput("string") @@ -420,38 +645,69 @@ public async Task Update_CreateOrUpdatePipelineJob() { ["string"] = new MachineLearningUriFileJobOutput() { +<<<<<<< HEAD Uri = new Uri("string"), Mode = MachineLearningOutputDeliveryMode.Upload, Description = "string", }, }, +======= +Mode = MachineLearningOutputDeliveryMode.Upload, +Uri = new Uri("string"), +Description = "string", +}, +}, + Settings = BinaryData.FromObjectAsJson(new Dictionary() + { + }), + ComputeId = new ResourceIdentifier("string"), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 DisplayName = "string", ExperimentName = "string", Services = { ["string"] = new MachineLearningJobService() { +<<<<<<< HEAD JobServiceType = "string", Port = 1, Endpoint = "string", +======= +Endpoint = "string", +JobServiceType = "string", +Port = 1, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Properties = { ["string"] = "string", }, }, }, +<<<<<<< HEAD ComputeId = new ResourceIdentifier("string"), Description = "string", Tags = { ["string"] = "string", }, +======= + Description = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Properties = { ["string"] = "string", }, +<<<<<<< HEAD }); ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data, default); +======= + Tags = +{ +["string"] = "string", +}, + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningJobResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well @@ -466,7 +722,11 @@ public async Task Update_CreateOrUpdatePipelineJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateSweepJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/SweepJob/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/SweepJob/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -484,11 +744,16 @@ public async Task Update_CreateOrUpdateSweepJob() MachineLearningJobResource machineLearningJob = client.GetMachineLearningJobResource(machineLearningJobResourceId); // invoke the operation +<<<<<<< HEAD MachineLearningJobData data = new MachineLearningJobData(new MachineLearningSweepJob(BinaryData.FromObjectAsJson(new Dictionary() +======= + MachineLearningJobData data = new MachineLearningJobData(new MachineLearningSweepJob(new MachineLearningObjective(MachineLearningGoal.Minimize, "string"), new GridSamplingAlgorithm(), BinaryData.FromObjectAsJson(new Dictionary() +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { ["string"] = new Dictionary() { } +<<<<<<< HEAD }), new GridSamplingAlgorithm(), new MachineLearningObjective("string", MachineLearningGoal.Minimize), new MachineLearningTrialComponent("string", new ResourceIdentifier("string")) { CodeId = new ResourceIdentifier("string"), @@ -496,10 +761,22 @@ public async Task Update_CreateOrUpdateSweepJob() { ["string"] = "string", }, +======= + }), new MachineLearningTrialComponent("string", new ResourceIdentifier("string")) + { + CodeId = new ResourceIdentifier("string"), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Distribution = new MpiDistributionConfiguration() { ProcessCountPerInstance = 1, }, +<<<<<<< HEAD +======= + EnvironmentVariables = +{ +["string"] = "string", +}, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Resources = new MachineLearningJobResourceConfiguration() { InstanceCount = 1, @@ -513,6 +790,7 @@ public async Task Update_CreateOrUpdateSweepJob() }, }) { +<<<<<<< HEAD Limits = new MachineLearningSweepJobLimits() { MaxTotalTrials = 1, @@ -524,33 +802,66 @@ public async Task Update_CreateOrUpdateSweepJob() EvaluationInterval = 1, DelayEvaluation = 1, }, +======= + EarlyTermination = new MedianStoppingPolicy() + { + DelayEvaluation = 1, + EvaluationInterval = 1, + }, + Limits = new MachineLearningSweepJobLimits() + { + MaxConcurrentTrials = 1, + MaxTotalTrials = 1, + TrialTimeout = XmlConvert.ToTimeSpan("PT1S"), + }, + ComputeId = new ResourceIdentifier("string"), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 DisplayName = "string", ExperimentName = "string", Services = { ["string"] = new MachineLearningJobService() { +<<<<<<< HEAD JobServiceType = "string", Port = 1, Endpoint = "string", +======= +Endpoint = "string", +JobServiceType = "string", +Port = 1, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Properties = { ["string"] = "string", }, }, }, +<<<<<<< HEAD ComputeId = new ResourceIdentifier("string"), Description = "string", Tags = { ["string"] = "string", }, +======= + Description = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Properties = { ["string"] = "string", }, +<<<<<<< HEAD }); ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data, default); +======= + Tags = +{ +["string"] = "string", +}, + }); + ArmOperation lro = await machineLearningJob.UpdateAsync(WaitUntil.Completed, data); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningJobResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well @@ -565,7 +876,11 @@ public async Task Update_CreateOrUpdateSweepJob() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Cancel_CancelJob() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Job/cancel.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Job/cancel.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Jobs_Cancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs index bed3ac097854..f68e55fae8c2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningModelContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs index 0efe515dc4fe..b9a26787eb5c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningModelContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetWorkspaceModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs index 62ced7520e21..5e81b096be6b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningModelVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelVersion/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +63,11 @@ public async Task GetAll_ListWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +103,11 @@ public async Task Get_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +139,11 @@ public async Task Exists_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +187,11 @@ public async Task GetIfExists_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs index 12762b36ce37..cfbc5a26b873 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningModelVersionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningModelVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelVersion/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +153,11 @@ public async Task Update_CreateOrUpdateWorkspaceModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Publish_PublishWorkspaceModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ModelVersion/publish.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ModelVersion/publish.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ModelVersions_Publish" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,9 +178,15 @@ public async Task Publish_PublishWorkspaceModelVersion() // invoke the operation DestinationAsset body = new DestinationAsset() { +<<<<<<< HEAD RegistryName = "string", DestinationName = "string", DestinationVersion = "string", +======= + DestinationName = "string", + DestinationVersion = "string", + RegistryName = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 }; await machineLearningModelVersion.PublishAsync(WaitUntil.Completed, body); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs index a9e17cd6f997..c6992147b7e7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentCollection.cs @@ -22,7 +22,11 @@ public partial class Sample_MachineLearningOnlineDeploymentCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListOnlineDeployments() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +66,11 @@ public async Task GetAll_ListOnlineDeployments() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetKubernetesOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +106,11 @@ public async Task Get_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetKubernetesOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +142,11 @@ public async Task Exists_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetKubernetesOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +190,11 @@ public async Task GetIfExists_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/ManagedOnlineDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,7 +230,11 @@ public async Task Get_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetManagedOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/ManagedOnlineDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -242,7 +266,11 @@ public async Task Exists_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetManagedOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/ManagedOnlineDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -286,7 +314,11 @@ public async Task GetIfExists_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateKubernetesOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -394,7 +426,11 @@ public async Task CreateOrUpdate_CreateOrUpdateKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateManagedOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs index 169b22bbc4c0..3a106977283d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineDeploymentResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningOnlineDeploymentResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineDeployment/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineDeployment/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetKubernetesOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/ManagedOnlineDeployment/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +127,11 @@ public async Task Get_GetManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateKubernetesOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/update.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -163,7 +179,11 @@ public async Task Update_UpdateKubernetesOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateManagedOnlineDeployment() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/ManagedOnlineDeployment/update.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/update.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -211,7 +231,11 @@ public async Task Update_UpdateManagedOnlineDeployment() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetLogs_GetOnlineDeploymentLogs() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/getLogs.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/getLogs.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_GetLogs" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -245,7 +269,11 @@ public async Task GetLogs_GetOnlineDeploymentLogs() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_ListKubernetesOnlineDeploymentSkus() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/KubernetesOnlineDeployment/listSkus.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -278,7 +306,11 @@ public async Task GetSkus_ListKubernetesOnlineDeploymentSkus() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_ListManagedOnlineDeploymentSkus() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/OnlineDeployment/ManagedOnlineDeployment/listSkus.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineDeployments_ListSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs index fe41baa7674e..7cb1a3e178ed 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointCollection.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearningOnlineEndpointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +63,11 @@ public async Task GetAll_ListWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +102,11 @@ public async Task Get_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +137,11 @@ public async Task Exists_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +184,11 @@ public async Task GetIfExists_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs index 5f287bd234b2..128e9b7c623d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOnlineEndpointResource.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearningOnlineEndpointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +89,11 @@ public async Task Get_GetWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/update.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/update.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +142,11 @@ public async Task Update_UpdateWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListKeysWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/listKeys.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/listKeys.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -158,7 +174,11 @@ public async Task GetKeys_ListKeysWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RegenerateKeys_RegenerateKeysWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/regenerateKeys.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/regenerateKeys.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -190,7 +210,11 @@ public async Task RegenerateKeys_RegenerateKeysWorkspaceOnlineEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetToken_GetTokenWorkspaceOnlineEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/OnlineEndpoint/getToken.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/OnlineEndpoint/getToken.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "OnlineEndpoints_GetToken" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs index 336dacb50252..6c4a2cb20869 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningOutboundRuleBasicCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListManagedNetworkSettingsRule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/ManagedNetwork/listRule.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/listRule.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ManagedNetworkSettingsRule_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedNetworkSettingsRule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/ManagedNetwork/getRule.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetManagedNetworkSettingsRule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/ManagedNetwork/getRule.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetManagedNetworkSettingsRule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/ManagedNetwork/getRule.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateManagedNetworkSettingsRule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/ManagedNetwork/createOrUpdateRule.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/createOrUpdateRule.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ManagedNetworkSettingsRule_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs index 7068120b968a..3d2ae6fc9b70 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningOutboundRuleBasicResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningOutboundRuleBasicResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteManagedNetworkSettingsRule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/ManagedNetwork/deleteRule.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/deleteRule.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ManagedNetworkSettingsRule_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagedNetworkSettingsRule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/ManagedNetwork/getRule.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/getRule.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ManagedNetworkSettingsRule_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetManagedNetworkSettingsRule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateManagedNetworkSettingsRule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/ManagedNetwork/createOrUpdateRule.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/createOrUpdateRule.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ManagedNetworkSettingsRule_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs index 37882ae86cfe..46e754e25b56 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningPrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_StorageAccountListPrivateEndpointConnections() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/PrivateEndpointConnection/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_StorageAccountListPrivateEndpointConnections() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_WorkspaceGetPrivateEndpointConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/PrivateEndpointConnection/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_WorkspaceGetPrivateEndpointConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/PrivateEndpointConnection/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_WorkspaceGetPrivateEndpointConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/PrivateEndpointConnection/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_WorkspacePutPrivateEndpointConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/PrivateEndpointConnection/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs index 0f7384528f55..75da752f69fd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningPrivateEndpointConnectionResource.cs @@ -15,12 +15,47 @@ namespace Azure.ResourceManager.MachineLearning.Samples { public partial class Sample_MachineLearningPrivateEndpointConnectionResource { +<<<<<<< HEAD +======= + // WorkspacePutPrivateEndpointConnection + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_WorkspacePutPrivateEndpointConnection() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/delete.json + // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningPrivateEndpointConnectionResource created on azure + // for more information of creating MachineLearningPrivateEndpointConnectionResource, please refer to the document of MachineLearningPrivateEndpointConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "rg-1234"; + string workspaceName = "testworkspace"; + string privateEndpointConnectionName = "{privateEndpointConnectionName}"; + ResourceIdentifier machineLearningPrivateEndpointConnectionResourceId = MachineLearningPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName); + MachineLearningPrivateEndpointConnectionResource machineLearningPrivateEndpointConnection = client.GetMachineLearningPrivateEndpointConnectionResource(machineLearningPrivateEndpointConnectionResourceId); + + // invoke the operation + await machineLearningPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // WorkspaceGetPrivateEndpointConnection [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_WorkspaceGetPrivateEndpointConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/PrivateEndpointConnection/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +87,11 @@ public async Task Get_WorkspaceGetPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_WorkspacePutPrivateEndpointConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/PrivateEndpointConnection/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateEndpointConnection/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs index 3e0dcc45f55d..d6fea70c72dd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryCodeContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs index 183c8b8e2d60..68e915cd01e3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryCodeContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetRegistryCodeContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryCodeContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs index 73e592f7fecf..33ea7a99b682 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryCodeVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeVersion/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +64,11 @@ public async Task GetAll_ListRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +104,11 @@ public async Task Get_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +140,11 @@ public async Task Exists_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +188,11 @@ public async Task GetIfExists_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs index b1d6fc89129a..fffa3003550c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCodeVersionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryCodeVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeVersion/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +142,11 @@ public async Task Update_CreateOrUpdateRegistryCodeVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadRegistryCodeVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/CodeVersion/createOrGetStartPendingUpload.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/CodeVersion/createOrGetStartPendingUpload.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryCodeVersions_CreateOrGetStartPendingUpload" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs index 5cbc7678677b..6eeec1259942 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryCollection.cs @@ -22,7 +22,11 @@ public partial class Sample_MachineLearningRegistryCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistriesWithSystemCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/list-SystemCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/list-SystemCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +62,11 @@ public async Task GetAll_ListRegistriesWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistriesWithUserCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/list-UserCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/list-UserCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -94,7 +102,11 @@ public async Task GetAll_ListRegistriesWithUserCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryWithSystemCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/get-SystemCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +140,11 @@ public async Task Get_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryWithSystemCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/get-SystemCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -158,7 +174,11 @@ public async Task Exists_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryWithSystemCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/get-SystemCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -200,7 +220,11 @@ public async Task GetIfExists_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryWithUserCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/get-UserCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -234,7 +258,11 @@ public async Task Get_GetRegistryWithUserCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryWithUserCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/get-UserCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -264,7 +292,11 @@ public async Task Exists_GetRegistryWithUserCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryWithUserCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/get-UserCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -306,7 +338,11 @@ public async Task GetIfExists_GetRegistryWithUserCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryWithSystemCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/createOrUpdate-SystemCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/createOrUpdate-SystemCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -423,7 +459,11 @@ public async Task CreateOrUpdate_CreateOrUpdateRegistryWithSystemCreatedAccounts [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryWithUserCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/createOrUpdate-UserCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/createOrUpdate-UserCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -482,7 +522,11 @@ public async Task CreateOrUpdate_CreateOrUpdateRegistryWithUserCreatedAccounts() { ActionsRequired = "string", Description = "string", +<<<<<<< HEAD Status = EndpointServiceConnectionStatus.Approved, +======= +Status = MachineLearningPrivateEndpointServiceConnectionStatus.Approved, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 }, ProvisioningState = "string", } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs index b976351c53af..919e85c9ff4f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryDataContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_RegistryListRegistryDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataContainer/registryList.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/registryList.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +62,11 @@ public async Task GetAll_RegistryListRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +101,11 @@ public async Task Get_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +136,11 @@ public async Task Exists_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +183,11 @@ public async Task GetIfExists_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs index 3c443dbdcaf6..c8953d557423 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryDataContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetRegistryDataContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryDataContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs index 31b9a44892ec..30b4c5ab43bb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryDataVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_RegistryListRegistryDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataVersionBase/registryList.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/registryList.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +66,11 @@ public async Task GetAll_RegistryListRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataVersionBase/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +106,11 @@ public async Task Get_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataVersionBase/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,7 +142,11 @@ public async Task Exists_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataVersionBase/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -174,7 +190,11 @@ public async Task GetIfExists_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataVersionBase/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs index a8eb7798b26e..5430398974d6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryDataVersionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryDataVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataVersionBase/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataVersionBase/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataVersionBase/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -134,7 +146,11 @@ public async Task Update_CreateOrUpdateRegistryDataVersionBase() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadRegistryDataVersionBase() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/DataVersionBase/createOrGetStartPendingUpload.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/DataVersionBase/createOrGetStartPendingUpload.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataVersions_CreateOrGetStartPendingUpload" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs index 8b91affc1bb3..8515ec7e07ab 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryEnvironmentContainerCollectio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs index b4f45f58c281..b5f09eef9110 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryEnvironmentContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetRegistryEnvironmentContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryEnvironmentContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs index 2cb0dc43bacc..8cef09c71f06 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryEnvironmentVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentVersion/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -60,7 +64,11 @@ public async Task GetAll_ListRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +104,11 @@ public async Task Get_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +140,11 @@ public async Task Exists_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +188,11 @@ public async Task GetIfExists_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs index 799fc9966690..eae33219f320 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryEnvironmentVersionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryEnvironmentVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentVersion/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetRegistryEnvironmentVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryEnvironmentVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/EnvironmentVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/EnvironmentVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryEnvironmentVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs index 2f7526b40337..fa069b5efaf2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryModelContainerCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelContainer/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelContainers_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs index da10344660d0..0c9321c08d75 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelContainerResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryModelContainerResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelContainer/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelContainers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelContainer/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelContainers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetRegistryModelContainer() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryModelContainer() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelContainer/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelContainer/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelContainers_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs index 3e3d0fb323df..1583c9784846 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryModelVersionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListRegistryModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelVersion/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelVersions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +63,11 @@ public async Task GetAll_ListRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -95,7 +103,11 @@ public async Task Get_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetRegistryModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +139,11 @@ public async Task Exists_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetRegistryModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -171,7 +187,11 @@ public async Task GetIfExists_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateRegistryModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs index 49471a0103e9..39b11e558076 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryModelVersionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MachineLearningRegistryModelVersionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistryModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelVersion/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelVersions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelVersion/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelVersions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,7 +90,11 @@ public async Task Get_GetRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateRegistryModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelVersion/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,7 +153,11 @@ public async Task Update_CreateOrUpdateRegistryModelVersion() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrGetStartPendingUpload_CreateOrGetStartPendingUploadRegistryModelVersion() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registry/ModelVersion/createOrGetStartPendingUpload.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registry/ModelVersion/createOrGetStartPendingUpload.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryModelVersions_CreateOrGetStartPendingUpload" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs index a924a1305df7..87451e242663 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningRegistryResource.cs @@ -22,7 +22,11 @@ public partial class Sample_MachineLearningRegistryResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetBlobReferenceSasRegistryDataReference_GetBlobReferenceSASDataReference() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/DataReference/getBlobReferenceSAS.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/DataReference/getBlobReferenceSAS.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "RegistryDataReferences_GetBlobReferenceSas" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +60,11 @@ public async Task GetBlobReferenceSasRegistryDataReference_GetBlobReferenceSASDa [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningRegistries_ListRegistriesBySubscription() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/listBySubscription.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/listBySubscription.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -88,7 +96,11 @@ public async Task GetMachineLearningRegistries_ListRegistriesBySubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteRegistry() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,7 +127,11 @@ public async Task Delete_DeleteRegistry() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryWithSystemCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/get-SystemCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-SystemCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -146,7 +162,11 @@ public async Task Get_GetRegistryWithSystemCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetRegistryWithUserCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/get-UserCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/get-UserCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -177,7 +197,11 @@ public async Task Get_GetRegistryWithUserCreatedAccounts() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateRegistryWithSystemCreatedAccounts() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/update-SystemCreated.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/update-SystemCreated.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -276,12 +300,68 @@ public async Task Update_UpdateRegistryWithUserCreatedAccounts() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Update Registry with user created accounts. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateRegistryWithUserCreatedAccounts() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/update-UserCreated.json + // this example is just showing the usage of "Registries_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningRegistryResource created on azure + // for more information of creating MachineLearningRegistryResource, please refer to the document of MachineLearningRegistryResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string registryName = "string"; + ResourceIdentifier machineLearningRegistryResourceId = MachineLearningRegistryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, registryName); + MachineLearningRegistryResource machineLearningRegistry = client.GetMachineLearningRegistryResource(machineLearningRegistryResourceId); + + // invoke the operation + MachineLearningRegistryPatch patch = new MachineLearningRegistryPatch() + { + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("string")] = new UserAssignedIdentity(), +}, + }, + Sku = new MachineLearningSkuPatch() + { + Capacity = 1, + Family = "string", + Name = "string", + Size = "string", + Tier = MachineLearningSkuTier.Basic, + }, + Tags = +{ +}, + }; + MachineLearningRegistryResource result = await machineLearningRegistry.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningRegistryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Remove regions from registry [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RemoveRegions_RemoveRegionsFromRegistry() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Registries/removeRegions.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Registries/removeRegions.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Registries_RemoveRegions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs index 9004740e819f..be8c86118e74 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleCollection.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearningScheduleCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListSchedules() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Schedule/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Schedules_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +62,11 @@ public async Task GetAll_ListSchedules() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSchedule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Schedule/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Schedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +101,11 @@ public async Task Get_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetSchedule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Schedule/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Schedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +136,11 @@ public async Task Exists_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetSchedule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Schedule/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Schedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +183,11 @@ public async Task GetIfExists_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateSchedule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Schedule/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Schedules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs index 47302b51176e..212e8cc5a5c7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningScheduleResource.cs @@ -21,7 +21,11 @@ public partial class Sample_MachineLearningScheduleResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteSchedule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Schedule/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Schedules_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetSchedule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Schedule/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Schedules_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +89,11 @@ public async Task Get_GetSchedule() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateSchedule() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Schedule/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Schedule/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Schedules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs index fb60944226e9..475c46d5fe3e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceCollection.cs @@ -17,12 +17,55 @@ namespace Azure.ResourceManager.MachineLearning.Samples { public partial class Sample_MachineLearningWorkspaceCollection { +<<<<<<< HEAD +======= + // Get Workspaces by Resource Group + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GetWorkspacesByResourceGroup() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listByResourceGroup.json + // this example is just showing the usage of "Workspaces_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "workspace-1234"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineLearningWorkspaceResource + MachineLearningWorkspaceCollection collection = resourceGroupResource.GetMachineLearningWorkspaces(); + + // invoke the operation and iterate over the result + await foreach (MachineLearningWorkspaceResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningWorkspaceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // Get Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspace() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +99,11 @@ public async Task Get_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspace() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +133,11 @@ public async Task Exists_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspace() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +179,11 @@ public async Task GetIfExists_GetWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateWorkspace() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/create.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/create.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs index bc86545806a2..9d3d8130f523 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionCollection.cs @@ -20,8 +20,13 @@ public partial class Sample_MachineLearningWorkspaceConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateWorkspaceConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/WorkspaceConnection/create.json // this example is just showing the usage of "WorkspaceConnections_Create" operation, for the dependent resources, they will have to be created separately. +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/list.json + // this example is just showing the usage of "WorkspaceConnections_List" operation, for the dependent resources, they will have to be created separately. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -61,7 +66,11 @@ public async Task CreateOrUpdate_CreateWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/WorkspaceConnection/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "WorkspaceConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -96,7 +105,11 @@ public async Task Get_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/WorkspaceConnection/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "WorkspaceConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +140,11 @@ public async Task Exists_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/WorkspaceConnection/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "WorkspaceConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -170,8 +187,13 @@ public async Task GetIfExists_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceConnections() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/WorkspaceConnection/list.json // this example is just showing the usage of "WorkspaceConnections_List" operation, for the dependent resources, they will have to be created separately. +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/create.json + // this example is just showing the usage of "WorkspaceConnections_Create" operation, for the dependent resources, they will have to be created separately. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs index 3a448537e501..2b0a991357f9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceConnectionResource.cs @@ -20,8 +20,13 @@ public partial class Sample_MachineLearningWorkspaceConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateWorkspaceConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/WorkspaceConnection/create.json // this example is just showing the usage of "WorkspaceConnections_Create" operation, for the dependent resources, they will have to be created separately. +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/delete.json + // this example is just showing the usage of "WorkspaceConnections_Delete" operation, for the dependent resources, they will have to be created separately. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -58,7 +63,11 @@ public async Task Update_CreateWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/WorkspaceConnection/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "WorkspaceConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,8 +99,13 @@ public async Task Get_GetWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/WorkspaceConnection/delete.json // this example is just showing the usage of "WorkspaceConnections_Delete" operation, for the dependent resources, they will have to be created separately. +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/update.json + // this example is just showing the usage of "WorkspaceConnections_Update" operation, for the dependent resources, they will have to be created separately. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -101,14 +115,39 @@ public async Task Delete_DeleteWorkspaceConnection() // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource string subscriptionId = "00000000-1111-2222-3333-444444444444"; +<<<<<<< HEAD string resourceGroupName = "resourceGroup-1"; +======= + string resourceGroupName = "test-rg"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 string workspaceName = "workspace-1"; string connectionName = "connection-1"; ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); // invoke the operation +<<<<<<< HEAD await machineLearningWorkspaceConnection.DeleteAsync(WaitUntil.Completed); +======= + MachineLearningWorkspaceConnectionPatch patch = new MachineLearningWorkspaceConnectionPatch() + { + Properties = new AccessKeyAuthTypeWorkspaceConnectionProperties() + { + Credentials = new WorkspaceConnectionAccessKey() + { + AccessKeyId = "some_string", + SecretAccessKey = "some_string", + }, + Category = MachineLearningConnectionCategory.AdlsGen2, + ExpiryOn = DateTimeOffset.Parse("2020-01-01T00:00:00Z"), + Metadata = +{ +}, + Target = "some_string", + }, + }; + MachineLearningWorkspaceConnectionResource result = await machineLearningWorkspaceConnection.UpdateAsync(patch); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Console.WriteLine($"Succeeded"); } @@ -118,7 +157,11 @@ public async Task Delete_DeleteWorkspaceConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSecrets_GetWorkspaceConnection() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/WorkspaceConnection/listSecrets.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/listSecrets.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "WorkspaceConnections_ListSecrets" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,5 +187,70 @@ public async Task GetSecrets_GetWorkspaceConnection() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // TestWorkspaceConnection + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task TestConnection_TestWorkspaceConnection() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/testConnection.json + // this example is just showing the usage of "WorkspaceConnections_TestConnection" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "workspace-1"; + string connectionName = "connection-1"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // invoke the operation + MachineLearningWorkspaceConnectionData data = new MachineLearningWorkspaceConnectionData(new MachineLearningNoneAuthTypeWorkspaceConnection() + { + Category = MachineLearningConnectionCategory.ContainerRegistry, + ExpiryOn = DateTimeOffset.Parse("2024-03-15T14:30:00Z"), + Target = "target_url", + }); + await machineLearningWorkspaceConnection.TestConnectionAsync(WaitUntil.Completed, data: data); + + Console.WriteLine($"Succeeded"); + } + + // Get Azure OpenAI Connection Models + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetModelsConnections_GetAzureOpenAIConnectionModels() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getModels.json + // this example is just showing the usage of "Connection_GetModels" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // invoke the operation and iterate over the result + await foreach (EndpointModelProperties item in machineLearningWorkspaceConnection.GetModelsConnectionsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs index 18fffa45e98c..c072ab5cc24b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MachineLearningWorkspaceResource.cs @@ -16,12 +16,108 @@ namespace Azure.ResourceManager.MachineLearning.Samples { public partial class Sample_MachineLearningWorkspaceResource { +<<<<<<< HEAD +======= + // List Workspace features + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetWorkspaceFeatures_ListWorkspaceFeatures() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceFeature/list.json + // this example is just showing the usage of "WorkspaceFeatures_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string workspaceName = "testworkspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // invoke the operation and iterate over the result + await foreach (MachineLearningUserFeature item in machineLearningWorkspace.GetWorkspaceFeaturesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Workspaces by subscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetMachineLearningWorkspaces_GetWorkspacesBySubscription() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listBySubscription.json + // this example is just showing the usage of "Workspaces_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (MachineLearningWorkspaceResource item in subscriptionResource.GetMachineLearningWorkspacesAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MachineLearningWorkspaceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Delete Workspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteWorkspace() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/delete.json + // this example is just showing the usage of "Workspaces_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "workspace-1234"; + string workspaceName = "testworkspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // invoke the operation + await machineLearningWorkspace.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // Get Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspace() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +175,11 @@ public async Task Delete_DeleteWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspace() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/update.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/update.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +217,11 @@ public async Task Update_UpdateWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Diagnose_DiagnoseWorkspace() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/diagnose.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/diagnose.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_Diagnose" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -178,7 +282,11 @@ public async Task Diagnose_DiagnoseWorkspace() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListWorkspaceKeys() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/listKeys.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listKeys.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -264,7 +372,11 @@ public async Task GetMachineLearningWorkspaces_GetWorkspacesBySubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNotebookAccessToken_ListWorkspaceKeys() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/listNotebookAccessToken.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listNotebookAccessToken.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_ListNotebookAccessToken" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -291,8 +403,13 @@ public async Task GetNotebookAccessToken_ListWorkspaceKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task PrepareNotebook_PrepareNotebook() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Notebook/prepare.json // this example is just showing the usage of "Workspaces_PrepareNotebook" operation, for the dependent resources, they will have to be created separately. +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Notebook/listKeys.json + // this example is just showing the usage of "Workspaces_ListNotebookKeys" operation, for the dependent resources, they will have to be created separately. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -319,7 +436,11 @@ public async Task PrepareNotebook_PrepareNotebook() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetStorageAccountKeys_ListWorkspaceKeys() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/listStorageAccountKeys.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/listStorageAccountKeys.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_ListStorageAccountKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -373,7 +494,11 @@ public async Task GetNotebookKeys_ListWorkspaceKeys() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDependenciesEndpoints() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/ExternalFQDN/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ExternalFQDN/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Workspaces_ListOutboundNetworkDependenciesEndpoints" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -398,12 +523,138 @@ public async Task GetOutboundNetworkDependenciesEndpoints_ListOutboundNetworkDep Console.WriteLine($"Succeeded"); } +<<<<<<< HEAD +======= + // Prepare Notebook + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task PrepareNotebook_PrepareNotebook() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Notebook/prepare.json + // this example is just showing the usage of "Workspaces_PrepareNotebook" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // invoke the operation + ArmOperation lro = await machineLearningWorkspace.PrepareNotebookAsync(WaitUntil.Completed); + MachineLearningNotebookResourceInfo result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + // Resync Workspace Keys + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ResyncKeys_ResyncWorkspaceKeys() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/resyncKeys.json + // this example is just showing the usage of "Workspaces_ResyncKeys" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"; + string resourceGroupName = "testrg123"; + string workspaceName = "workspaces123"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // invoke the operation + await machineLearningWorkspace.ResyncKeysAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetModelsConnections_GetModelsUnderTheAzureMLWorkspaceForAllAzureOpenAIConnectionsThatTheUserCanDeploy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/listConnectionModels.json + // this example is just showing the usage of "Connection_ListModels" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // invoke the operation and iterate over the result + await foreach (EndpointModelProperties item in machineLearningWorkspace.GetModelsConnectionsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint Deployments In Workspace + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetInWorkspaceEndpointDeployments_GetEndpointDeploymentsInWorkspace() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/getInWorkspace.json + // this example is just showing the usage of "EndpointDeployment_GetInWorkspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceResource created on azure + // for more information of creating MachineLearningWorkspaceResource, please refer to the document of MachineLearningWorkspaceResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + ResourceIdentifier machineLearningWorkspaceResourceId = MachineLearningWorkspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName); + MachineLearningWorkspaceResource machineLearningWorkspace = client.GetMachineLearningWorkspaceResource(machineLearningWorkspaceResourceId); + + // invoke the operation and iterate over the result + await foreach (WorkspaceEndpointDeploymentResource item in machineLearningWorkspace.GetInWorkspaceEndpointDeploymentsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // WorkspaceListPrivateLinkResources [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetPrivateLinkResources_WorkspaceListPrivateLinkResources() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/PrivateLinkResource/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/PrivateLinkResource/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "PrivateLinkResources_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -433,7 +684,11 @@ public async Task GetPrivateLinkResources_WorkspaceListPrivateLinkResources() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task ProvisionManagedNetworkManagedNetworkProvision_ProvisionManagedNetwork() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/ManagedNetwork/provision.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/ManagedNetwork/provision.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ManagedNetworkProvisions_ProvisionManagedNetwork" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs index 7b5fe6f7e9e2..d43949c6740f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionCollection.cs @@ -20,7 +20,11 @@ public partial class Sample_MarketplaceSubscriptionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceMarketplaceSubscription() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/MarketplaceSubscription/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "MarketplaceSubscriptions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +61,11 @@ public async Task GetAll_ListWorkspaceMarketplaceSubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceMarketplaceSubscription() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/MarketplaceSubscription/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "MarketplaceSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +100,11 @@ public async Task Get_GetWorkspaceMarketplaceSubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceMarketplaceSubscription() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/MarketplaceSubscription/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "MarketplaceSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +135,11 @@ public async Task Exists_GetWorkspaceMarketplaceSubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceMarketplaceSubscription() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/MarketplaceSubscription/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "MarketplaceSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +182,11 @@ public async Task GetIfExists_GetWorkspaceMarketplaceSubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceMarketplaceSubscription() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/MarketplaceSubscription/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "MarketplaceSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs index 26faccdd58f7..a2f58eddfefa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_MarketplaceSubscriptionResource.cs @@ -20,7 +20,11 @@ public partial class Sample_MarketplaceSubscriptionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceMarketplaceSubscription() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/MarketplaceSubscription/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "MarketplaceSubscriptions_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,7 +52,11 @@ public async Task Delete_DeleteWorkspaceMarketplaceSubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceMarketplaceSubscription() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/MarketplaceSubscription/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "MarketplaceSubscriptions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +88,11 @@ public async Task Get_GetWorkspaceMarketplaceSubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateWorkspaceMarketplaceSubscription() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/MarketplaceSubscription/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/MarketplaceSubscription/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "MarketplaceSubscriptions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResource.cs new file mode 100644 index 000000000000..6ef2b6e228f2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResource.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistItemPropertiesBasicResource + { + // Delete RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/delete.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistItemPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistItemPropertiesBasicResource, please refer to the document of RaiBlocklistItemPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + string raiBlocklistItemName = "raiBlocklistItemName"; + ResourceIdentifier raiBlocklistItemPropertiesBasicResourceId = RaiBlocklistItemPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource raiBlocklistItemPropertiesBasicResource = client.GetRaiBlocklistItemPropertiesBasicResource(raiBlocklistItemPropertiesBasicResourceId); + + // invoke the operation + await raiBlocklistItemPropertiesBasicResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistItemPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistItemPropertiesBasicResource, please refer to the document of RaiBlocklistItemPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + string raiBlocklistItemName = "raiBlocklistItemName"; + ResourceIdentifier raiBlocklistItemPropertiesBasicResourceId = RaiBlocklistItemPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource raiBlocklistItemPropertiesBasicResource = client.GetRaiBlocklistItemPropertiesBasicResource(raiBlocklistItemPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistItemPropertiesBasicResource result = await raiBlocklistItemPropertiesBasicResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/create.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistItemPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistItemPropertiesBasicResource, please refer to the document of RaiBlocklistItemPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + string raiBlocklistItemName = "raiBlocklistItemName"; + ResourceIdentifier raiBlocklistItemPropertiesBasicResourceId = RaiBlocklistItemPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource raiBlocklistItemPropertiesBasicResource = client.GetRaiBlocklistItemPropertiesBasicResource(raiBlocklistItemPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistItemPropertiesBasicResourceData data = new RaiBlocklistItemPropertiesBasicResourceData(new RaiBlocklistItemProperties() + { + IsRegex = false, + Pattern = "Pattern To Block", + }); + ArmOperation lro = await raiBlocklistItemPropertiesBasicResource.UpdateAsync(WaitUntil.Completed, data); + RaiBlocklistItemPropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResourceCollection.cs new file mode 100644 index 000000000000..09ebde51ea62 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistItemPropertiesBasicResourceCollection.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistItemPropertiesBasicResourceCollection + { + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + RaiBlocklistItemPropertiesBasicResource result = await collection.GetAsync(raiBlocklistItemName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + bool result = await collection.ExistsAsync(raiBlocklistItemName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/get.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + NullableResponse response = await collection.GetIfExistsAsync(raiBlocklistItemName); + RaiBlocklistItemPropertiesBasicResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create RaiBlocklist Item + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiBlocklistItem() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/create.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistItemName = "raiBlocklistItemName"; + RaiBlocklistItemPropertiesBasicResourceData data = new RaiBlocklistItemPropertiesBasicResourceData(new RaiBlocklistItemProperties() + { + IsRegex = false, + Pattern = "Pattern To Block", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiBlocklistItemName, data); + RaiBlocklistItemPropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // List RaiBlocklist Items + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiBlocklistItems() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/list.json + // this example is just showing the usage of "ConnectionRaiBlocklistItems_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // get the collection of this RaiBlocklistItemPropertiesBasicResource + RaiBlocklistItemPropertiesBasicResourceCollection collection = raiBlocklistPropertiesBasicResource.GetRaiBlocklistItemPropertiesBasicResources(); + + // invoke the operation and iterate over the result + await foreach (RaiBlocklistItemPropertiesBasicResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistItemPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResource.cs new file mode 100644 index 000000000000..aacc0ca4270f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResource.cs @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistPropertiesBasicResource + { + // Delete Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/delete.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + await raiBlocklistPropertiesBasicResource.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistPropertiesBasicResource result = await raiBlocklistPropertiesBasicResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/create.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + RaiBlocklistPropertiesBasicResourceData data = new RaiBlocklistPropertiesBasicResourceData(new RaiBlocklistProperties() + { + Description = "Basic blocklist description", + }); + ArmOperation lro = await raiBlocklistPropertiesBasicResource.UpdateAsync(WaitUntil.Completed, data); + RaiBlocklistPropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Bulk Rai Blocklist Items + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task AddBulkConnectionRaiBlocklistItem_CreateBulkRaiBlocklistItems() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/addBulk.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_AddBulk" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + IEnumerable content = new RaiBlocklistItemBulkRequest[] + { +new RaiBlocklistItemBulkRequest() +{ +Name = "myblocklistitem1", +Properties = new RaiBlocklistItemProperties() +{ +IsRegex = true, +Pattern = "^[a-z0-9_-]{2,16}$", +}, +},new RaiBlocklistItemBulkRequest() +{ +Name = "myblocklistitem2", +Properties = new RaiBlocklistItemProperties() +{ +IsRegex = false, +Pattern = "blockwords", +}, +} + }; + ArmOperation> lro = await raiBlocklistPropertiesBasicResource.AddBulkConnectionRaiBlocklistItemAsync(WaitUntil.Completed, content); + IList result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + // Delete Bulk Rai Blocklist Items + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task DeleteBulkConnectionRaiBlocklistItem_DeleteBulkRaiBlocklistItems() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklistItem/deleteBulk.json + // this example is just showing the usage of "ConnectionRaiBlocklistItem_DeleteBulk" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this RaiBlocklistPropertiesBasicResource created on azure + // for more information of creating RaiBlocklistPropertiesBasicResource, please refer to the document of RaiBlocklistPropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiBlocklistName = "raiBlocklistName"; + ResourceIdentifier raiBlocklistPropertiesBasicResourceId = RaiBlocklistPropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + RaiBlocklistPropertiesBasicResource raiBlocklistPropertiesBasicResource = client.GetRaiBlocklistPropertiesBasicResource(raiBlocklistPropertiesBasicResourceId); + + // invoke the operation + BinaryData body = BinaryData.FromObjectAsJson(new object[] { "myblocklistitem1", "myblocklistitem2" }); + await raiBlocklistPropertiesBasicResource.DeleteBulkConnectionRaiBlocklistItemAsync(WaitUntil.Completed, body); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResourceCollection.cs new file mode 100644 index 000000000000..847727a96ff3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_RaiBlocklistPropertiesBasicResourceCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_RaiBlocklistPropertiesBasicResourceCollection + { + // List Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/list.json + // this example is just showing the usage of "ConnectionRaiBlocklists_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation and iterate over the result + await foreach (RaiBlocklistPropertiesBasicResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + RaiBlocklistPropertiesBasicResource result = await collection.GetAsync(raiBlocklistName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + bool result = await collection.ExistsAsync(raiBlocklistName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/get.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + NullableResponse response = await collection.GetIfExistsAsync(raiBlocklistName); + RaiBlocklistPropertiesBasicResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Rai Blocklist + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiBlocklist() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiBlocklist/create.json + // this example is just showing the usage of "ConnectionRaiBlocklist_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this RaiBlocklistPropertiesBasicResource + RaiBlocklistPropertiesBasicResourceCollection collection = machineLearningWorkspaceConnection.GetRaiBlocklistPropertiesBasicResources(); + + // invoke the operation + string raiBlocklistName = "raiBlocklistName"; + RaiBlocklistPropertiesBasicResourceData data = new RaiBlocklistPropertiesBasicResourceData(new RaiBlocklistProperties() + { + Description = "Basic blocklist description", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiBlocklistName, data); + RaiBlocklistPropertiesBasicResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiBlocklistPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointCollection.cs index 6017fcba579c..e87bb8153249 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointCollection.cs @@ -21,7 +21,11 @@ public partial class Sample_ServerlessEndpointCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListWorkspaceServerlessEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ServerlessEndpoint/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ServerlessEndpoints_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -58,7 +62,11 @@ public async Task GetAll_ListWorkspaceServerlessEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceServerlessEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ServerlessEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ServerlessEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -93,7 +101,11 @@ public async Task Get_GetWorkspaceServerlessEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetWorkspaceServerlessEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ServerlessEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ServerlessEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -124,7 +136,11 @@ public async Task Exists_GetWorkspaceServerlessEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetWorkspaceServerlessEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ServerlessEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ServerlessEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -167,7 +183,11 @@ public async Task GetIfExists_GetWorkspaceServerlessEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateWorkspaceServerlessEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ServerlessEndpoint/createOrUpdate.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/createOrUpdate.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ServerlessEndpoints_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -190,11 +210,18 @@ public async Task CreateOrUpdate_CreateOrUpdateWorkspaceServerlessEndpoint() string name = "string"; ServerlessEndpointData data = new ServerlessEndpointData(new AzureLocation("string"), new ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode.Key) { +<<<<<<< HEAD ModelId = "string", ContentSafetyStatus = ContentSafetyStatus.Enabled, }) { Kind = "string", +======= + ContentSafetyStatus = ContentSafetyStatus.Enabled, + ModelId = "string", + }) + { +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Identity = new ManagedServiceIdentity("SystemAssigned") { UserAssignedIdentities = @@ -202,6 +229,10 @@ public async Task CreateOrUpdate_CreateOrUpdateWorkspaceServerlessEndpoint() [new ResourceIdentifier("string")] = new UserAssignedIdentity(), }, }, +<<<<<<< HEAD +======= + Kind = "string", +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Sku = new MachineLearningSku("string") { Tier = MachineLearningSkuTier.Standard, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs index 699e0773ae8b..735b08f3cdaa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_ServerlessEndpointResource.cs @@ -21,7 +21,11 @@ public partial class Sample_ServerlessEndpointResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteWorkspaceServerlessEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ServerlessEndpoint/delete.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/delete.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ServerlessEndpoints_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -49,7 +53,11 @@ public async Task Delete_DeleteWorkspaceServerlessEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetWorkspaceServerlessEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ServerlessEndpoint/get.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/get.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ServerlessEndpoints_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +89,11 @@ public async Task Get_GetWorkspaceServerlessEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateWorkspaceServerlessEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ServerlessEndpoint/update.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/update.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ServerlessEndpoints_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,6 +113,7 @@ public async Task Update_UpdateWorkspaceServerlessEndpoint() // invoke the operation ServerlessEndpointPatch patch = new ServerlessEndpointPatch() { +<<<<<<< HEAD Sku = new MachineLearningSkuPatch() { Name = "string", @@ -109,6 +122,8 @@ public async Task Update_UpdateWorkspaceServerlessEndpoint() Family = "string", Capacity = 1, }, +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Identity = new MachineLearningPartialManagedServiceIdentity() { ManagedServiceIdentityType = "None", @@ -119,6 +134,17 @@ public async Task Update_UpdateWorkspaceServerlessEndpoint() }), }, }, +<<<<<<< HEAD +======= + Sku = new MachineLearningSkuPatch() + { + Capacity = 1, + Family = "string", + Name = "string", + Size = "string", + Tier = MachineLearningSkuTier.Premium, + }, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Tags = { }, @@ -138,7 +164,11 @@ public async Task Update_UpdateWorkspaceServerlessEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetKeys_ListKeysWorkspaceServerlessEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ServerlessEndpoint/listKeys.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/listKeys.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ServerlessEndpoints_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +196,11 @@ public async Task GetKeys_ListKeysWorkspaceServerlessEndpoint() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task RegenerateKeys_RegenerateKeysWorkspaceServerlessEndpoint() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Workspace/ServerlessEndpoint/regenerateKeys.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Workspace/ServerlessEndpoint/regenerateKeys.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "ServerlessEndpoints_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index b02c76f34304..8e2a4e4cf3d5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,11 @@ public partial class Sample_SubscriptionResourceExtensions [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningUsages_ListUsages() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Usage/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Usage/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Usages_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -50,7 +54,11 @@ public async Task GetMachineLearningUsages_ListUsages() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningVmSizes_ListVMSizes() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/VirtualMachineSize/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/VirtualMachineSize/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "VirtualMachineSizes_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +87,11 @@ public async Task GetMachineLearningVmSizes_ListVMSizes() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpdateMachineLearningQuotas_UpdateQuotas() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Quota/update.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Quota/update.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Quotas_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -127,7 +139,11 @@ public async Task UpdateMachineLearningQuotas_UpdateQuotas() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetMachineLearningQuotas_ListWorkspaceQuotasByVMFamily() { +<<<<<<< HEAD // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/stable/2024-04-01/examples/Quota/list.json +======= + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Quota/list.json +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 // this example is just showing the usage of "Quotas_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentCollection.cs new file mode 100644 index 000000000000..48708c1f0bdf --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentCollection.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionDeploymentCollection + { + // List Azure OpenAI Connection Deployments + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListAzureOpenAIConnectionDeployments() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/listDeployments.json + // this example is just showing the usage of "Connection_ListDeployments" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceConnectionDeploymentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + WorkspaceConnectionDeploymentResource result = await collection.GetAsync(deploymentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + bool result = await collection.ExistsAsync(deploymentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + NullableResponse response = await collection.GetIfExistsAsync(deploymentName); + WorkspaceConnectionDeploymentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/createDeployment.json + // this example is just showing the usage of "Connection_CreateOrUpdateDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionDeploymentResource + WorkspaceConnectionDeploymentCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentName, data); + WorkspaceConnectionDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentResource.cs new file mode 100644 index 000000000000..65151803829b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionDeploymentResource.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionDeploymentResource + { + // Delete Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/deleteDeployment.json + // this example is just showing the usage of "Connection_DeleteDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionDeploymentResource created on azure + // for more information of creating WorkspaceConnectionDeploymentResource, please refer to the document of WorkspaceConnectionDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string deploymentName = "testDeploymentName"; + ResourceIdentifier workspaceConnectionDeploymentResourceId = WorkspaceConnectionDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + WorkspaceConnectionDeploymentResource workspaceConnectionDeployment = client.GetWorkspaceConnectionDeploymentResource(workspaceConnectionDeploymentResourceId); + + // invoke the operation + await workspaceConnectionDeployment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/getDeployment.json + // this example is just showing the usage of "Connection_GetDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionDeploymentResource created on azure + // for more information of creating WorkspaceConnectionDeploymentResource, please refer to the document of WorkspaceConnectionDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceConnectionDeploymentResourceId = WorkspaceConnectionDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + WorkspaceConnectionDeploymentResource workspaceConnectionDeployment = client.GetWorkspaceConnectionDeploymentResource(workspaceConnectionDeploymentResourceId); + + // invoke the operation + WorkspaceConnectionDeploymentResource result = await workspaceConnectionDeployment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Azure OpenAI Connection Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateAzureOpenAIConnectionDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/createDeployment.json + // this example is just showing the usage of "Connection_CreateOrUpdateDeployment" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionDeploymentResource created on azure + // for more information of creating WorkspaceConnectionDeploymentResource, please refer to the document of WorkspaceConnectionDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string connectionName = "testConnection"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceConnectionDeploymentResourceId = WorkspaceConnectionDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + WorkspaceConnectionDeploymentResource workspaceConnectionDeployment = client.GetWorkspaceConnectionDeploymentResource(workspaceConnectionDeploymentResourceId); + + // invoke the operation + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await workspaceConnectionDeployment.UpdateAsync(WaitUntil.Completed, data); + WorkspaceConnectionDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyCollection.cs new file mode 100644 index 000000000000..4236bdc5d3e9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyCollection.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionRaiPolicyCollection + { + // List Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/list.json + // this example is just showing the usage of "ConnectionRaiPolicies_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceConnectionRaiPolicyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + WorkspaceConnectionRaiPolicyResource result = await collection.GetAsync(raiPolicyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + bool result = await collection.ExistsAsync(raiPolicyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + NullableResponse response = await collection.GetIfExistsAsync(raiPolicyName); + WorkspaceConnectionRaiPolicyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/create.json + // this example is just showing the usage of "ConnectionRaiPolicy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineLearningWorkspaceConnectionResource created on azure + // for more information of creating MachineLearningWorkspaceConnectionResource, please refer to the document of MachineLearningWorkspaceConnectionResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + ResourceIdentifier machineLearningWorkspaceConnectionResourceId = MachineLearningWorkspaceConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName); + MachineLearningWorkspaceConnectionResource machineLearningWorkspaceConnection = client.GetMachineLearningWorkspaceConnectionResource(machineLearningWorkspaceConnectionResourceId); + + // get the collection of this WorkspaceConnectionRaiPolicyResource + WorkspaceConnectionRaiPolicyCollection collection = machineLearningWorkspaceConnection.GetWorkspaceConnectionRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiPolicyName, data); + WorkspaceConnectionRaiPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyResource.cs new file mode 100644 index 000000000000..3c41b9d3979a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceConnectionRaiPolicyResource.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceConnectionRaiPolicyResource + { + // Delete Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/delete.json + // this example is just showing the usage of "ConnectionRaiPolicy_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionRaiPolicyResource created on azure + // for more information of creating WorkspaceConnectionRaiPolicyResource, please refer to the document of WorkspaceConnectionRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceConnectionRaiPolicyResourceId = WorkspaceConnectionRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + WorkspaceConnectionRaiPolicyResource workspaceConnectionRaiPolicy = client.GetWorkspaceConnectionRaiPolicyResource(workspaceConnectionRaiPolicyResourceId); + + // invoke the operation + await workspaceConnectionRaiPolicy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/get.json + // this example is just showing the usage of "ConnectionRaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionRaiPolicyResource created on azure + // for more information of creating WorkspaceConnectionRaiPolicyResource, please refer to the document of WorkspaceConnectionRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceConnectionRaiPolicyResourceId = WorkspaceConnectionRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + WorkspaceConnectionRaiPolicyResource workspaceConnectionRaiPolicy = client.GetWorkspaceConnectionRaiPolicyResource(workspaceConnectionRaiPolicyResourceId); + + // invoke the operation + WorkspaceConnectionRaiPolicyResource result = await workspaceConnectionRaiPolicy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/WorkspaceConnection/RaiPolicy/create.json + // this example is just showing the usage of "ConnectionRaiPolicy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceConnectionRaiPolicyResource created on azure + // for more information of creating WorkspaceConnectionRaiPolicyResource, please refer to the document of WorkspaceConnectionRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string connectionName = "testConnection"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceConnectionRaiPolicyResourceId = WorkspaceConnectionRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + WorkspaceConnectionRaiPolicyResource workspaceConnectionRaiPolicy = client.GetWorkspaceConnectionRaiPolicyResource(workspaceConnectionRaiPolicyResourceId); + + // invoke the operation + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await workspaceConnectionRaiPolicy.UpdateAsync(WaitUntil.Completed, data); + WorkspaceConnectionRaiPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentCollection.cs new file mode 100644 index 000000000000..680856af5281 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentCollection.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointDeploymentCollection + { + // Get Endpoint Deployments + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GetEndpointDeployments() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/getDeployments.json + // this example is just showing the usage of "EndpointDeployment_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceEndpointDeploymentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + WorkspaceEndpointDeploymentResource result = await collection.GetAsync(deploymentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + bool result = await collection.ExistsAsync(deploymentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + NullableResponse response = await collection.GetIfExistsAsync(deploymentName); + WorkspaceEndpointDeploymentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/create.json + // this example is just showing the usage of "EndpointDeployment_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointDeploymentResource + WorkspaceEndpointDeploymentCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointDeployments(); + + // invoke the operation + string deploymentName = "text-davinci-003"; + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, deploymentName, data); + WorkspaceEndpointDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentResource.cs new file mode 100644 index 000000000000..c1101097e97e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointDeploymentResource.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointDeploymentResource + { + // Delete Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/delete.json + // this example is just showing the usage of "EndpointDeployment_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointDeploymentResource created on azure + // for more information of creating WorkspaceEndpointDeploymentResource, please refer to the document of WorkspaceEndpointDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string deploymentName = "testDeploymentName"; + ResourceIdentifier workspaceEndpointDeploymentResourceId = WorkspaceEndpointDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + WorkspaceEndpointDeploymentResource workspaceEndpointDeployment = client.GetWorkspaceEndpointDeploymentResource(workspaceEndpointDeploymentResourceId); + + // invoke the operation + await workspaceEndpointDeployment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/get.json + // this example is just showing the usage of "EndpointDeployment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointDeploymentResource created on azure + // for more information of creating WorkspaceEndpointDeploymentResource, please refer to the document of WorkspaceEndpointDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceEndpointDeploymentResourceId = WorkspaceEndpointDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + WorkspaceEndpointDeploymentResource workspaceEndpointDeployment = client.GetWorkspaceEndpointDeploymentResource(workspaceEndpointDeploymentResourceId); + + // invoke the operation + WorkspaceEndpointDeploymentResource result = await workspaceEndpointDeployment.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Endpoint Deployment + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateEndpointDeployment() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/Deployment/create.json + // this example is just showing the usage of "EndpointDeployment_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointDeploymentResource created on azure + // for more information of creating WorkspaceEndpointDeploymentResource, please refer to the document of WorkspaceEndpointDeploymentResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "resourceGroup-1"; + string workspaceName = "testworkspace"; + string endpointName = "Azure.OpenAI"; + string deploymentName = "text-davinci-003"; + ResourceIdentifier workspaceEndpointDeploymentResourceId = WorkspaceEndpointDeploymentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + WorkspaceEndpointDeploymentResource workspaceEndpointDeployment = client.GetWorkspaceEndpointDeploymentResource(workspaceEndpointDeploymentResourceId); + + // invoke the operation + EndpointDeploymentResourcePropertiesBasicResourceData data = new EndpointDeploymentResourcePropertiesBasicResourceData(new OpenAIEndpointDeploymentResourceProperties(new EndpointDeploymentModel() + { + Format = "OpenAI", + Name = "text-davinci-003", + Version = "1", + }) + { + VersionUpgradeOption = DeploymentModelVersionUpgradeOption.OnceNewDefaultVersionAvailable, + }); + ArmOperation lro = await workspaceEndpointDeployment.UpdateAsync(WaitUntil.Completed, data); + WorkspaceEndpointDeploymentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + EndpointDeploymentResourcePropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyCollection.cs new file mode 100644 index 000000000000..105749e74d20 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyCollection.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointRaiPolicyCollection + { + // List Rai policies + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListRaiPolicies() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/list.json + // this example is just showing the usage of "RaiPolicies_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation and iterate over the result + await foreach (WorkspaceEndpointRaiPolicyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + WorkspaceEndpointRaiPolicyResource result = await collection.GetAsync(raiPolicyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + bool result = await collection.ExistsAsync(raiPolicyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + NullableResponse response = await collection.GetIfExistsAsync(raiPolicyName); + WorkspaceEndpointRaiPolicyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/create.json + // this example is just showing the usage of "RaiPolicy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EndpointResourcePropertiesBasicResource created on azure + // for more information of creating EndpointResourcePropertiesBasicResource, please refer to the document of EndpointResourcePropertiesBasicResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + ResourceIdentifier endpointResourcePropertiesBasicResourceId = EndpointResourcePropertiesBasicResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName); + EndpointResourcePropertiesBasicResource endpointResourcePropertiesBasicResource = client.GetEndpointResourcePropertiesBasicResource(endpointResourcePropertiesBasicResourceId); + + // get the collection of this WorkspaceEndpointRaiPolicyResource + WorkspaceEndpointRaiPolicyCollection collection = endpointResourcePropertiesBasicResource.GetWorkspaceEndpointRaiPolicies(); + + // invoke the operation + string raiPolicyName = "raiPolicyName"; + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, raiPolicyName, data); + WorkspaceEndpointRaiPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyResource.cs new file mode 100644 index 000000000000..fc3d2ae838bc --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/samples/Generated/Samples/Sample_WorkspaceEndpointRaiPolicyResource.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning.Samples +{ + public partial class Sample_WorkspaceEndpointRaiPolicyResource + { + // Delete Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/delete.json + // this example is just showing the usage of "RaiPolicy_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointRaiPolicyResource created on azure + // for more information of creating WorkspaceEndpointRaiPolicyResource, please refer to the document of WorkspaceEndpointRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceEndpointRaiPolicyResourceId = WorkspaceEndpointRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + WorkspaceEndpointRaiPolicyResource workspaceEndpointRaiPolicy = client.GetWorkspaceEndpointRaiPolicyResource(workspaceEndpointRaiPolicyResourceId); + + // invoke the operation + await workspaceEndpointRaiPolicy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // Get Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/get.json + // this example is just showing the usage of "RaiPolicy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointRaiPolicyResource created on azure + // for more information of creating WorkspaceEndpointRaiPolicyResource, please refer to the document of WorkspaceEndpointRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceEndpointRaiPolicyResourceId = WorkspaceEndpointRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + WorkspaceEndpointRaiPolicyResource workspaceEndpointRaiPolicy = client.GetWorkspaceEndpointRaiPolicyResource(workspaceEndpointRaiPolicyResourceId); + + // invoke the operation + WorkspaceEndpointRaiPolicyResource result = await workspaceEndpointRaiPolicy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create Rai policy + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateRaiPolicy() + { + // Generated from example definition: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-07-01-preview/examples/Endpoint/RaiPolicy/create.json + // this example is just showing the usage of "RaiPolicy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WorkspaceEndpointRaiPolicyResource created on azure + // for more information of creating WorkspaceEndpointRaiPolicyResource, please refer to the document of WorkspaceEndpointRaiPolicyResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "test-rg"; + string workspaceName = "aml-workspace-name"; + string endpointName = "Azure.OpenAI"; + string raiPolicyName = "raiPolicyName"; + ResourceIdentifier workspaceEndpointRaiPolicyResourceId = WorkspaceEndpointRaiPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + WorkspaceEndpointRaiPolicyResource workspaceEndpointRaiPolicy = client.GetWorkspaceEndpointRaiPolicyResource(workspaceEndpointRaiPolicyResourceId); + + // invoke the operation + RaiPolicyPropertiesBasicResourceData data = new RaiPolicyPropertiesBasicResourceData(new RaiPolicyProperties() + { + BasePolicyName = "112", + CompletionBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + ContentFilters = +{ +new RaiPolicyContentFilter() +{ +AllowedContentLevel = AllowedContentLevel.Low, +Blocking = false, +Enabled = false, +Name = "policyName", +Source = RaiPolicyContentSource.Prompt, +} +}, + Mode = RaiPolicyMode.Blocking, + PromptBlocklists = +{ +new RaiBlocklistConfig() +{ +Blocking = false, +BlocklistName = "blocklistName", +} +}, + PolicyType = RaiPolicyType.SystemManaged, + }); + ArmOperation lro = await workspaceEndpointRaiPolicy.UpdateAsync(WaitUntil.Completed, data); + WorkspaceEndpointRaiPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + RaiPolicyPropertiesBasicResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Extensions/MockableMachineLearningSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Extensions/MockableMachineLearningSubscriptionResource.cs new file mode 100644 index 000000000000..d999830dd8f1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Extensions/MockableMachineLearningSubscriptionResource.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.ComponentModel; +using System.Threading; + +namespace Azure.ResourceManager.MachineLearning.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableMachineLearningSubscriptionResource : ArmResource + { + /// + /// Lists all the available machine learning workspaces under the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces + /// + /// + /// Operation Id + /// Workspaces_ListBySubscription + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual AsyncPageable GetMachineLearningWorkspacesAsync(string skip = null, CancellationToken cancellationToken = default) + { + return GetMachineLearningWorkspacesAsync(null, skip, null, cancellationToken); + } + + /// + /// Lists all the available machine learning workspaces under the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces + /// + /// + /// Operation Id + /// Workspaces_ListBySubscription + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual Pageable GetMachineLearningWorkspaces(string skip = null, CancellationToken cancellationToken = default) + { + return GetMachineLearningWorkspaces(null, skip, null, cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreResource.cs new file mode 100644 index 000000000000..4dc0f3e4beb1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningDatastoreResource.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a MachineLearningDatastore along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMachineLearningDatastoreResource method. + /// Otherwise you can get one from its parent resource using the GetMachineLearningDatastore method. + /// + public partial class MachineLearningDatastoreResource : ArmResource + { + /// + /// Get datastore secrets. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets + /// + /// + /// Operation Id + /// Datastores_ListSecrets + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetSecretsAsync(CancellationToken cancellationToken = default) + { + var response = await GetSecretsAsync(null, cancellationToken).ConfigureAwait(false); + return response; + } + + /// + /// Get datastore secrets. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name}/listSecrets + /// + /// + /// Operation Id + /// Datastores_ListSecrets + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetSecrets(CancellationToken cancellationToken = default) => GetSecrets(null, cancellationToken); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceCollection.cs new file mode 100644 index 000000000000..ba37c00b1334 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceCollection.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System.Collections.Generic; +using System.ComponentModel; +using System.Threading; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMachineLearningWorkspaces method from an instance of . + /// + public partial class MachineLearningWorkspaceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + /// + /// Lists all the available machine learning workspaces under the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces + /// + /// + /// Operation Id + /// Workspaces_ListByResourceGroup + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual AsyncPageable GetAllAsync(string skip, CancellationToken cancellationToken) + => GetAllAsync(skip, null,null, cancellationToken); + + /// + /// Lists all the available machine learning workspaces under the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces + /// + /// + /// Operation Id + /// Workspaces_ListByResourceGroup + /// + /// + /// + /// Continuation token for pagination. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + [EditorBrowsable(EditorBrowsableState.Never)] + public virtual Pageable GetAll(string skip, CancellationToken cancellationToken) + => GetAll(skip, null, null, cancellationToken); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceConnectionCollection.cs new file mode 100644 index 000000000000..2b5bed9e2021 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/MachineLearningWorkspaceConnectionCollection.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMachineLearningWorkspaceConnections method from an instance of . + /// + public partial class MachineLearningWorkspaceConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + /// + /// Lists all the available machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections + /// + /// + /// Operation Id + /// WorkspaceConnections_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Target of the workspace connection. + /// Category of the workspace connection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string target, string category, CancellationToken cancellationToken = default) => GetAllAsync(target, category, null, cancellationToken); + + /// + /// Lists all the available machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections + /// + /// + /// Operation Id + /// WorkspaceConnections_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Target of the workspace connection. + /// Category of the workspace connection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string target, string category, CancellationToken cancellationToken = default) => GetAll(target, category, null, cancellationToken); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs index 69fb5812a4fe..a694001b4fad 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs @@ -9,8 +9,9 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.MachineLearning.Models +namespace Azure.ResourceManager.Compute.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs public partial class MachineLearningPrivateEndpoint : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -33,6 +34,35 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod { writer.WritePropertyName("subnetArmId"u8); writer.WriteStringValue(SubnetArmId); +======== + public partial class ComputeSkuProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeSkuProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(VmSizes)) + { + writer.WritePropertyName("vmSizes"u8); + writer.WriteStartArray(); + foreach (var item in VmSizes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AllocationStrategy)) + { + writer.WritePropertyName("allocationStrategy"u8); + writer.WriteStringValue(AllocationStrategy.Value.ToString()); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -52,6 +82,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteEndObject(); } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs MachineLearningPrivateEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -65,6 +96,21 @@ MachineLearningPrivateEndpoint IJsonModel.Create } internal static MachineLearningPrivateEndpoint DeserializeMachineLearningPrivateEndpoint(JsonElement element, ModelReaderWriterOptions options = null) +======== + ComputeSkuProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeSkuProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeSkuProfile(document.RootElement, options); + } + + internal static ComputeSkuProfile DeserializeComputeSkuProfile(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs { options ??= ModelSerializationExtensions.WireOptions; @@ -72,28 +118,53 @@ internal static MachineLearningPrivateEndpoint DeserializeMachineLearningPrivate { return null; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs ResourceIdentifier id = default; ResourceIdentifier subnetArmId = default; +======== + IList vmSizes = default; + ComputeAllocationStrategy? allocationStrategy = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs if (property.NameEquals("id"u8)) +======== + if (property.NameEquals("vmSizes"u8)) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("subnetArmId"u8)) +======== + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeSkuProfileVmSize.DeserializeComputeSkuProfileVmSize(item, options)); + } + vmSizes = array; + continue; + } + if (property.NameEquals("allocationStrategy"u8)) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs subnetArmId = new ResourceIdentifier(property.Value.GetString()); +======== + allocationStrategy = new ComputeAllocationStrategy(property.Value.GetString()); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs continue; } if (options.Format != "W") @@ -102,18 +173,28 @@ internal static MachineLearningPrivateEndpoint DeserializeMachineLearningPrivate } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs return new MachineLearningPrivateEndpoint(id, subnetArmId, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new ComputeSkuProfile(vmSizes ?? new ChangeTrackingList(), allocationStrategy, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs throw new FormatException($"The model {nameof(MachineLearningPrivateEndpoint)} does not support writing '{options.Format}' format."); } } @@ -121,12 +202,22 @@ BinaryData IPersistableModel.Write(ModelReaderWr MachineLearningPrivateEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(ComputeSkuProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeSkuProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.Serialization.cs return DeserializeMachineLearningPrivateEndpoint(document.RootElement, options); } default: @@ -135,5 +226,15 @@ MachineLearningPrivateEndpoint IPersistableModel } string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeComputeSkuProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeSkuProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfile.Serialization.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.cs index a77dcf38581e..ab408c35eed2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.cs @@ -9,8 +9,13 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.cs /// The Private Endpoint resource. public partial class MachineLearningPrivateEndpoint +======== + /// The ServerlessEndpointContentSafety. + internal partial class ServerlessEndpointContentSafety +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs { /// /// Keeps track of any properties unknown to the library. @@ -44,6 +49,7 @@ public partial class MachineLearningPrivateEndpoint /// private IDictionary _serializedAdditionalRawData; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.cs /// Initializes a new instance of . public MachineLearningPrivateEndpoint() { @@ -64,5 +70,30 @@ internal MachineLearningPrivateEndpoint(ResourceIdentifier id, ResourceIdentifie public ResourceIdentifier Id { get; } /// The subnetId that the private endpoint is connected to. public ResourceIdentifier SubnetArmId { get; } +======== + /// Initializes a new instance of . + /// Specifies the status of content safety. + public ServerlessEndpointContentSafety(ContentSafetyStatus contentSafetyStatus) + { + ContentSafetyStatus = contentSafetyStatus; + } + + /// Initializes a new instance of . + /// Specifies the status of content safety. + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointContentSafety(ContentSafetyStatus contentSafetyStatus, IDictionary serializedAdditionalRawData) + { + ContentSafetyStatus = contentSafetyStatus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointContentSafety() + { + } + + /// Specifies the status of content safety. + public ContentSafetyStatus ContentSafetyStatus { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs index 13a31ec17b36..9aa5c0bcd2ff 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ArmMachineLearningModelFactory.cs @@ -536,198 +536,27 @@ public static MachineLearningWorkspaceNotebookAccessTokenResult MachineLearningW serializedAdditionalRawData: null); } +<<<<<<< HEAD /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The identity of the resource. - /// The sku of the workspace. - /// The private link resource group id. - /// The private link resource required member names. - /// The private link resource Private link DNS zone name. - /// A new instance for mocking. - public static MachineLearningPrivateLinkResource MachineLearningPrivateLinkResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, MachineLearningSku sku = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) - { - tags ??= new Dictionary(); - requiredMembers ??= new List(); - requiredZoneNames ??= new List(); - - return new MachineLearningPrivateLinkResource( - id, - name, - resourceType, - systemData, - tags, - location, - identity, - sku, - groupId, - requiredMembers?.ToList(), - requiredZoneNames?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// - /// A new instance for mocking. - public static MachineLearningWorkspaceGetStorageAccountKeysResult MachineLearningWorkspaceGetStorageAccountKeysResult(string userStorageKey = null) - { - return new MachineLearningWorkspaceGetStorageAccountKeysResult(userStorageKey, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , and . - /// - /// A new instance for mocking. - public static MachineLearningWorkspaceConnectionData MachineLearningWorkspaceConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningWorkspaceConnectionProperties properties = null) - { - return new MachineLearningWorkspaceConnectionData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Authentication type of the connection target. - /// Category of the connection. - /// - /// - /// Group based on connection category. - /// - /// - /// Store user metadata for this connection. - /// - /// Value details of the workspace connection. - /// format for the workspace connection value. - /// A new instance for mocking. - public static MachineLearningWorkspaceConnectionProperties MachineLearningWorkspaceConnectionProperties(string authType = null, MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, string target = null, IDictionary metadata = null, IEnumerable sharedUserList = null, string value = null, MachineLearningValueFormat? valueFormat = null) - { - metadata ??= new Dictionary(); - sharedUserList ??= new List(); - - return new UnknownWorkspaceConnectionPropertiesV2( - authType == null ? default : new MachineLearningConnectionAuthType(authType), - category, - createdByWorkspaceArmId, - expiryOn, - group, - isSharedToAll, - target, - metadata, - sharedUserList?.ToList(), - value, - valueFormat, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// - /// A new instance for mocking. - public static MachineLearningFqdnEndpoints MachineLearningFqdnEndpoints(MachineLearningFqdnEndpointsProperties properties = null) - { - return new MachineLearningFqdnEndpoints(properties, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// - /// - /// A new instance for mocking. - public static MachineLearningFqdnEndpointsProperties MachineLearningFqdnEndpointsProperties(string category = null, IEnumerable endpoints = null) - { - endpoints ??= new List(); - - return new MachineLearningFqdnEndpointsProperties(category, endpoints?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// - /// - /// A new instance for mocking. - public static MachineLearningFqdnEndpoint MachineLearningFqdnEndpoint(string domainName = null, IEnumerable endpointDetails = null) - { - endpointDetails ??= new List(); - - return new MachineLearningFqdnEndpoint(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// - /// A new instance for mocking. - public static MachineLearningFqdnEndpointDetail MachineLearningFqdnEndpointDetail(int? port = null) - { - return new MachineLearningFqdnEndpointDetail(port, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// Outbound Rule for the managed network of a machine learning workspace. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// A new instance for mocking. - public static MachineLearningOutboundRuleBasicData MachineLearningOutboundRuleBasicData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningOutboundRule properties = null) - { - return new MachineLearningOutboundRuleBasicData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// [Required] Additional attributes of the entity. - /// A new instance for mocking. - public static MachineLearningCodeContainerData MachineLearningCodeContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningCodeContainerProperties properties = null) - { - return new MachineLearningCodeContainerData( - id, - name, - resourceType, - systemData, - properties, - serializedAdditionalRawData: null); - } - +======= /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. /// Is the asset archived?. /// The latest version inside this container. /// The next auto incremental version. /// Provisioning state for the code container. /// A new instance for mocking. - public static MachineLearningCodeContainerProperties MachineLearningCodeContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningCodeContainerProperties MachineLearningCodeContainerProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningCodeContainerProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, isArchived, latestVersion, @@ -737,21 +566,21 @@ public static MachineLearningCodeContainerProperties MachineLearningCodeContaine /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. /// Is the asset archived?. /// The latest version inside this container. /// The next auto incremental version. /// A new instance for mocking. - public static MachineLearningAssetContainer MachineLearningAssetContainer(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null) + public static MachineLearningAssetContainer MachineLearningAssetContainer(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningAssetContainer( description, - tags, properties, + tags, serializedAdditionalRawData: null, isArchived, latestVersion, @@ -778,25 +607,25 @@ public static MachineLearningCodeVersionData MachineLearningCodeVersionData(Reso /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. - /// Is the asset archived?. + /// Tag dictionary. Tags can be added, removed, and updated. /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Uri where code is located. /// Provisioning state for the code version. /// A new instance for mocking. - public static MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, Uri codeUri = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, Uri codeUri = null, RegistryAssetProvisioningState? provisioningState = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningCodeVersionProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, - isArchived, isAnonymous, + isArchived, codeUri, provisioningState); } @@ -816,16 +645,16 @@ public static PendingUploadResponseDto PendingUploadResponseDto(BlobReferenceFor /// Blob URI path for client to upload data. /// Example: https://blob.windows.core.net/Container/Path /// - /// Arm ID of the storage account to use. /// /// Credential info to access storage account /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// + /// Arm ID of the storage account to use. /// A new instance for mocking. - public static BlobReferenceForConsumptionDto BlobReferenceForConsumptionDto(Uri blobUri = null, ResourceIdentifier storageAccountArmId = null, PendingUploadCredentialDto credential = null) + public static BlobReferenceForConsumptionDto BlobReferenceForConsumptionDto(Uri blobUri = null, PendingUploadCredentialDto credential = null, ResourceIdentifier storageAccountArmId = null) { - return new BlobReferenceForConsumptionDto(blobUri, storageAccountArmId, credential, serializedAdditionalRawData: null); + return new BlobReferenceForConsumptionDto(blobUri, credential, storageAccountArmId, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -848,22 +677,22 @@ public static MachineLearningComponentContainerData MachineLearningComponentCont /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. /// Is the asset archived?. /// The latest version inside this container. /// The next auto incremental version. /// Provisioning state for the component container. /// A new instance for mocking. - public static MachineLearningComponentContainerProperties MachineLearningComponentContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningComponentContainerProperties MachineLearningComponentContainerProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningComponentContainerProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, isArchived, latestVersion, @@ -891,28 +720,28 @@ public static MachineLearningComponentVersionData MachineLearningComponentVersio /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. - /// Is the asset archived?. + /// Tag dictionary. Tags can be added, removed, and updated. /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// /// Defines Component definition details. /// <see href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" /> /// /// Provisioning state for the component version. /// A new instance for mocking. - public static MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, BinaryData componentSpec = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, BinaryData componentSpec = null, RegistryAssetProvisioningState? provisioningState = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningComponentVersionProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, - isArchived, isAnonymous, + isArchived, componentSpec, provisioningState); } @@ -937,22 +766,22 @@ public static MachineLearningDataContainerData MachineLearningDataContainerData( /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. /// Is the asset archived?. /// The latest version inside this container. /// The next auto incremental version. /// [Required] Specifies the type of data. /// A new instance for mocking. - public static MachineLearningDataContainerProperties MachineLearningDataContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, MachineLearningDataType dataType = default) + public static MachineLearningDataContainerProperties MachineLearningDataContainerProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, MachineLearningDataType dataType = default) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningDataContainerProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, isArchived, latestVersion, @@ -992,16 +821,16 @@ public static GetBlobReferenceSasResponseDto GetBlobReferenceSasResponseDto(GetB /// Initializes a new instance of . /// Blob uri, example: https://blob.windows.core.net/Container/Path. - /// The ARM id of the storage account. /// /// Credential info to access storage account /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , and . /// + /// The ARM id of the storage account. /// A new instance for mocking. - public static GetBlobReferenceForConsumptionDto GetBlobReferenceForConsumptionDto(Uri blobUri = null, string storageAccountArmId = null, DataReferenceCredential credential = null) + public static GetBlobReferenceForConsumptionDto GetBlobReferenceForConsumptionDto(Uri blobUri = null, DataReferenceCredential credential = null, string storageAccountArmId = null) { - return new GetBlobReferenceForConsumptionDto(blobUri, storageAccountArmId, credential, serializedAdditionalRawData: null); + return new GetBlobReferenceForConsumptionDto(blobUri, credential, storageAccountArmId, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -1024,22 +853,22 @@ public static MachineLearningEnvironmentContainerData MachineLearningEnvironment /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. /// Is the asset archived?. /// The latest version inside this container. /// The next auto incremental version. /// Provisioning state for the environment container. /// A new instance for mocking. - public static MachineLearningEnvironmentContainerProperties MachineLearningEnvironmentContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningEnvironmentContainerProperties MachineLearningEnvironmentContainerProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningEnvironmentContainerProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, isArchived, latestVersion, @@ -1067,10 +896,16 @@ public static MachineLearningEnvironmentVersionData MachineLearningEnvironmentVe /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. - /// Is the asset archived?. + /// Tag dictionary. Tags can be added, removed, and updated. /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + /// Defines if image needs to be rebuilt based on base image changes. + /// Configuration settings for Docker build context. + /// + /// Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. + /// <see href="https://repo2docker.readthedocs.io/en/latest/config_files.html#environment-yml-install-a-conda-environment" /> + /// /// /// Environment type is either user managed or curated by the Azure ML service /// <see href="https://docs.microsoft.com/en-us/azure/machine-learning/resource-curated-environments" /> @@ -1079,40 +914,73 @@ public static MachineLearningEnvironmentVersionData MachineLearningEnvironmentVe /// Name of the image that will be used for the environment. /// <seealso href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" /> /// - /// - /// Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. - /// <see href="https://repo2docker.readthedocs.io/en/latest/config_files.html#environment-yml-install-a-conda-environment" /> - /// - /// Configuration settings for Docker build context. - /// The OS type of the environment. /// Defines configuration specific to inference. - /// Defines if image needs to be rebuilt based on base image changes. + /// The OS type of the environment. /// Provisioning state for the environment version. /// Stage in the environment lifecycle assigned to this environment. /// A new instance for mocking. - public static MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, MachineLearningEnvironmentType? environmentType = null, string image = null, string condaFile = null, MachineLearningBuildContext build = null, MachineLearningOperatingSystemType? osType = null, MachineLearningInferenceContainerProperties inferenceConfig = null, AutoRebuildSetting? autoRebuild = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + public static MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, AutoRebuildSetting? autoRebuild = null, MachineLearningBuildContext build = null, string condaFile = null, MachineLearningEnvironmentType? environmentType = null, string image = null, MachineLearningInferenceContainerProperties inferenceConfig = null, MachineLearningOperatingSystemType? osType = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningEnvironmentVersionProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, - isArchived, isAnonymous, + isArchived, + autoRebuild, + build, + condaFile, environmentType, image, - condaFile, - build, - osType, inferenceConfig, - autoRebuild, + osType, provisioningState, stage); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MarketplaceSubscriptionData MarketplaceSubscriptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MarketplaceSubscriptionProperties properties = null) + { + return new MarketplaceSubscriptionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Marketplace Plan associated with the Marketplace Subscription. + /// Current status of the Marketplace Subscription. + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + /// Provisioning State of the Marketplace Subscription. + /// A new instance for mocking. + public static MarketplaceSubscriptionProperties MarketplaceSubscriptionProperties(MarketplacePlan marketplacePlan = null, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = null, string modelId = null, MarketplaceSubscriptionProvisioningState? provisioningState = null) + { + return new MarketplaceSubscriptionProperties(marketplacePlan, marketplaceSubscriptionStatus, modelId, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The identifying name of the Offer of the Marketplace Plan. + /// The identifying name of the Plan of the Marketplace Plan. + /// The identifying name of the Publisher of the Marketplace Plan. + /// A new instance for mocking. + public static MarketplacePlan MarketplacePlan(string offerId = null, string planId = null, string publisherId = null) + { + return new MarketplacePlan(offerId, planId, publisherId, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -1133,22 +1001,22 @@ public static MachineLearningModelContainerData MachineLearningModelContainerDat /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. /// Is the asset archived?. /// The latest version inside this container. /// The next auto incremental version. /// Provisioning state for the model container. /// A new instance for mocking. - public static MachineLearningModelContainerProperties MachineLearningModelContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningModelContainerProperties MachineLearningModelContainerProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningModelContainerProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, isArchived, latestVersion, @@ -1176,54 +1044,61 @@ public static MachineLearningModelVersionData MachineLearningModelVersionData(Re /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. - /// Is the asset archived?. + /// Tag dictionary. Tags can be added, removed, and updated. /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Mapping of model flavors to their properties. + /// Name of the training job which produced this model. /// The storage format for this entity. Used for NCD. /// The URI path to the model contents. - /// Name of the training job which produced this model. /// Provisioning state for the model version. /// Stage in the model lifecycle assigned to this model. /// A new instance for mocking. - public static MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, IDictionary flavors = null, string modelType = null, Uri modelUri = null, string jobName = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + public static MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, IDictionary flavors = null, string jobName = null, string modelType = null, Uri modelUri = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); flavors ??= new Dictionary(); return new MachineLearningModelVersionProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, - isArchived, isAnonymous, + isArchived, flavors, + jobName, modelType, modelUri, - jobName, provisioningState, stage); } /// Initializes a new instance of . +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The id. /// The name. /// The resourceType. /// The systemData. /// The tags. /// The location. - /// [Required] Additional attributes of the entity. - /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. - /// Managed service identity (system assigned and/or user assigned identities). - /// Sku details required for ARM contract for Autoscaling. - /// A new instance for mocking. - public static MachineLearningBatchEndpointData MachineLearningBatchEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineLearningBatchEndpointProperties properties = null, string kind = null, ManagedServiceIdentity identity = null, MachineLearningSku sku = null) + /// The identity of the resource. + /// The sku of the workspace. + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource Private link DNS zone name. + /// A new instance for mocking. + public static MachineLearningPrivateLinkResource MachineLearningPrivateLinkResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, MachineLearningSku sku = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) { tags ??= new Dictionary(); + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); +<<<<<<< HEAD + return new MachineLearningPrivateLinkResource( +======= return new MachineLearningBatchEndpointData( id, name, @@ -1231,64 +1106,64 @@ public static MachineLearningBatchEndpointData MachineLearningBatchEndpointData( systemData, tags, location, - properties, - kind, identity, + kind, + properties, sku, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// Description of the inference endpoint. - /// Property dictionary. Properties can be added, but not removed or altered. - /// Endpoint URI. - /// Endpoint Swagger URI. /// [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. + /// Description of the inference endpoint. /// /// EndpointAuthKeys to set initially on an Endpoint. /// This property will always be returned as null. AuthKey values must be retrieved using the ListKeys API. /// + /// Property dictionary. Properties can be added, but not removed or altered. + /// Endpoint URI. + /// Endpoint Swagger URI. /// Default values for Batch Endpoint. /// Provisioning state for the endpoint. /// A new instance for mocking. - public static MachineLearningBatchEndpointProperties MachineLearningBatchEndpointProperties(string description = null, IDictionary properties = null, Uri scoringUri = null, Uri swaggerUri = null, MachineLearningEndpointAuthMode authMode = default, MachineLearningEndpointAuthKeys keys = null, string defaultsDeploymentName = null, MachineLearningEndpointProvisioningState? provisioningState = null) + public static MachineLearningBatchEndpointProperties MachineLearningBatchEndpointProperties(MachineLearningEndpointAuthMode authMode = default, string description = null, MachineLearningEndpointAuthKeys keys = null, IDictionary properties = null, Uri scoringUri = null, Uri swaggerUri = null, string defaultsDeploymentName = null, MachineLearningEndpointProvisioningState? provisioningState = null) { properties ??= new Dictionary(); return new MachineLearningBatchEndpointProperties( + authMode, description, + keys, properties, scoringUri, swaggerUri, - authMode, - keys, serializedAdditionalRawData: null, defaultsDeploymentName != null ? new BatchEndpointDefaults(defaultsDeploymentName, serializedAdditionalRawData: null) : null, provisioningState); } /// Initializes a new instance of . - /// Description of the inference endpoint. - /// Property dictionary. Properties can be added, but not removed or altered. - /// Endpoint URI. - /// Endpoint Swagger URI. /// [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. + /// Description of the inference endpoint. /// /// EndpointAuthKeys to set initially on an Endpoint. /// This property will always be returned as null. AuthKey values must be retrieved using the ListKeys API. /// + /// Property dictionary. Properties can be added, but not removed or altered. + /// Endpoint URI. + /// Endpoint Swagger URI. /// A new instance for mocking. - public static MachineLearningEndpointProperties MachineLearningEndpointProperties(string description = null, IDictionary properties = null, Uri scoringUri = null, Uri swaggerUri = null, MachineLearningEndpointAuthMode authMode = default, MachineLearningEndpointAuthKeys keys = null) + public static MachineLearningEndpointProperties MachineLearningEndpointProperties(MachineLearningEndpointAuthMode authMode = default, string description = null, MachineLearningEndpointAuthKeys keys = null, IDictionary properties = null, Uri scoringUri = null, Uri swaggerUri = null) { properties ??= new Dictionary(); return new MachineLearningEndpointProperties( + authMode, description, + keys, properties, scoringUri, swaggerUri, - authMode, - keys, serializedAdditionalRawData: null); } @@ -1299,12 +1174,12 @@ public static MachineLearningEndpointProperties MachineLearningEndpointPropertie /// The systemData. /// The tags. /// The location. - /// [Required] Additional attributes of the entity. - /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. /// Managed service identity (system assigned and/or user assigned identities). + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// [Required] Additional attributes of the entity. /// Sku details required for ARM contract for Autoscaling. /// A new instance for mocking. - public static MachineLearningBatchDeploymentData MachineLearningBatchDeploymentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineLearningBatchDeploymentProperties properties = null, string kind = null, ManagedServiceIdentity identity = null, MachineLearningSku sku = null) + public static MachineLearningBatchDeploymentData MachineLearningBatchDeploymentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningBatchDeploymentProperties properties = null, MachineLearningSku sku = null) { tags ??= new Dictionary(); @@ -1315,19 +1190,19 @@ public static MachineLearningBatchDeploymentData MachineLearningBatchDeploymentD systemData, tags, location, - properties, - kind, identity, + kind, + properties, sku, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// Description of the endpoint deployment. - /// Property dictionary. Properties can be added, but not removed or altered. /// Code configuration for the endpoint deployment. + /// Description of the endpoint deployment. /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. + /// Property dictionary. Properties can be added, but not removed or altered. /// Compute target for batch inference operation. /// /// Properties relevant to different deployment types. @@ -1341,54 +1216,54 @@ public static MachineLearningBatchDeploymentData MachineLearningBatchDeploymentD /// For TabularDataset, this value is the count of record failures. /// If set to -1 (the lower bound), all failures during batch inference will be ignored. /// - /// - /// Retry Settings for the batch inference operation. - /// If not provided, will default to the defaults defined in BatchRetrySettings. - /// + /// Logging level for batch inference operation. + /// Indicates maximum number of parallelism per instance. /// /// Size of the mini-batch passed to each batch invocation. /// For FileDataset, this is the number of files per mini-batch. /// For TabularDataset, this is the size of the records in bytes, per mini-batch. /// - /// Logging level for batch inference operation. /// /// Reference to the model asset for the endpoint deployment. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , and . /// - /// Indicates maximum number of parallelism per instance. /// Indicates how the output will be organized. /// Customized output file name for append_row output action. + /// Provisioning state for the endpoint deployment. /// /// Indicates compute configuration for the job. /// If not provided, will default to the defaults defined in ResourceConfiguration. /// - /// Provisioning state for the endpoint deployment. + /// + /// Retry Settings for the batch inference operation. + /// If not provided, will default to the defaults defined in BatchRetrySettings. + /// /// A new instance for mocking. - public static MachineLearningBatchDeploymentProperties MachineLearningBatchDeploymentProperties(string description = null, IDictionary properties = null, MachineLearningCodeConfiguration codeConfiguration = null, string environmentId = null, IDictionary environmentVariables = null, string compute = null, BatchDeploymentConfiguration deploymentConfiguration = null, int? errorThreshold = null, MachineLearningBatchRetrySettings retrySettings = null, long? miniBatchSize = null, MachineLearningBatchLoggingLevel? loggingLevel = null, MachineLearningAssetReferenceBase model = null, int? maxConcurrencyPerInstance = null, MachineLearningBatchOutputAction? outputAction = null, string outputFileName = null, MachineLearningDeploymentResourceConfiguration resources = null, MachineLearningDeploymentProvisioningState? provisioningState = null) + public static MachineLearningBatchDeploymentProperties MachineLearningBatchDeploymentProperties(MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, IDictionary environmentVariables = null, IDictionary properties = null, string compute = null, BatchDeploymentConfiguration deploymentConfiguration = null, int? errorThreshold = null, MachineLearningBatchLoggingLevel? loggingLevel = null, int? maxConcurrencyPerInstance = null, long? miniBatchSize = null, MachineLearningAssetReferenceBase model = null, MachineLearningBatchOutputAction? outputAction = null, string outputFileName = null, MachineLearningDeploymentProvisioningState? provisioningState = null, MachineLearningDeploymentResourceConfiguration resources = null, MachineLearningBatchRetrySettings retrySettings = null) { - properties ??= new Dictionary(); environmentVariables ??= new Dictionary(); + properties ??= new Dictionary(); return new MachineLearningBatchDeploymentProperties( - description, - properties, codeConfiguration, + description, environmentId, environmentVariables, + properties, serializedAdditionalRawData: null, compute, deploymentConfiguration, errorThreshold, - retrySettings, - miniBatchSize, loggingLevel, - model, maxConcurrencyPerInstance, + miniBatchSize, + model, outputAction, outputFileName, + provisioningState, resources, - provisioningState); + retrySettings); } /// Initializes a new instance of . @@ -1415,29 +1290,29 @@ public static MachineLearningDatastoreData MachineLearningDatastoreData(Resource /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. - /// [Required] Storage type backing the datastore. - /// Readonly property to indicate if datastore is the workspace default datastore. + /// Tag dictionary. Tags can be added, removed, and updated. /// /// [Required] Account credentials. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// + /// [Required] Storage type backing the datastore. + /// Readonly property to indicate if datastore is the workspace default datastore. /// A new instance for mocking. - public static MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, IDictionary tags = null, IDictionary properties = null, string datastoreType = null, bool? isDefault = null, MachineLearningDatastoreCredentials credentials = null) + public static MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, string datastoreType = null, bool? isDefault = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningDatastoreProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, + credentials, datastoreType == null ? default : new DatastoreType(datastoreType), - isDefault, - credentials); + isDefault); } /// Initializes a new instance of . @@ -1460,22 +1335,22 @@ public static MachineLearningFeatureSetContainerData MachineLearningFeatureSetCo /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. /// Is the asset archived?. /// The latest version inside this container. /// The next auto incremental version. /// Provisioning state for the featureset container. /// A new instance for mocking. - public static MachineLearningFeatureSetContainerProperties MachineLearningFeatureSetContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningFeatureSetContainerProperties MachineLearningFeatureSetContainerProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningFeatureSetContainerProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, isArchived, latestVersion, @@ -1521,34 +1396,34 @@ public static MachineLearningFeatureSetVersionData MachineLearningFeatureSetVers /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. - /// Is the asset archived?. + /// Tag dictionary. Tags can be added, removed, and updated. /// If the name version are system generated (anonymous registration). - /// Specifies the feature spec details. - /// Specifies the materialization settings. - /// Specifies the asset stage. + /// Is the asset archived?. /// Specifies list of entities. + /// Specifies the materialization settings. /// Provisioning state for the featureset version container. + /// Specifies the feature spec details. + /// Specifies the asset stage. /// A new instance for mocking. - public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, string specificationPath = null, MaterializationSettings materializationSettings = null, string stage = null, IEnumerable entities = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, IEnumerable entities = null, MaterializationSettings materializationSettings = null, RegistryAssetProvisioningState? provisioningState = null, string specificationPath = null, string stage = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); entities ??= new List(); return new MachineLearningFeatureSetVersionProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, - isArchived, isAnonymous, - specificationPath != null ? new FeaturesetSpecification(specificationPath, serializedAdditionalRawData: null) : null, - materializationSettings, - stage, + isArchived, entities?.ToList(), - provisioningState); + materializationSettings, + provisioningState, + specificationPath != null ? new FeaturesetSpecification(specificationPath, serializedAdditionalRawData: null) : null, + stage); } /// Initializes a new instance of . @@ -1581,22 +1456,22 @@ public static MachineLearningFeatureStoreEntityContainerData MachineLearningFeat /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. /// Is the asset archived?. /// The latest version inside this container. /// The next auto incremental version. /// Provisioning state for the featurestore entity container. /// A new instance for mocking. - public static MachineLearningFeatureStoreEntityContainerProperties MachineLearningFeatureStoreEntityContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningFeatureStoreEntityContainerProperties MachineLearningFeatureStoreEntityContainerProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningFeatureStoreEntityContainerProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, isArchived, latestVersion, @@ -1624,30 +1499,30 @@ public static MachineLearningFeaturestoreEntityVersionData MachineLearningFeatur /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. - /// Is the asset archived?. + /// Tag dictionary. Tags can be added, removed, and updated. /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. /// Specifies index columns. - /// Specifies the asset stage. /// Provisioning state for the featurestore entity version. + /// Specifies the asset stage. /// A new instance for mocking. - public static MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, IEnumerable indexColumns = null, string stage = null, RegistryAssetProvisioningState? provisioningState = null) + public static MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, IDictionary properties = null, IDictionary tags = null, bool? isAnonymous = null, bool? isArchived = null, IEnumerable indexColumns = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); indexColumns ??= new List(); return new MachineLearningFeatureStoreEntityVersionProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, - isArchived, isAnonymous, + isArchived, indexColumns?.ToList(), - stage, - provisioningState); + provisioningState, + stage); } /// Initializes a new instance of . @@ -1658,7 +1533,7 @@ public static MachineLearningFeatureStoreEntityVersionProperties MachineLearning /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , and . + /// The available derived classes include , , , , and . /// /// A new instance for mocking. public static MachineLearningJobData MachineLearningJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningJobProperties properties = null) @@ -1674,118 +1549,79 @@ public static MachineLearningJobData MachineLearningJobData(ResourceIdentifier i /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. - /// [Required] Specifies the type of job. + /// Tag dictionary. Tags can be added, removed, and updated. + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. /// Display name of job. - /// Status of the job. /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. - /// - /// List of JobEndpoints. - /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. - /// - /// ARM resource ID of the compute resource. - /// Is the asset archived?. /// /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. /// Defaults to AmlToken if null. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , and . /// - /// ARM resource ID of the component resource. + /// Is the asset archived?. + /// [Required] Specifies the type of job. /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. /// A new instance for mocking. - public static MachineLearningJobProperties MachineLearningJobProperties(string description = null, IDictionary tags = null, IDictionary properties = null, string jobType = null, string displayName = null, MachineLearningJobStatus? status = null, string experimentName = null, IDictionary services = null, ResourceIdentifier computeId = null, bool? isArchived = null, MachineLearningIdentityConfiguration identity = null, ResourceIdentifier componentId = null, NotificationSetting notificationSetting = null) + public static MachineLearningJobProperties MachineLearningJobProperties(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, string jobType = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); services ??= new Dictionary(); return new MachineLearningJobProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, - jobType == null ? default : new JobType(jobType), + componentId, + computeId, displayName, - status, experimentName, - services, - computeId, - isArchived, identity, - componentId, - notificationSetting); + isArchived, + jobType == null ? default : new JobType(jobType), + notificationSetting, + services, + status); } /// Initializes a new instance of . - /// Endpoint type. - /// Port for endpoint. /// Url for endpoint. - /// Status of endpoint. /// Any error in the service. - /// Additional properties to set on the endpoint. + /// Endpoint type. /// /// Nodes that user would like to start the service on. /// If Nodes is not set or set to null, the service will only be started on leader node. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// + /// Port for endpoint. + /// Additional properties to set on the endpoint. + /// Status of endpoint. /// A new instance for mocking. - public static MachineLearningJobService MachineLearningJobService(string jobServiceType = null, int? port = null, string endpoint = null, string status = null, string errorMessage = null, IDictionary properties = null, JobNodes nodes = null) + public static MachineLearningJobService MachineLearningJobService(string endpoint = null, string errorMessage = null, string jobServiceType = null, JobNodes nodes = null, int? port = null, IDictionary properties = null, string status = null) { properties ??= new Dictionary(); return new MachineLearningJobService( - jobServiceType, - port, endpoint, - status, errorMessage, - properties, + jobServiceType, nodes, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// [Required] Additional attributes of the entity. - /// A new instance for mocking. - public static MarketplaceSubscriptionData MarketplaceSubscriptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MarketplaceSubscriptionProperties properties = null) - { - return new MarketplaceSubscriptionData( - id, - name, - resourceType, - systemData, + port, properties, + status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. - /// Marketplace Plan associated with the Marketplace Subscription. - /// Current status of the Marketplace Subscription. - /// Provisioning State of the Marketplace Subscription. - /// A new instance for mocking. - public static MarketplaceSubscriptionProperties MarketplaceSubscriptionProperties(string modelId = null, MarketplacePlan marketplacePlan = null, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = null, MarketplaceSubscriptionProvisioningState? provisioningState = null) - { - return new MarketplaceSubscriptionProperties(modelId, marketplacePlan, marketplaceSubscriptionStatus, provisioningState, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The identifying name of the Publisher of the Marketplace Plan. - /// The identifying name of the Offer of the Marketplace Plan. - /// The identifying name of the Plan of the Marketplace Plan. - /// A new instance for mocking. - public static MarketplacePlan MarketplacePlan(string publisherId = null, string offerId = null, string planId = null) - { - return new MarketplacePlan(publisherId, offerId, planId, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -1793,12 +1629,12 @@ public static MarketplacePlan MarketplacePlan(string publisherId = null, string /// The systemData. /// The tags. /// The location. - /// [Required] Additional attributes of the entity. - /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. /// Managed service identity (system assigned and/or user assigned identities). + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// [Required] Additional attributes of the entity. /// Sku details required for ARM contract for Autoscaling. /// A new instance for mocking. - public static MachineLearningOnlineEndpointData MachineLearningOnlineEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineLearningOnlineEndpointProperties properties = null, string kind = null, ManagedServiceIdentity identity = null, MachineLearningSku sku = null) + public static MachineLearningOnlineEndpointData MachineLearningOnlineEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningOnlineEndpointProperties properties = null, MachineLearningSku sku = null) { tags ??= new Dictionary(); @@ -1809,51 +1645,51 @@ public static MachineLearningOnlineEndpointData MachineLearningOnlineEndpointDat systemData, tags, location, - properties, - kind, identity, + kind, + properties, sku, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// Description of the inference endpoint. - /// Property dictionary. Properties can be added, but not removed or altered. - /// Endpoint URI. - /// Endpoint Swagger URI. /// [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. + /// Description of the inference endpoint. /// /// EndpointAuthKeys to set initially on an Endpoint. /// This property will always be returned as null. AuthKey values must be retrieved using the ListKeys API. /// - /// Provisioning state for the endpoint. + /// Property dictionary. Properties can be added, but not removed or altered. + /// Endpoint URI. + /// Endpoint Swagger URI. /// /// ARM resource ID of the compute if it exists. /// optional /// + /// Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to sum to utmost 50. + /// Provisioning state for the endpoint. /// Set to "Enabled" for endpoints that should allow public access when Private Link is enabled. /// Percentage of traffic from endpoint to divert to each deployment. Traffic values need to sum to 100. - /// Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to sum to utmost 50. /// A new instance for mocking. - public static MachineLearningOnlineEndpointProperties MachineLearningOnlineEndpointProperties(string description = null, IDictionary properties = null, Uri scoringUri = null, Uri swaggerUri = null, MachineLearningEndpointAuthMode authMode = default, MachineLearningEndpointAuthKeys keys = null, MachineLearningEndpointProvisioningState? provisioningState = null, string compute = null, MachineLearningPublicNetworkAccessType? publicNetworkAccess = null, IDictionary traffic = null, IDictionary mirrorTraffic = null) + public static MachineLearningOnlineEndpointProperties MachineLearningOnlineEndpointProperties(MachineLearningEndpointAuthMode authMode = default, string description = null, MachineLearningEndpointAuthKeys keys = null, IDictionary properties = null, Uri scoringUri = null, Uri swaggerUri = null, string compute = null, IDictionary mirrorTraffic = null, MachineLearningEndpointProvisioningState? provisioningState = null, MachineLearningPublicNetworkAccessType? publicNetworkAccess = null, IDictionary traffic = null) { properties ??= new Dictionary(); - traffic ??= new Dictionary(); mirrorTraffic ??= new Dictionary(); + traffic ??= new Dictionary(); return new MachineLearningOnlineEndpointProperties( + authMode, description, + keys, properties, scoringUri, swaggerUri, - authMode, - keys, serializedAdditionalRawData: null, - provisioningState, compute, + mirrorTraffic, + provisioningState, publicNetworkAccess, - traffic, - mirrorTraffic); + traffic); } /// Initializes a new instance of . @@ -1863,16 +1699,16 @@ public static MachineLearningOnlineEndpointProperties MachineLearningOnlineEndpo /// The systemData. /// The tags. /// The location. + /// Managed service identity (system assigned and/or user assigned identities). + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. - /// Managed service identity (system assigned and/or user assigned identities). /// Sku details required for ARM contract for Autoscaling. /// A new instance for mocking. - public static MachineLearningOnlineDeploymentData MachineLearningOnlineDeploymentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineLearningOnlineDeploymentProperties properties = null, string kind = null, ManagedServiceIdentity identity = null, MachineLearningSku sku = null) + public static MachineLearningOnlineDeploymentData MachineLearningOnlineDeploymentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningOnlineDeploymentProperties properties = null, MachineLearningSku sku = null) { tags ??= new Dictionary(); @@ -1883,20 +1719,30 @@ public static MachineLearningOnlineDeploymentData MachineLearningOnlineDeploymen systemData, tags, location, - properties, - kind, identity, + kind, + properties, sku, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// Description of the endpoint deployment. - /// Property dictionary. Properties can be added, but not removed or altered. /// Code configuration for the endpoint deployment. + /// Description of the endpoint deployment. /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. /// Environment variables configuration for the deployment. + /// Property dictionary. Properties can be added, but not removed or altered. + /// If true, enables Application Insights logging. + /// The mdc configuration, we disable mdc when it's null. + /// If Enabled, allow egress public network access. If Disabled, this will create secure egress. Default: Enabled. /// [Required] The compute type of the endpoint. + /// Compute instance type. + /// Liveness probe monitors the health of the container regularly. + /// The URI path to the model. + /// The path to mount the model in custom container. + /// Provisioning state for the endpoint deployment. + /// Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same as liveness probe. + /// Request settings for the deployment. /// /// Scale settings for the deployment. /// If it is null or not provided, @@ -1905,41 +1751,31 @@ public static MachineLearningOnlineDeploymentData MachineLearningOnlineDeploymen /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - /// Request settings for the deployment. - /// The path to mount the model in custom container. - /// If true, enables Application Insights logging. - /// Liveness probe monitors the health of the container regularly. - /// Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same as liveness probe. - /// Provisioning state for the endpoint deployment. - /// Compute instance type. - /// The URI path to the model. - /// If Enabled, allow egress public network access. If Disabled, this will create secure egress. Default: Enabled. - /// The mdc configuration, we disable mdc when it's null. /// A new instance for mocking. - public static MachineLearningOnlineDeploymentProperties MachineLearningOnlineDeploymentProperties(string description = null, IDictionary properties = null, MachineLearningCodeConfiguration codeConfiguration = null, string environmentId = null, IDictionary environmentVariables = null, string endpointComputeType = null, MachineLearningOnlineScaleSettings scaleSettings = null, MachineLearningOnlineRequestSettings requestSettings = null, string modelMountPath = null, bool? appInsightsEnabled = null, MachineLearningProbeSettings livenessProbe = null, MachineLearningProbeSettings readinessProbe = null, MachineLearningDeploymentProvisioningState? provisioningState = null, string instanceType = null, string model = null, MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = null, DataCollector dataCollector = null) + public static MachineLearningOnlineDeploymentProperties MachineLearningOnlineDeploymentProperties(MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, IDictionary environmentVariables = null, IDictionary properties = null, bool? appInsightsEnabled = null, DataCollector dataCollector = null, MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = null, string endpointComputeType = null, string instanceType = null, MachineLearningProbeSettings livenessProbe = null, string model = null, string modelMountPath = null, MachineLearningDeploymentProvisioningState? provisioningState = null, MachineLearningProbeSettings readinessProbe = null, MachineLearningOnlineRequestSettings requestSettings = null, MachineLearningOnlineScaleSettings scaleSettings = null) { - properties ??= new Dictionary(); environmentVariables ??= new Dictionary(); + properties ??= new Dictionary(); return new MachineLearningOnlineDeploymentProperties( - description, - properties, codeConfiguration, + description, environmentId, environmentVariables, + properties, serializedAdditionalRawData: null, - endpointComputeType == null ? default : new MachineLearningEndpointComputeType(endpointComputeType), - scaleSettings, - requestSettings, - modelMountPath, appInsightsEnabled, - livenessProbe, - readinessProbe, - provisioningState, + dataCollector, + egressPublicNetworkAccess, + endpointComputeType == null ? default : new MachineLearningEndpointComputeType(endpointComputeType), instanceType, + livenessProbe, model, - egressPublicNetworkAccess, - dataCollector); + modelMountPath, + provisioningState, + readinessProbe, + requestSettings, + scaleSettings); } /// Initializes a new instance of . @@ -1951,13 +1787,24 @@ public static MachineLearningDeploymentLogs MachineLearningDeploymentLogs(string } /// Initializes a new instance of . + /// Gets or sets the Sku Capacity. /// The resource type name. /// Gets or sets the Sku. - /// Gets or sets the Sku Capacity. /// A new instance for mocking. - public static MachineLearningSkuDetail MachineLearningSkuDetail(string resourceType = null, MachineLearningSkuSetting sku = null, MachineLearningSkuCapacity capacity = null) + public static MachineLearningSkuDetail MachineLearningSkuDetail(MachineLearningSkuCapacity capacity = null, string resourceType = null, MachineLearningSkuSetting sku = null) { - return new MachineLearningSkuDetail(resourceType, sku, capacity, serializedAdditionalRawData: null); + return new MachineLearningSkuDetail(capacity, resourceType, sku, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the default capacity. + /// Gets or sets the maximum. + /// Gets or sets the minimum. + /// Gets or sets the type of the scale. + /// A new instance for mocking. + public static MachineLearningSkuCapacity MachineLearningSkuCapacity(int? @default = null, int? maximum = null, int? minimum = null, MachineLearningSkuScaleType? scaleType = null) + { + return new MachineLearningSkuCapacity(@default, maximum, minimum, scaleType, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -1969,17 +1816,6 @@ public static MachineLearningSkuSetting MachineLearningSkuSetting(string name = return new MachineLearningSkuSetting(name, tier, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Gets or sets the minimum. - /// Gets or sets the maximum. - /// Gets or sets the default capacity. - /// Gets or sets the type of the scale. - /// A new instance for mocking. - public static MachineLearningSkuCapacity MachineLearningSkuCapacity(int? minimum = null, int? maximum = null, int? @default = null, MachineLearningSkuScaleType? scaleType = null) - { - return new MachineLearningSkuCapacity(minimum, maximum, @default, scaleType, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// [Required] Specification for which type of key to generate. Primary or Secondary. /// The value the key is set to. @@ -1991,13 +1827,13 @@ public static MachineLearningEndpointKeyRegenerateContent MachineLearningEndpoin /// Initializes a new instance of . /// Access token for endpoint authentication. - /// Access token type. /// Access token expiry time (UTC). /// Refresh access token after time (UTC). + /// Access token type. /// A new instance for mocking. - public static MachineLearningEndpointAuthToken MachineLearningEndpointAuthToken(string accessToken = null, string tokenType = null, DateTimeOffset? expireOn = null, DateTimeOffset? refreshOn = null) + public static MachineLearningEndpointAuthToken MachineLearningEndpointAuthToken(string accessToken = null, DateTimeOffset? expireOn = null, DateTimeOffset? refreshOn = null, string tokenType = null) { - return new MachineLearningEndpointAuthToken(accessToken, tokenType, expireOn, refreshOn, serializedAdditionalRawData: null); + return new MachineLearningEndpointAuthToken(accessToken, expireOn, refreshOn, tokenType, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -2020,37 +1856,37 @@ public static MachineLearningScheduleData MachineLearningScheduleData(ResourceId /// Initializes a new instance of . /// The asset description text. - /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// + /// [Required] Specifies the action of the schedule + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// /// Display name of schedule. /// Is the schedule enabled?. + /// Provisioning state for the schedule. /// /// [Required] Specifies the trigger details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - /// - /// [Required] Specifies the action of the schedule - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// Provisioning state for the schedule. /// A new instance for mocking. - public static MachineLearningScheduleProperties MachineLearningScheduleProperties(string description = null, IDictionary tags = null, IDictionary properties = null, string displayName = null, bool? isEnabled = null, MachineLearningTriggerBase trigger = null, MachineLearningScheduleAction action = null, MachineLearningScheduleProvisioningStatus? provisioningState = null) + public static MachineLearningScheduleProperties MachineLearningScheduleProperties(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningScheduleAction action = null, string displayName = null, bool? isEnabled = null, MachineLearningScheduleProvisioningStatus? provisioningState = null, MachineLearningTriggerBase trigger = null) { - tags ??= new Dictionary(); properties ??= new Dictionary(); + tags ??= new Dictionary(); return new MachineLearningScheduleProperties( description, - tags, properties, + tags, serializedAdditionalRawData: null, + action, displayName, isEnabled, - trigger, - action, - provisioningState); + provisioningState, + trigger); } /// Initializes a new instance of . @@ -2060,12 +1896,12 @@ public static MachineLearningScheduleProperties MachineLearningSchedulePropertie /// The systemData. /// The tags. /// The location. - /// [Required] Additional attributes of the entity. - /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. /// Managed service identity (system assigned and/or user assigned identities). + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// [Required] Additional attributes of the entity. /// Sku details required for ARM contract for Autoscaling. /// A new instance for mocking. - public static ServerlessEndpointData ServerlessEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ServerlessEndpointProperties properties = null, string kind = null, ManagedServiceIdentity identity = null, MachineLearningSku sku = null) + public static ServerlessEndpointData ServerlessEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, ServerlessEndpointProperties properties = null, MachineLearningSku sku = null) { tags ??= new Dictionary(); @@ -2076,44 +1912,44 @@ public static ServerlessEndpointData ServerlessEndpointData(ResourceIdentifier i systemData, tags, location, - properties, - kind, identity, + kind, + properties, sku, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. /// [Required] Specifies the authentication mode for the Serverless endpoint. - /// The inference uri to target when making requests against the serverless endpoint. - /// Provisioning state for the endpoint. + /// Specifies the content safety options. If omitted, the default content safety settings will be configured. /// The current state of the ServerlessEndpoint. + /// The inference uri to target when making requests against the serverless endpoint. /// The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. - /// Specifies the content safety options. If omitted, the default content safety settings will be configured. + /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. + /// Provisioning state for the endpoint. /// A new instance for mocking. - public static ServerlessEndpointProperties ServerlessEndpointProperties(string modelId = null, ServerlessInferenceEndpointAuthMode authMode = default, ServerlessInferenceEndpoint inferenceEndpoint = null, MachineLearningEndpointProvisioningState? provisioningState = null, ServerlessEndpointState? endpointState = null, string marketplaceSubscriptionId = null, ContentSafetyStatus? contentSafetyStatus = null) + public static ServerlessEndpointProperties ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode authMode = default, ContentSafetyStatus? contentSafetyStatus = null, ServerlessEndpointState? endpointState = null, ServerlessInferenceEndpoint inferenceEndpoint = null, string marketplaceSubscriptionId = null, string modelId = null, MachineLearningEndpointProvisioningState? provisioningState = null) { return new ServerlessEndpointProperties( - modelId != null ? new ModelSettings(modelId, serializedAdditionalRawData: null) : null, authMode, - inferenceEndpoint, - provisioningState, + contentSafetyStatus.HasValue ? new ContentSafety(contentSafetyStatus.Value, serializedAdditionalRawData: null) : null, endpointState, + inferenceEndpoint, marketplaceSubscriptionId, - contentSafetyStatus.HasValue ? new ContentSafety(contentSafetyStatus.Value, serializedAdditionalRawData: null) : null, + modelId != null ? new ModelSettings(modelId, serializedAdditionalRawData: null) : null, + provisioningState, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// [Required] The inference uri to target when making requests against the Serverless Endpoint. /// Specifies any required headers to target this serverless endpoint. + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. /// A new instance for mocking. - public static ServerlessInferenceEndpoint ServerlessInferenceEndpoint(Uri uri = null, IReadOnlyDictionary headers = null) + public static ServerlessInferenceEndpoint ServerlessInferenceEndpoint(IReadOnlyDictionary headers = null, Uri uri = null) { headers ??= new Dictionary(); - return new ServerlessInferenceEndpoint(uri, headers, serializedAdditionalRawData: null); + return new ServerlessInferenceEndpoint(headers, uri, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -2129,6 +1965,7 @@ public static ServerlessInferenceEndpoint ServerlessInferenceEndpoint(Uri uri = /// Discovery URL for the Registry. /// IntellectualPropertyPublisher for the registry. /// ResourceId of the managed RG if the registry has system created resources. + /// Managed resource group specific settings. /// MLFlow Registry URI for the Registry. /// Private endpoint connections info used for pending connections in private link portal. /// @@ -2137,9 +1974,10 @@ public static ServerlessInferenceEndpoint ServerlessInferenceEndpoint(Uri uri = /// /// Details of each region the registry is in. /// A new instance for mocking. - public static MachineLearningRegistryData MachineLearningRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, Uri discoveryUri = null, string intellectualPropertyPublisher = null, ResourceIdentifier managedResourceId = null, Uri mlFlowRegistryUri = null, IEnumerable registryPrivateEndpointConnections = null, string publicNetworkAccess = null, IEnumerable regionDetails = null) + public static MachineLearningRegistryData MachineLearningRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, Uri discoveryUri = null, string intellectualPropertyPublisher = null, ResourceIdentifier managedResourceId = null, IEnumerable managedResourceGroupAssignedIdentities = null, Uri mlFlowRegistryUri = null, IEnumerable registryPrivateEndpointConnections = null, string publicNetworkAccess = null, IEnumerable regionDetails = null) { tags ??= new Dictionary(); + managedResourceGroupAssignedIdentities ??= new List(); registryPrivateEndpointConnections ??= new List(); regionDetails ??= new List(); @@ -2156,6 +1994,7 @@ public static MachineLearningRegistryData MachineLearningRegistryData(ResourceId discoveryUri, intellectualPropertyPublisher, managedResourceId != null ? new ArmResourceId(managedResourceId, serializedAdditionalRawData: null) : null, + managedResourceGroupAssignedIdentities != null ? new ManagedResourceGroupSettings(managedResourceGroupAssignedIdentities?.ToList(), serializedAdditionalRawData: null) : null, mlFlowRegistryUri, registryPrivateEndpointConnections?.ToList(), publicNetworkAccess, @@ -2163,6 +2002,14 @@ public static MachineLearningRegistryData MachineLearningRegistryData(ResourceId serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Identity principal Id. + /// A new instance for mocking. + public static ManagedResourceGroupAssignedIdentities ManagedResourceGroupAssignedIdentities(Guid? principalId = null) + { + return new ManagedResourceGroupAssignedIdentities(principalId, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The ARM identifier for Private Endpoint. /// The subnetId that the private endpoint is connected to. @@ -2172,6 +2019,14 @@ public static RegistryPrivateEndpoint RegistryPrivateEndpoint(ResourceIdentifier return new RegistryPrivateEndpoint(id, serializedAdditionalRawData: null, subnetArmId); } + /// Initializes a new instance of . + /// The ARM identifier for Private Endpoint. + /// A new instance for mocking. + public static PrivateEndpointBase PrivateEndpointBase(ResourceIdentifier id = null) + { + return new PrivateEndpointBase(id, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Specifies the feature ID. /// Specifies the feature name. @@ -2182,594 +2037,4362 @@ public static MachineLearningUserFeature MachineLearningUserFeature(string id = return new MachineLearningUserFeature(id, displayName, description, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Location for the underlying compute. - /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. - /// The description of the Machine Learning compute. - /// The time at which the compute was created. - /// The time at which the compute was last modified. - /// ARM resource id of the underlying compute. - /// Errors during provisioning. - /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. - /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - /// AKS properties. - /// A new instance for mocking. - public static MachineLearningAksCompute MachineLearningAksCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningAksComputeProperties properties = null) + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Managed service identity (system assigned and/or user assigned identities). + /// + /// Optional. This field is required to be implemented by the RP because AML is supporting more than one tier. + /// The flag to indicate whether to allow public access when behind VNet. + /// The flag to indicate whether we will do role assignment for the workspace MSI on resource group level. + /// ARM id of the application insights associated with this workspace. + /// + /// + /// ARM id of the container registry associated with this workspace. + /// The description of this workspace. + /// Url for the discovery service to identify regional endpoints for machine learning experimentation services. + /// + /// + /// Flag to tell if simplified CMK should be enabled for this workspace. + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. + /// + /// + /// Settings for feature store type workspace. + /// The friendly name for this workspace. This name in mutable. + /// The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service. + /// + /// The compute name for image build. + /// The list of IPv4 addresses that are allowed to access the workspace. + /// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created. + /// + /// Managed Network settings for a machine learning workspace. + /// The URI associated with this workspace that machine learning flow must point at to set up tracking. + /// The notebook info of Azure ML workspace. + /// The user assigned identity resource id that represents the workspace identity. + /// The list of private endpoint connections in the workspace. + /// Count of private connections in the workspace. + /// The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. + /// Whether requests from Public Network are allowed. + /// Settings for serverless compute in a workspace. + /// The service managed resource settings. + /// The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace. + /// The list of shared private link resources in this workspace. + /// Retention time in days after workspace get soft deleted. + /// ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created. + /// + /// If the storage associated with the workspace has hierarchical namespace(HNS) enabled. + /// The auth mode used for accessing the system datastores of the workspace. + /// The tenant id associated with this workspace. + /// Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. + /// WorkspaceHub's configuration object. + /// The immutable id associated with this workspace. + /// A new instance for mocking. + public static MachineLearningWorkspaceData MachineLearningWorkspaceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, bool? allowPublicAccessWhenBehindVnet = null, bool? allowRoleAssignmentOnRG = null, string applicationInsights = null, IEnumerable associatedWorkspaces = null, IEnumerable containerRegistries = null, string containerRegistry = null, string description = null, Uri discoveryUri = null, bool? enableDataIsolation = null, bool? enableServiceSideCMKEncryption = null, bool? enableSimplifiedCmk = null, bool? enableSoftwareBillOfMaterials = null, MachineLearningEncryptionSetting encryption = null, IEnumerable existingWorkspaces = null, FeatureStoreSettings featureStoreSettings = null, string friendlyName = null, bool? isHbiWorkspace = null, ResourceIdentifier hubResourceId = null, string imageBuildCompute = null, IEnumerable ipAllowlist = null, string keyVault = null, IEnumerable keyVaults = null, ManagedNetworkSettings managedNetwork = null, Uri mlFlowTrackingUri = null, MachineLearningNotebookResourceInfo notebookInfo = null, string primaryUserAssignedIdentity = null, IEnumerable privateEndpointConnections = null, int? privateLinkCount = null, MachineLearningProvisioningState? provisioningState = null, MachineLearningPublicNetworkAccessType? publicNetworkAccessType = null, ServerlessComputeSettings serverlessComputeSettings = null, int? cosmosDbCollectionsThroughput = null, string serviceProvisionedResourceGroup = null, IEnumerable sharedPrivateLinkResources = null, int? softDeleteRetentionInDays = null, string storageAccount = null, IEnumerable storageAccounts = null, bool? isStorageHnsEnabled = null, string systemDatastoresAuthMode = null, Guid? tenantId = null, bool? isV1LegacyMode = null, WorkspaceHubConfig workspaceHubConfig = null, string workspaceId = null) { - provisioningErrors ??= new List(); + tags ??= new Dictionary(); + associatedWorkspaces ??= new List(); + containerRegistries ??= new List(); + existingWorkspaces ??= new List(); + ipAllowlist ??= new List(); + keyVaults ??= new List(); + privateEndpointConnections ??= new List(); + sharedPrivateLinkResources ??= new List(); + storageAccounts ??= new List(); - return new MachineLearningAksCompute( - ComputeType.Aks, - computeLocation, - provisioningState, + return new MachineLearningWorkspaceData( + id, + name, + resourceType, + systemData, + tags, + location, + identity, + kind, + sku, + allowPublicAccessWhenBehindVnet, + allowRoleAssignmentOnRG, + applicationInsights, + associatedWorkspaces?.ToList(), + containerRegistries?.ToList(), + containerRegistry, description, - createdOn, - modifiedOn, - resourceId, - provisioningErrors?.ToList(), - isAttachedCompute, - disableLocalAuth, - serializedAdditionalRawData: null, - properties); + discoveryUri, + enableDataIsolation, + enableServiceSideCMKEncryption, + enableSimplifiedCmk, + enableSoftwareBillOfMaterials, + encryption, + existingWorkspaces?.ToList(), + featureStoreSettings, + friendlyName, + isHbiWorkspace, + hubResourceId, + imageBuildCompute, + ipAllowlist?.ToList(), + keyVault, + keyVaults?.ToList(), + managedNetwork, + mlFlowTrackingUri, + notebookInfo, + primaryUserAssignedIdentity, + privateEndpointConnections?.ToList(), + privateLinkCount, + provisioningState, + publicNetworkAccessType, + serverlessComputeSettings, + cosmosDbCollectionsThroughput != null ? new ServiceManagedResourcesSettings(new CosmosDbSettings(cosmosDbCollectionsThroughput, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, + serviceProvisionedResourceGroup, + sharedPrivateLinkResources?.ToList(), + softDeleteRetentionInDays, + storageAccount, + storageAccounts?.ToList(), + isStorageHnsEnabled, + systemDatastoresAuthMode, + tenantId, + isV1LegacyMode, + workspaceHubConfig, + workspaceId, + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Cluster full qualified domain name. - /// System services. - /// Number of agents. - /// Agent virtual machine size. - /// Intended usage of the cluster. - /// SSL configuration. - /// AKS networking configuration for vnet. - /// Load Balancer Type. - /// Load Balancer Subnet. - /// A new instance for mocking. - public static MachineLearningAksComputeProperties MachineLearningAksComputeProperties(string clusterFqdn = null, IEnumerable systemServices = null, int? agentCount = null, string agentVmSize = null, MachineLearningClusterPurpose? clusterPurpose = null, MachineLearningSslConfiguration sslConfiguration = null, MachineLearningAksNetworkingConfiguration aksNetworkingConfiguration = null, MachineLearningLoadBalancerType? loadBalancerType = null, string loadBalancerSubnet = null) + /// Initializes a new instance of . + /// Isolation mode for the managed network of a machine learning workspace. + /// + /// + /// Dictionary of <OutboundRule> + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Status of the Provisioning for the managed network of a machine learning workspace. + /// + /// A new instance for mocking. + public static ManagedNetworkSettings ManagedNetworkSettings(IsolationMode? isolationMode = null, string networkId = null, IDictionary outboundRules = null, ManagedNetworkProvisionStatus status = null, IEnumerable changeableIsolationModes = null) { - systemServices ??= new List(); + outboundRules ??= new Dictionary(); + changeableIsolationModes ??= new List(); - return new MachineLearningAksComputeProperties( - clusterFqdn, - systemServices?.ToList(), - agentCount, - agentVmSize, - clusterPurpose, - sslConfiguration, - aksNetworkingConfiguration, - loadBalancerType, - loadBalancerSubnet, + return new ManagedNetworkSettings( + isolationMode, + networkId, + outboundRules, + status, + changeableIsolationModes?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The type of this system service. - /// Public IP address. - /// The version for this type. - /// A new instance for mocking. - public static MachineLearningComputeSystemService MachineLearningComputeSystemService(string systemServiceType = null, string publicIPAddress = null, string version = null) + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// A new instance for mocking. + public static MachineLearningOutboundRule MachineLearningOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, string outboundRuleType = null) { - return new MachineLearningComputeSystemService(systemServiceType, publicIPAddress, version, serializedAdditionalRawData: null); + parentRuleNames ??= new List(); + + return new UnknownOutboundRule(category, parentRuleNames?.ToList(), status, outboundRuleType == null ? default : new OutboundRuleType(outboundRuleType), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Location for the underlying compute. - /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. - /// The description of the Machine Learning compute. - /// The time at which the compute was created. - /// The time at which the compute was last modified. - /// ARM resource id of the underlying compute. - /// Errors during provisioning. - /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. - /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - /// Properties of Kubernetes. - /// A new instance for mocking. - public static MachineLearningKubernetesCompute MachineLearningKubernetesCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningKubernetesProperties properties = null) + /// Initializes a new instance of . + /// + /// + /// The error that occurs when preparing notebook. + /// the data plane resourceId that used to initialize notebook component. + /// A new instance for mocking. + public static MachineLearningNotebookResourceInfo MachineLearningNotebookResourceInfo(string fqdn = null, bool? isPrivateLinkEnabled = null, MachineLearningNotebookPreparationError notebookPreparationError = null, string resourceId = null) { - provisioningErrors ??= new List(); + return new MachineLearningNotebookResourceInfo(fqdn, isPrivateLinkEnabled, notebookPreparationError, resourceId, serializedAdditionalRawData: null); + } - return new MachineLearningKubernetesCompute( - ComputeType.Kubernetes, - computeLocation, - provisioningState, - description, - createdOn, - modifiedOn, - resourceId, - provisioningErrors?.ToList(), - isAttachedCompute, - disableLocalAuth, - serializedAdditionalRawData: null, - properties); + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static MachineLearningNotebookPreparationError MachineLearningNotebookPreparationError(string errorMessage = null, int? statusCode = null) + { + return new MachineLearningNotebookPreparationError(errorMessage, statusCode, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Compute OS Type. - /// Virtual Machine Size. - /// Virtual Machine priority. - /// Virtual Machine image for AML Compute - windows only. - /// Network is isolated or not. - /// Scale settings for AML Compute. - /// Credentials for an administrator user account that will be created on each compute node. - /// Virtual network subnet resource ID the compute nodes belong to. - /// State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled. - /// Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute. - /// The time at which the compute entered its current allocation state. - /// Collection of errors encountered by various compute nodes during node setup. - /// The number of compute nodes currently assigned to the compute. - /// The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation. - /// Counts of various node states on the compute. - /// Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs. - /// A property bag containing additional properties. - /// A new instance for mocking. - public static AmlComputeProperties AmlComputeProperties(MachineLearningOSType? osType = null, string vmSize = null, MachineLearningVmPriority? vmPriority = null, string virtualMachineImageId = null, bool? isolatedNetwork = null, AmlComputeScaleSettings scaleSettings = null, MachineLearningUserAccountCredentials userAccountCredentials = null, ResourceIdentifier subnetId = null, MachineLearningRemoteLoginPortPublicAccess? remoteLoginPortPublicAccess = null, MachineLearningAllocationState? allocationState = null, DateTimeOffset? allocationStateTransitionOn = null, IEnumerable errors = null, int? currentNodeCount = null, int? targetNodeCount = null, MachineLearningNodeStateCounts nodeStateCounts = null, bool? enableNodePublicIP = null, BinaryData propertyBag = null) + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Managed service identity (system assigned and/or user assigned identities). + /// Optional. This field is required to be implemented by the RP because AML is supporting more than one tier. + /// The Private Endpoint resource. + /// The connection state. + /// The current provisioning state. + /// A new instance for mocking. + public static MachineLearningPrivateEndpointConnectionData MachineLearningPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, MachineLearningSku sku = null, MachineLearningPrivateEndpoint privateEndpoint = null, MachineLearningPrivateLinkServiceConnectionState connectionState = null, MachineLearningPrivateEndpointConnectionProvisioningState? provisioningState = null) { - errors ??= new List(); + tags ??= new Dictionary(); - return new AmlComputeProperties( - osType, - vmSize, - vmPriority, - virtualMachineImageId != null ? new VirtualMachineImage(virtualMachineImageId, serializedAdditionalRawData: null) : null, - isolatedNetwork, - scaleSettings, - userAccountCredentials, - subnetId != null ? new ResourceId(subnetId, serializedAdditionalRawData: null) : null, - remoteLoginPortPublicAccess, - allocationState, - allocationStateTransitionOn, - errors?.ToList(), - currentNodeCount, - targetNodeCount, - nodeStateCounts, - enableNodePublicIP, - propertyBag, + return new MachineLearningPrivateEndpointConnectionData( +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + id, + name, + resourceType, + systemData, + tags, + location, + identity, + sku, + groupId, + requiredMembers?.ToList(), + requiredZoneNames?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Number of compute nodes in idle state. - /// Number of compute nodes which are running jobs. - /// Number of compute nodes which are being prepared. - /// Number of compute nodes which are in unusable state. - /// Number of compute nodes which are leaving the amlCompute. - /// Number of compute nodes which are in preempted state. - /// A new instance for mocking. - public static MachineLearningNodeStateCounts MachineLearningNodeStateCounts(int? idleNodeCount = null, int? runningNodeCount = null, int? preparingNodeCount = null, int? unusableNodeCount = null, int? leavingNodeCount = null, int? preemptedNodeCount = null) + /// Initializes a new instance of . + /// + /// A new instance for mocking. + public static MachineLearningWorkspaceGetStorageAccountKeysResult MachineLearningWorkspaceGetStorageAccountKeysResult(string userStorageKey = null) { - return new MachineLearningNodeStateCounts( - idleNodeCount, - runningNodeCount, - preparingNodeCount, - unusableNodeCount, - leavingNodeCount, - preemptedNodeCount, + return new MachineLearningWorkspaceGetStorageAccountKeysResult(userStorageKey, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , and . + /// + /// A new instance for mocking. + public static MachineLearningWorkspaceConnectionData MachineLearningWorkspaceConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningWorkspaceConnectionProperties properties = null) + { + return new MachineLearningWorkspaceConnectionData( + id, + name, + resourceType, + systemData, + properties, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Location for the underlying compute. - /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. - /// The description of the Machine Learning compute. - /// The time at which the compute was created. - /// The time at which the compute was last modified. - /// ARM resource id of the underlying compute. - /// Errors during provisioning. - /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. - /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - /// Properties of AmlCompute. - /// A new instance for mocking. - public static AmlCompute AmlCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, AmlComputeProperties properties = null) + /// Initializes a new instance of . + /// Authentication type of the connection target. + /// Category of the connection. + /// +<<<<<<< HEAD + /// + /// Group based on connection category. + /// + /// + /// Store user metadata for this connection. + /// + /// Value details of the workspace connection. + /// format for the workspace connection value. + /// A new instance for mocking. + public static MachineLearningWorkspaceConnectionProperties MachineLearningWorkspaceConnectionProperties(string authType = null, MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, string target = null, IDictionary metadata = null, IEnumerable sharedUserList = null, string value = null, MachineLearningValueFormat? valueFormat = null) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningWorkspaceConnectionProperties MachineLearningWorkspaceConnectionProperties(string authType = null, MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new UnknownWorkspaceConnectionPropertiesV2( + authType == null ? default : new MachineLearningConnectionAuthType(authType), + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// A new instance for mocking. + public static EndpointDeploymentResourcePropertiesBasicResourceData EndpointDeploymentResourcePropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EndpointDeploymentResourceProperties properties = null) + { + return new EndpointDeploymentResourcePropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// A new instance for mocking. + public static EndpointDeploymentResourceProperties EndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, string endpointDeploymentResourcePropertiesType = null) + { + return new UnknownEndpointDeploymentResourceProperties(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The capabilities. + /// + /// The capabilities for finetune models. + /// Deployment model format. + /// If the model is default version. + /// Model lifecycle status. + /// The max capacity. + /// Deployment model name. + /// The list of Model Sku. + /// Metadata pertaining to creation and last modification of the resource. + /// Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. + /// A new instance for mocking. + public static EndpointModelProperties EndpointModelProperties(IReadOnlyDictionary capabilities = null, EndpointModelDeprecationProperties deprecation = null, IReadOnlyDictionary finetuneCapabilities = null, string format = null, bool? isDefaultVersion = null, ModelLifecycleStatus? lifecycleStatus = null, int? maxCapacity = null, string name = null, IEnumerable skus = null, SystemData systemData = null, string version = null) + { + capabilities ??= new Dictionary(); + finetuneCapabilities ??= new Dictionary(); + skus ??= new List(); + + return new EndpointModelProperties( + capabilities, + deprecation, + finetuneCapabilities, + format, + isDefaultVersion, + lifecycleStatus, + maxCapacity, + name, + skus?.ToList(), + systemData, + version, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The datetime of deprecation of the fineTune Model. + /// The datetime of deprecation of the inference Model. + /// A new instance for mocking. + public static EndpointModelDeprecationProperties EndpointModelDeprecationProperties(DateTimeOffset? fineTune = null, DateTimeOffset? inference = null) + { + return new EndpointModelDeprecationProperties(fineTune, inference, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// The list of ARM id for the connection support this SKU. + /// The datetime of deprecation of the model SKU. + /// The name of the model SKU. + /// + /// The usage name of the model SKU. + /// A new instance for mocking. + public static EndpointModelSkuProperties EndpointModelSkuProperties(EndpointModelSkuCapacityProperties capacity = null, IEnumerable connectionIds = null, DateTimeOffset? deprecationOn = null, string name = null, IEnumerable rateLimits = null, string usageName = null) + { + connectionIds ??= new List(); + rateLimits ??= new List(); + + return new EndpointModelSkuProperties( + capacity, + connectionIds?.ToList(), + deprecationOn, + name, + rateLimits?.ToList(), + usageName, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The default capacity. + /// The maximum capacity. + /// A new instance for mocking. + public static EndpointModelSkuCapacityProperties EndpointModelSkuCapacityProperties(int? @default = null, int? maximum = null) + { + return new EndpointModelSkuCapacityProperties(@default, maximum, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The count value of Call Rate Limit. + /// The renewal period in seconds of Call Rate Limit. + /// The call rate limit for the model. + /// A new instance for mocking. + public static EndpointModelSkuRateLimitProperties EndpointModelSkuRateLimitProperties(float? count = null, float? renewalPeriod = null, IEnumerable rules = null) + { + rules ??= new List(); + + return new EndpointModelSkuRateLimitProperties(count, renewalPeriod, rules?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// If the dynamic throttling is enabled. + /// + /// + /// + /// + /// A new instance for mocking. + public static EndpointModelSkuRateLimitRuleProperties EndpointModelSkuRateLimitRuleProperties(float? count = null, bool? dynamicThrottlingEnabled = null, string key = null, IEnumerable matchPatterns = null, float? minCount = null, float? renewalPeriod = null) + { + matchPatterns ??= new List(); + + return new EndpointModelSkuRateLimitRuleProperties( + count, + dynamicThrottlingEnabled, + key, + matchPatterns?.ToList(), + minCount, + renewalPeriod, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static EndpointModelSkuRateLimitRulePatternProperties EndpointModelSkuRateLimitRulePatternProperties(string method = null, string path = null) + { + return new EndpointModelSkuRateLimitRulePatternProperties(method, path, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist properties. + /// A new instance for mocking. + public static RaiBlocklistPropertiesBasicResourceData RaiBlocklistPropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string raiBlocklistDescription = null) + { + return new RaiBlocklistPropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + raiBlocklistDescription != null ? new RaiBlocklistProperties(raiBlocklistDescription, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist Item properties. + /// A new instance for mocking. + public static RaiBlocklistItemPropertiesBasicResourceData RaiBlocklistItemPropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RaiBlocklistItemProperties properties = null) + { + return new RaiBlocklistItemPropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Azure OpenAI Content Filters properties. + /// A new instance for mocking. + public static RaiPolicyPropertiesBasicResourceData RaiPolicyPropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RaiPolicyProperties properties = null) + { + return new RaiPolicyPropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// A new instance for mocking. + public static MachineLearningWorkspaceDiagnoseResult MachineLearningWorkspaceDiagnoseResult(MachineLearningDiagnoseResultValue value = null) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + { + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new UnknownWorkspaceConnectionPropertiesV2( + authType == null ? default : new MachineLearningConnectionAuthType(authType), + category, + createdByWorkspaceArmId, + expiryOn, + group, + isSharedToAll, + target, + metadata, + sharedUserList?.ToList(), + value, + valueFormat, + serializedAdditionalRawData: null); + } + +<<<<<<< HEAD +======= + /// Initializes a new instance of . + /// Code for workspace setup error. + /// Level of workspace setup error. + /// Message of workspace setup error. + /// A new instance for mocking. + public static MachineLearningDiagnoseResult MachineLearningDiagnoseResult(string code = null, MachineLearningDiagnoseResultLevel? level = null, string message = null) + { + return new MachineLearningDiagnoseResult(code, level, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// A new instance for mocking. + public static EndpointResourcePropertiesBasicResourceData EndpointResourcePropertiesBasicResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EndpointResourceProperties properties = null) + { + return new EndpointResourcePropertiesBasicResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static EndpointResourceProperties EndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, string endpointType = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new UnknownEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + endpointType == null ? default : new EndpointType(endpointType), + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Dictionary of Keys for the endpoint. + /// A new instance for mocking. + public static EndpointKeys EndpointKeys(AccountApiKeys keys = null) + { + return new EndpointKeys(keys, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static AccountApiKeys AccountApiKeys(string key1 = null, string key2 = null) + { + return new AccountApiKeys(key1, key2, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The access key of the workspace app insights. + /// + /// + /// The arm Id key of the workspace storage. + /// The access key of the workspace storage. + /// A new instance for mocking. + public static MachineLearningWorkspaceGetKeysResult MachineLearningWorkspaceGetKeysResult(string appInsightsInstrumentationKey = null, MachineLearningContainerRegistryCredentials containerRegistryCredentials = null, MachineLearningWorkspaceGetNotebookKeysResult notebookAccessKeys = null, string userStorageResourceId = null, string userStorageKey = null) + { + return new MachineLearningWorkspaceGetKeysResult( + appInsightsInstrumentationKey, + containerRegistryCredentials, + notebookAccessKeys, + userStorageResourceId, + userStorageKey, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The location of the workspace ACR. + /// + /// The username of the workspace ACR. + /// A new instance for mocking. + public static MachineLearningContainerRegistryCredentials MachineLearningContainerRegistryCredentials(AzureLocation? location = null, IEnumerable passwords = null, string username = null) + { + passwords ??= new List(); + + return new MachineLearningContainerRegistryCredentials(location, passwords?.ToList(), username, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static MachineLearningPasswordDetail MachineLearningPasswordDetail(string name = null, string value = null) + { + return new MachineLearningPasswordDetail(name, value, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The primary access key of the Notebook. + /// The secondary access key of the Notebook. + /// A new instance for mocking. + public static MachineLearningWorkspaceGetNotebookKeysResult MachineLearningWorkspaceGetNotebookKeysResult(string primaryAccessKey = null, string secondaryAccessKey = null) + { + return new MachineLearningWorkspaceGetNotebookKeysResult(primaryAccessKey, secondaryAccessKey, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningWorkspaceNotebookAccessTokenResult MachineLearningWorkspaceNotebookAccessTokenResult(string accessToken = null, int? expiresIn = null, string hostName = null, string notebookResourceId = null, string publicDns = null, string refreshToken = null, string scope = null, string tokenType = null) + { + return new MachineLearningWorkspaceNotebookAccessTokenResult( + accessToken, + expiresIn, + hostName, + notebookResourceId, + publicDns, + refreshToken, + scope, + tokenType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The access key of the storage. + /// A new instance for mocking. + public static MachineLearningWorkspaceGetStorageAccountKeysResult MachineLearningWorkspaceGetStorageAccountKeysResult(string userStorageKey = null) + { + return new MachineLearningWorkspaceGetStorageAccountKeysResult(userStorageKey, serializedAdditionalRawData: null); + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// Initializes a new instance of . + /// + /// A new instance for mocking. + public static MachineLearningFqdnEndpoints MachineLearningFqdnEndpoints(MachineLearningFqdnEndpointsProperties properties = null) + { + return new MachineLearningFqdnEndpoints(properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static MachineLearningFqdnEndpointsProperties MachineLearningFqdnEndpointsProperties(string category = null, IEnumerable endpoints = null) + { + endpoints ??= new List(); + + return new MachineLearningFqdnEndpointsProperties(category, endpoints?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static MachineLearningFqdnEndpoint MachineLearningFqdnEndpoint(string domainName = null, IEnumerable endpointDetails = null) + { + endpointDetails ??= new List(); + + return new MachineLearningFqdnEndpoint(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// A new instance for mocking. + public static MachineLearningFqdnEndpointDetail MachineLearningFqdnEndpointDetail(int? port = null) + { + return new MachineLearningFqdnEndpointDetail(port, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Outbound Rule for the managed network of a machine learning workspace. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// A new instance for mocking. + public static MachineLearningOutboundRuleBasicData MachineLearningOutboundRuleBasicData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningOutboundRule properties = null) + { + return new MachineLearningOutboundRuleBasicData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningCodeContainerData MachineLearningCodeContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningCodeContainerProperties properties = null) + { + return new MachineLearningCodeContainerData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// The latest version inside this container. + /// The next auto incremental version. + /// Provisioning state for the code container. + /// A new instance for mocking. + public static MachineLearningCodeContainerProperties MachineLearningCodeContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningCodeContainerProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + latestVersion, + nextVersion, + provisioningState); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// The latest version inside this container. + /// The next auto incremental version. + /// A new instance for mocking. + public static MachineLearningAssetContainer MachineLearningAssetContainer(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningAssetContainer( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + latestVersion, + nextVersion); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningCodeVersionData MachineLearningCodeVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningCodeVersionProperties properties = null) + { + return new MachineLearningCodeVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// If the name version are system generated (anonymous registration). + /// Uri where code is located. + /// Provisioning state for the code version. + /// A new instance for mocking. + public static MachineLearningCodeVersionProperties MachineLearningCodeVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, Uri codeUri = null, RegistryAssetProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningCodeVersionProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + isAnonymous, + codeUri, + provisioningState); + } + + /// Initializes a new instance of . + /// Container level read, write, list SAS. + /// ID for this upload request. + /// TemporaryBlobReference is the only supported type. + /// A new instance for mocking. + public static PendingUploadResponseDto PendingUploadResponseDto(BlobReferenceForConsumptionDto blobReferenceForConsumption = null, string pendingUploadId = null, PendingUploadType? pendingUploadType = null) + { + return new PendingUploadResponseDto(blobReferenceForConsumption, pendingUploadId, pendingUploadType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// Blob URI path for client to upload data. + /// Example: https://blob.windows.core.net/Container/Path + /// + /// Arm ID of the storage account to use. + /// + /// Credential info to access storage account + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// A new instance for mocking. + public static BlobReferenceForConsumptionDto BlobReferenceForConsumptionDto(Uri blobUri = null, ResourceIdentifier storageAccountArmId = null, PendingUploadCredentialDto credential = null) + { + return new BlobReferenceForConsumptionDto(blobUri, storageAccountArmId, credential, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningComponentContainerData MachineLearningComponentContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningComponentContainerProperties properties = null) + { + return new MachineLearningComponentContainerData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// The latest version inside this container. + /// The next auto incremental version. + /// Provisioning state for the component container. + /// A new instance for mocking. + public static MachineLearningComponentContainerProperties MachineLearningComponentContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningComponentContainerProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + latestVersion, + nextVersion, + provisioningState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningComponentVersionData MachineLearningComponentVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningComponentVersionProperties properties = null) + { + return new MachineLearningComponentVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// If the name version are system generated (anonymous registration). + /// + /// Defines Component definition details. + /// <see href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" /> + /// + /// Provisioning state for the component version. + /// A new instance for mocking. + public static MachineLearningComponentVersionProperties MachineLearningComponentVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, BinaryData componentSpec = null, RegistryAssetProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningComponentVersionProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + isAnonymous, + componentSpec, + provisioningState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningDataContainerData MachineLearningDataContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningDataContainerProperties properties = null) + { + return new MachineLearningDataContainerData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// The latest version inside this container. + /// The next auto incremental version. + /// [Required] Specifies the type of data. + /// A new instance for mocking. + public static MachineLearningDataContainerProperties MachineLearningDataContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, MachineLearningDataType dataType = default) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningDataContainerProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + latestVersion, + nextVersion, + dataType); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// [Required] Additional attributes of the entity. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// A new instance for mocking. + public static MachineLearningDataVersionData MachineLearningDataVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningDataVersionProperties properties = null) + { + return new MachineLearningDataVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Blob reference for consumption details. + /// A new instance for mocking. + public static GetBlobReferenceSasResponseDto GetBlobReferenceSasResponseDto(GetBlobReferenceForConsumptionDto blobReferenceForConsumption = null) + { + return new GetBlobReferenceSasResponseDto(blobReferenceForConsumption, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Blob uri, example: https://blob.windows.core.net/Container/Path. + /// The ARM id of the storage account. + /// + /// Credential info to access storage account + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// A new instance for mocking. + public static GetBlobReferenceForConsumptionDto GetBlobReferenceForConsumptionDto(Uri blobUri = null, string storageAccountArmId = null, DataReferenceCredential credential = null) + { + return new GetBlobReferenceForConsumptionDto(blobUri, storageAccountArmId, credential, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningEnvironmentContainerData MachineLearningEnvironmentContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningEnvironmentContainerProperties properties = null) + { + return new MachineLearningEnvironmentContainerData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// The latest version inside this container. + /// The next auto incremental version. + /// Provisioning state for the environment container. + /// A new instance for mocking. + public static MachineLearningEnvironmentContainerProperties MachineLearningEnvironmentContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningEnvironmentContainerProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + latestVersion, + nextVersion, + provisioningState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningEnvironmentVersionData MachineLearningEnvironmentVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningEnvironmentVersionProperties properties = null) + { + return new MachineLearningEnvironmentVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// If the name version are system generated (anonymous registration). + /// + /// Environment type is either user managed or curated by the Azure ML service + /// <see href="https://docs.microsoft.com/en-us/azure/machine-learning/resource-curated-environments" /> + /// + /// + /// Name of the image that will be used for the environment. + /// <seealso href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" /> + /// + /// + /// Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. + /// <see href="https://repo2docker.readthedocs.io/en/latest/config_files.html#environment-yml-install-a-conda-environment" /> + /// + /// Configuration settings for Docker build context. + /// The OS type of the environment. + /// Defines configuration specific to inference. + /// Defines if image needs to be rebuilt based on base image changes. + /// Provisioning state for the environment version. + /// Stage in the environment lifecycle assigned to this environment. + /// A new instance for mocking. + public static MachineLearningEnvironmentVersionProperties MachineLearningEnvironmentVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, MachineLearningEnvironmentType? environmentType = null, string image = null, string condaFile = null, MachineLearningBuildContext build = null, MachineLearningOperatingSystemType? osType = null, MachineLearningInferenceContainerProperties inferenceConfig = null, AutoRebuildSetting? autoRebuild = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningEnvironmentVersionProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + isAnonymous, + environmentType, + image, + condaFile, + build, + osType, + inferenceConfig, + autoRebuild, + provisioningState, + stage); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningModelContainerData MachineLearningModelContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningModelContainerProperties properties = null) + { + return new MachineLearningModelContainerData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// The latest version inside this container. + /// The next auto incremental version. + /// Provisioning state for the model container. + /// A new instance for mocking. + public static MachineLearningModelContainerProperties MachineLearningModelContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningModelContainerProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + latestVersion, + nextVersion, + provisioningState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningModelVersionData MachineLearningModelVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningModelVersionProperties properties = null) + { + return new MachineLearningModelVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// If the name version are system generated (anonymous registration). + /// Mapping of model flavors to their properties. + /// The storage format for this entity. Used for NCD. + /// The URI path to the model contents. + /// Name of the training job which produced this model. + /// Provisioning state for the model version. + /// Stage in the model lifecycle assigned to this model. + /// A new instance for mocking. + public static MachineLearningModelVersionProperties MachineLearningModelVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, IDictionary flavors = null, string modelType = null, Uri modelUri = null, string jobName = null, RegistryAssetProvisioningState? provisioningState = null, string stage = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + flavors ??= new Dictionary(); + + return new MachineLearningModelVersionProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + isAnonymous, + flavors, + modelType, + modelUri, + jobName, + provisioningState, + stage); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// [Required] Additional attributes of the entity. + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// Managed service identity (system assigned and/or user assigned identities). + /// Sku details required for ARM contract for Autoscaling. + /// A new instance for mocking. + public static MachineLearningBatchEndpointData MachineLearningBatchEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineLearningBatchEndpointProperties properties = null, string kind = null, ManagedServiceIdentity identity = null, MachineLearningSku sku = null) + { + tags ??= new Dictionary(); + + return new MachineLearningBatchEndpointData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + kind, + identity, + sku, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Description of the inference endpoint. + /// Property dictionary. Properties can be added, but not removed or altered. + /// Endpoint URI. + /// Endpoint Swagger URI. + /// [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. + /// + /// EndpointAuthKeys to set initially on an Endpoint. + /// This property will always be returned as null. AuthKey values must be retrieved using the ListKeys API. + /// + /// Default values for Batch Endpoint. + /// Provisioning state for the endpoint. + /// A new instance for mocking. + public static MachineLearningBatchEndpointProperties MachineLearningBatchEndpointProperties(string description = null, IDictionary properties = null, Uri scoringUri = null, Uri swaggerUri = null, MachineLearningEndpointAuthMode authMode = default, MachineLearningEndpointAuthKeys keys = null, string defaultsDeploymentName = null, MachineLearningEndpointProvisioningState? provisioningState = null) + { + properties ??= new Dictionary(); + + return new MachineLearningBatchEndpointProperties( + description, + properties, + scoringUri, + swaggerUri, + authMode, + keys, + serializedAdditionalRawData: null, + defaultsDeploymentName != null ? new BatchEndpointDefaults(defaultsDeploymentName, serializedAdditionalRawData: null) : null, + provisioningState); + } + + /// Initializes a new instance of . + /// Description of the inference endpoint. + /// Property dictionary. Properties can be added, but not removed or altered. + /// Endpoint URI. + /// Endpoint Swagger URI. + /// [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. + /// + /// EndpointAuthKeys to set initially on an Endpoint. + /// This property will always be returned as null. AuthKey values must be retrieved using the ListKeys API. + /// + /// A new instance for mocking. + public static MachineLearningEndpointProperties MachineLearningEndpointProperties(string description = null, IDictionary properties = null, Uri scoringUri = null, Uri swaggerUri = null, MachineLearningEndpointAuthMode authMode = default, MachineLearningEndpointAuthKeys keys = null) + { + properties ??= new Dictionary(); + + return new MachineLearningEndpointProperties( + description, + properties, + scoringUri, + swaggerUri, + authMode, + keys, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// [Required] Additional attributes of the entity. + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// Managed service identity (system assigned and/or user assigned identities). + /// Sku details required for ARM contract for Autoscaling. + /// A new instance for mocking. + public static MachineLearningBatchDeploymentData MachineLearningBatchDeploymentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineLearningBatchDeploymentProperties properties = null, string kind = null, ManagedServiceIdentity identity = null, MachineLearningSku sku = null) + { + tags ??= new Dictionary(); + + return new MachineLearningBatchDeploymentData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + kind, + identity, + sku, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Description of the endpoint deployment. + /// Property dictionary. Properties can be added, but not removed or altered. + /// Code configuration for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. + /// Environment variables configuration for the deployment. + /// Compute target for batch inference operation. + /// + /// Properties relevant to different deployment types. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// + /// Error threshold, if the error count for the entire input goes above this value, + /// the batch inference will be aborted. Range is [-1, int.MaxValue]. + /// For FileDataset, this value is the count of file failures. + /// For TabularDataset, this value is the count of record failures. + /// If set to -1 (the lower bound), all failures during batch inference will be ignored. + /// + /// + /// Retry Settings for the batch inference operation. + /// If not provided, will default to the defaults defined in BatchRetrySettings. + /// + /// + /// Size of the mini-batch passed to each batch invocation. + /// For FileDataset, this is the number of files per mini-batch. + /// For TabularDataset, this is the size of the records in bytes, per mini-batch. + /// + /// Logging level for batch inference operation. + /// + /// Reference to the model asset for the endpoint deployment. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Indicates maximum number of parallelism per instance. + /// Indicates how the output will be organized. + /// Customized output file name for append_row output action. + /// + /// Indicates compute configuration for the job. + /// If not provided, will default to the defaults defined in ResourceConfiguration. + /// + /// Provisioning state for the endpoint deployment. + /// A new instance for mocking. + public static MachineLearningBatchDeploymentProperties MachineLearningBatchDeploymentProperties(string description = null, IDictionary properties = null, MachineLearningCodeConfiguration codeConfiguration = null, string environmentId = null, IDictionary environmentVariables = null, string compute = null, BatchDeploymentConfiguration deploymentConfiguration = null, int? errorThreshold = null, MachineLearningBatchRetrySettings retrySettings = null, long? miniBatchSize = null, MachineLearningBatchLoggingLevel? loggingLevel = null, MachineLearningAssetReferenceBase model = null, int? maxConcurrencyPerInstance = null, MachineLearningBatchOutputAction? outputAction = null, string outputFileName = null, MachineLearningDeploymentResourceConfiguration resources = null, MachineLearningDeploymentProvisioningState? provisioningState = null) + { + properties ??= new Dictionary(); + environmentVariables ??= new Dictionary(); + + return new MachineLearningBatchDeploymentProperties( + description, + properties, + codeConfiguration, + environmentId, + environmentVariables, + serializedAdditionalRawData: null, + compute, + deploymentConfiguration, + errorThreshold, + retrySettings, + miniBatchSize, + loggingLevel, + model, + maxConcurrencyPerInstance, + outputAction, + outputFileName, + resources, + provisioningState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// [Required] Additional attributes of the entity. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// A new instance for mocking. + public static MachineLearningDatastoreData MachineLearningDatastoreData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningDatastoreProperties properties = null) + { + return new MachineLearningDatastoreData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// [Required] Storage type backing the datastore. + /// Readonly property to indicate if datastore is the workspace default datastore. + /// + /// [Required] Account credentials. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// A new instance for mocking. + public static MachineLearningDatastoreProperties MachineLearningDatastoreProperties(string description = null, IDictionary tags = null, IDictionary properties = null, string datastoreType = null, bool? isDefault = null, MachineLearningDatastoreCredentials credentials = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningDatastoreProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + datastoreType == null ? default : new DatastoreType(datastoreType), + isDefault, + credentials); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningFeatureSetContainerData MachineLearningFeatureSetContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningFeatureSetContainerProperties properties = null) + { + return new MachineLearningFeatureSetContainerData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// The latest version inside this container. + /// The next auto incremental version. + /// Provisioning state for the featureset container. + /// A new instance for mocking. + public static MachineLearningFeatureSetContainerProperties MachineLearningFeatureSetContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningFeatureSetContainerProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + latestVersion, + nextVersion, + provisioningState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningFeatureData MachineLearningFeatureData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningFeatureProperties properties = null) + { + return new MachineLearningFeatureData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningFeatureSetVersionData MachineLearningFeatureSetVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningFeatureSetVersionProperties properties = null) + { + return new MachineLearningFeatureSetVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// If the name version are system generated (anonymous registration). + /// Specifies the feature spec details. + /// Specifies the materialization settings. + /// Specifies the asset stage. + /// Specifies list of entities. + /// Provisioning state for the featureset version container. + /// A new instance for mocking. + public static MachineLearningFeatureSetVersionProperties MachineLearningFeatureSetVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, string specificationPath = null, MaterializationSettings materializationSettings = null, string stage = null, IEnumerable entities = null, RegistryAssetProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + entities ??= new List(); + + return new MachineLearningFeatureSetVersionProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + isAnonymous, + specificationPath != null ? new FeaturesetSpecification(specificationPath, serializedAdditionalRawData: null) : null, + materializationSettings, + stage, + entities?.ToList(), + provisioningState); + } + + /// Initializes a new instance of . + /// List of jobs submitted as part of the backfill request. + /// A new instance for mocking. + public static FeaturesetVersionBackfillResponse FeaturesetVersionBackfillResponse(IEnumerable jobIds = null) + { + jobIds ??= new List(); + + return new FeaturesetVersionBackfillResponse(jobIds?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningFeatureStoreEntityContainerData MachineLearningFeatureStoreEntityContainerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningFeatureStoreEntityContainerProperties properties = null) + { + return new MachineLearningFeatureStoreEntityContainerData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// The latest version inside this container. + /// The next auto incremental version. + /// Provisioning state for the featurestore entity container. + /// A new instance for mocking. + public static MachineLearningFeatureStoreEntityContainerProperties MachineLearningFeatureStoreEntityContainerProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, string latestVersion = null, string nextVersion = null, RegistryAssetProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningFeatureStoreEntityContainerProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + latestVersion, + nextVersion, + provisioningState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningFeaturestoreEntityVersionData MachineLearningFeaturestoreEntityVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningFeatureStoreEntityVersionProperties properties = null) + { + return new MachineLearningFeaturestoreEntityVersionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Is the asset archived?. + /// If the name version are system generated (anonymous registration). + /// Specifies index columns. + /// Specifies the asset stage. + /// Provisioning state for the featurestore entity version. + /// A new instance for mocking. + public static MachineLearningFeatureStoreEntityVersionProperties MachineLearningFeatureStoreEntityVersionProperties(string description = null, IDictionary tags = null, IDictionary properties = null, bool? isArchived = null, bool? isAnonymous = null, IEnumerable indexColumns = null, string stage = null, RegistryAssetProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + indexColumns ??= new List(); + + return new MachineLearningFeatureStoreEntityVersionProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + isArchived, + isAnonymous, + indexColumns?.ToList(), + stage, + provisioningState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// [Required] Additional attributes of the entity. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// A new instance for mocking. + public static MachineLearningJobData MachineLearningJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningJobProperties properties = null) + { + return new MachineLearningJobData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// [Required] Specifies the type of job. + /// Display name of job. + /// Status of the job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// ARM resource ID of the compute resource. + /// Is the asset archived?. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// ARM resource ID of the component resource. + /// Notification setting for the job. + /// A new instance for mocking. + public static MachineLearningJobProperties MachineLearningJobProperties(string description = null, IDictionary tags = null, IDictionary properties = null, string jobType = null, string displayName = null, MachineLearningJobStatus? status = null, string experimentName = null, IDictionary services = null, ResourceIdentifier computeId = null, bool? isArchived = null, MachineLearningIdentityConfiguration identity = null, ResourceIdentifier componentId = null, NotificationSetting notificationSetting = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + services ??= new Dictionary(); + + return new MachineLearningJobProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + jobType == null ? default : new JobType(jobType), + displayName, + status, + experimentName, + services, + computeId, + isArchived, + identity, + componentId, + notificationSetting); + } + + /// Initializes a new instance of . + /// Endpoint type. + /// Port for endpoint. + /// Url for endpoint. + /// Status of endpoint. + /// Any error in the service. + /// Additional properties to set on the endpoint. + /// + /// Nodes that user would like to start the service on. + /// If Nodes is not set or set to null, the service will only be started on leader node. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// A new instance for mocking. + public static MachineLearningJobService MachineLearningJobService(string jobServiceType = null, int? port = null, string endpoint = null, string status = null, string errorMessage = null, IDictionary properties = null, JobNodes nodes = null) + { + properties ??= new Dictionary(); + + return new MachineLearningJobService( + jobServiceType, + port, + endpoint, + status, + errorMessage, + properties, + nodes, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MarketplaceSubscriptionData MarketplaceSubscriptionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MarketplaceSubscriptionProperties properties = null) + { + return new MarketplaceSubscriptionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + /// Marketplace Plan associated with the Marketplace Subscription. + /// Current status of the Marketplace Subscription. + /// Provisioning State of the Marketplace Subscription. + /// A new instance for mocking. + public static MarketplaceSubscriptionProperties MarketplaceSubscriptionProperties(string modelId = null, MarketplacePlan marketplacePlan = null, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = null, MarketplaceSubscriptionProvisioningState? provisioningState = null) + { + return new MarketplaceSubscriptionProperties(modelId, marketplacePlan, marketplaceSubscriptionStatus, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The identifying name of the Publisher of the Marketplace Plan. + /// The identifying name of the Offer of the Marketplace Plan. + /// The identifying name of the Plan of the Marketplace Plan. + /// A new instance for mocking. + public static MarketplacePlan MarketplacePlan(string publisherId = null, string offerId = null, string planId = null) + { + return new MarketplacePlan(publisherId, offerId, planId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// [Required] Additional attributes of the entity. + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// Managed service identity (system assigned and/or user assigned identities). + /// Sku details required for ARM contract for Autoscaling. + /// A new instance for mocking. + public static MachineLearningOnlineEndpointData MachineLearningOnlineEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineLearningOnlineEndpointProperties properties = null, string kind = null, ManagedServiceIdentity identity = null, MachineLearningSku sku = null) + { + tags ??= new Dictionary(); + + return new MachineLearningOnlineEndpointData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + kind, + identity, + sku, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Description of the inference endpoint. + /// Property dictionary. Properties can be added, but not removed or altered. + /// Endpoint URI. + /// Endpoint Swagger URI. + /// [Required] Use 'Key' for key based authentication and 'AMLToken' for Azure Machine Learning token-based authentication. 'Key' doesn't expire but 'AMLToken' does. + /// + /// EndpointAuthKeys to set initially on an Endpoint. + /// This property will always be returned as null. AuthKey values must be retrieved using the ListKeys API. + /// + /// Provisioning state for the endpoint. + /// + /// ARM resource ID of the compute if it exists. + /// optional + /// + /// Set to "Enabled" for endpoints that should allow public access when Private Link is enabled. + /// Percentage of traffic from endpoint to divert to each deployment. Traffic values need to sum to 100. + /// Percentage of traffic to be mirrored to each deployment without using returned scoring. Traffic values need to sum to utmost 50. + /// A new instance for mocking. + public static MachineLearningOnlineEndpointProperties MachineLearningOnlineEndpointProperties(string description = null, IDictionary properties = null, Uri scoringUri = null, Uri swaggerUri = null, MachineLearningEndpointAuthMode authMode = default, MachineLearningEndpointAuthKeys keys = null, MachineLearningEndpointProvisioningState? provisioningState = null, string compute = null, MachineLearningPublicNetworkAccessType? publicNetworkAccess = null, IDictionary traffic = null, IDictionary mirrorTraffic = null) + { + properties ??= new Dictionary(); + traffic ??= new Dictionary(); + mirrorTraffic ??= new Dictionary(); + + return new MachineLearningOnlineEndpointProperties( + description, + properties, + scoringUri, + swaggerUri, + authMode, + keys, + serializedAdditionalRawData: null, + provisioningState, + compute, + publicNetworkAccess, + traffic, + mirrorTraffic); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// + /// [Required] Additional attributes of the entity. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// Managed service identity (system assigned and/or user assigned identities). + /// Sku details required for ARM contract for Autoscaling. + /// A new instance for mocking. + public static MachineLearningOnlineDeploymentData MachineLearningOnlineDeploymentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineLearningOnlineDeploymentProperties properties = null, string kind = null, ManagedServiceIdentity identity = null, MachineLearningSku sku = null) + { + tags ??= new Dictionary(); + + return new MachineLearningOnlineDeploymentData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + kind, + identity, + sku, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Description of the endpoint deployment. + /// Property dictionary. Properties can be added, but not removed or altered. + /// Code configuration for the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. + /// Environment variables configuration for the deployment. + /// [Required] The compute type of the endpoint. + /// + /// Scale settings for the deployment. + /// If it is null or not provided, + /// it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment + /// and to DefaultScaleSettings for ManagedOnlineDeployment. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Request settings for the deployment. + /// The path to mount the model in custom container. + /// If true, enables Application Insights logging. + /// Liveness probe monitors the health of the container regularly. + /// Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same as liveness probe. + /// Provisioning state for the endpoint deployment. + /// Compute instance type. + /// The URI path to the model. + /// If Enabled, allow egress public network access. If Disabled, this will create secure egress. Default: Enabled. + /// The mdc configuration, we disable mdc when it's null. + /// A new instance for mocking. + public static MachineLearningOnlineDeploymentProperties MachineLearningOnlineDeploymentProperties(string description = null, IDictionary properties = null, MachineLearningCodeConfiguration codeConfiguration = null, string environmentId = null, IDictionary environmentVariables = null, string endpointComputeType = null, MachineLearningOnlineScaleSettings scaleSettings = null, MachineLearningOnlineRequestSettings requestSettings = null, string modelMountPath = null, bool? appInsightsEnabled = null, MachineLearningProbeSettings livenessProbe = null, MachineLearningProbeSettings readinessProbe = null, MachineLearningDeploymentProvisioningState? provisioningState = null, string instanceType = null, string model = null, MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = null, DataCollector dataCollector = null) + { + properties ??= new Dictionary(); + environmentVariables ??= new Dictionary(); + + return new MachineLearningOnlineDeploymentProperties( + description, + properties, + codeConfiguration, + environmentId, + environmentVariables, + serializedAdditionalRawData: null, + endpointComputeType == null ? default : new MachineLearningEndpointComputeType(endpointComputeType), + scaleSettings, + requestSettings, + modelMountPath, + appInsightsEnabled, + livenessProbe, + readinessProbe, + provisioningState, + instanceType, + model, + egressPublicNetworkAccess, + dataCollector); + } + + /// Initializes a new instance of . + /// The retrieved online deployment logs. + /// A new instance for mocking. + public static MachineLearningDeploymentLogs MachineLearningDeploymentLogs(string content = null) + { + return new MachineLearningDeploymentLogs(content, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The resource type name. + /// Gets or sets the Sku. + /// Gets or sets the Sku Capacity. + /// A new instance for mocking. + public static MachineLearningSkuDetail MachineLearningSkuDetail(string resourceType = null, MachineLearningSkuSetting sku = null, MachineLearningSkuCapacity capacity = null) + { + return new MachineLearningSkuDetail(resourceType, sku, capacity, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// [Required] The name of the SKU. Ex - P3. It is typically a letter+number code. + /// This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. + /// A new instance for mocking. + public static MachineLearningSkuSetting MachineLearningSkuSetting(string name = null, MachineLearningSkuTier? tier = null) + { + return new MachineLearningSkuSetting(name, tier, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the minimum. + /// Gets or sets the maximum. + /// Gets or sets the default capacity. + /// Gets or sets the type of the scale. + /// A new instance for mocking. + public static MachineLearningSkuCapacity MachineLearningSkuCapacity(int? minimum = null, int? maximum = null, int? @default = null, MachineLearningSkuScaleType? scaleType = null) + { + return new MachineLearningSkuCapacity(minimum, maximum, @default, scaleType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// [Required] Specification for which type of key to generate. Primary or Secondary. + /// The value the key is set to. + /// A new instance for mocking. + public static MachineLearningEndpointKeyRegenerateContent MachineLearningEndpointKeyRegenerateContent(MachineLearningKeyType keyType = default, string keyValue = null) + { + return new MachineLearningEndpointKeyRegenerateContent(keyType, keyValue, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Access token for endpoint authentication. + /// Access token type. + /// Access token expiry time (UTC). + /// Refresh access token after time (UTC). + /// A new instance for mocking. + public static MachineLearningEndpointAuthToken MachineLearningEndpointAuthToken(string accessToken = null, string tokenType = null, DateTimeOffset? expireOn = null, DateTimeOffset? refreshOn = null) + { + return new MachineLearningEndpointAuthToken(accessToken, tokenType, expireOn, refreshOn, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// [Required] Additional attributes of the entity. + /// A new instance for mocking. + public static MachineLearningScheduleData MachineLearningScheduleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MachineLearningScheduleProperties properties = null) + { + return new MachineLearningScheduleData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// The asset property dictionary. + /// Display name of schedule. + /// Is the schedule enabled?. + /// + /// [Required] Specifies the trigger details + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// [Required] Specifies the action of the schedule + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Provisioning state for the schedule. + /// A new instance for mocking. + public static MachineLearningScheduleProperties MachineLearningScheduleProperties(string description = null, IDictionary tags = null, IDictionary properties = null, string displayName = null, bool? isEnabled = null, MachineLearningTriggerBase trigger = null, MachineLearningScheduleAction action = null, MachineLearningScheduleProvisioningStatus? provisioningState = null) + { + tags ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningScheduleProperties( + description, + tags, + properties, + serializedAdditionalRawData: null, + displayName, + isEnabled, + trigger, + action, + provisioningState); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// [Required] Additional attributes of the entity. + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// Managed service identity (system assigned and/or user assigned identities). + /// Sku details required for ARM contract for Autoscaling. + /// A new instance for mocking. + public static ServerlessEndpointData ServerlessEndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ServerlessEndpointProperties properties = null, string kind = null, ManagedServiceIdentity identity = null, MachineLearningSku sku = null) + { + tags ??= new Dictionary(); + + return new ServerlessEndpointData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + kind, + identity, + sku, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. + /// [Required] Specifies the authentication mode for the Serverless endpoint. + /// The inference uri to target when making requests against the serverless endpoint. + /// Provisioning state for the endpoint. + /// The current state of the ServerlessEndpoint. + /// The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + /// Specifies the content safety options. If omitted, the default content safety settings will be configured. + /// A new instance for mocking. + public static ServerlessEndpointProperties ServerlessEndpointProperties(string modelId = null, ServerlessInferenceEndpointAuthMode authMode = default, ServerlessInferenceEndpoint inferenceEndpoint = null, MachineLearningEndpointProvisioningState? provisioningState = null, ServerlessEndpointState? endpointState = null, string marketplaceSubscriptionId = null, ContentSafetyStatus? contentSafetyStatus = null) + { + return new ServerlessEndpointProperties( + modelId != null ? new ModelSettings(modelId, serializedAdditionalRawData: null) : null, + authMode, + inferenceEndpoint, + provisioningState, + endpointState, + marketplaceSubscriptionId, + contentSafetyStatus.HasValue ? new ContentSafety(contentSafetyStatus.Value, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + /// Specifies any required headers to target this serverless endpoint. + /// A new instance for mocking. + public static ServerlessInferenceEndpoint ServerlessInferenceEndpoint(Uri uri = null, IReadOnlyDictionary headers = null) + { + headers ??= new Dictionary(); + + return new ServerlessInferenceEndpoint(uri, headers, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Managed service identity (system assigned and/or user assigned identities). + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// Sku details required for ARM contract for Autoscaling. + /// Discovery URL for the Registry. + /// IntellectualPropertyPublisher for the registry. + /// ResourceId of the managed RG if the registry has system created resources. + /// MLFlow Registry URI for the Registry. + /// Private endpoint connections info used for pending connections in private link portal. + /// + /// Is the Registry accessible from the internet? + /// Possible values: "Enabled" or "Disabled" + /// + /// Details of each region the registry is in. + /// A new instance for mocking. + public static MachineLearningRegistryData MachineLearningRegistryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string kind = null, MachineLearningSku sku = null, Uri discoveryUri = null, string intellectualPropertyPublisher = null, ResourceIdentifier managedResourceId = null, Uri mlFlowRegistryUri = null, IEnumerable registryPrivateEndpointConnections = null, string publicNetworkAccess = null, IEnumerable regionDetails = null) + { + tags ??= new Dictionary(); + registryPrivateEndpointConnections ??= new List(); + regionDetails ??= new List(); + + return new MachineLearningRegistryData( + id, + name, + resourceType, + systemData, + tags, + location, + identity, + kind, + sku, + discoveryUri, + intellectualPropertyPublisher, + managedResourceId != null ? new ArmResourceId(managedResourceId, serializedAdditionalRawData: null) : null, + mlFlowRegistryUri, + registryPrivateEndpointConnections?.ToList(), + publicNetworkAccess, + regionDetails?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The ARM identifier for Private Endpoint. + /// The subnetId that the private endpoint is connected to. + /// A new instance for mocking. + public static RegistryPrivateEndpoint RegistryPrivateEndpoint(ResourceIdentifier id = null, ResourceIdentifier subnetArmId = null) + { + return new RegistryPrivateEndpoint(id, serializedAdditionalRawData: null, subnetArmId); + } + + /// Initializes a new instance of . + /// Specifies the feature ID. + /// Specifies the feature name. + /// Describes the feature for user experience. + /// A new instance for mocking. + public static MachineLearningUserFeature MachineLearningUserFeature(string id = null, string displayName = null, string description = null) + { + return new MachineLearningUserFeature(id, displayName, description, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Location for the underlying compute. + /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + /// The description of the Machine Learning compute. + /// The time at which the compute was created. + /// The time at which the compute was last modified. + /// ARM resource id of the underlying compute. + /// Errors during provisioning. + /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + /// AKS properties. + /// A new instance for mocking. + public static MachineLearningAksCompute MachineLearningAksCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningAksComputeProperties properties = null) + { + provisioningErrors ??= new List(); + + return new MachineLearningAksCompute( + ComputeType.Aks, + computeLocation, + provisioningState, + description, + createdOn, + modifiedOn, + resourceId, + provisioningErrors?.ToList(), + isAttachedCompute, + disableLocalAuth, + serializedAdditionalRawData: null, + properties); + } + + /// Initializes a new instance of . + /// Cluster full qualified domain name. + /// System services. + /// Number of agents. + /// Agent virtual machine size. + /// Intended usage of the cluster. + /// SSL configuration. + /// AKS networking configuration for vnet. + /// Load Balancer Type. + /// Load Balancer Subnet. + /// A new instance for mocking. + public static MachineLearningAksComputeProperties MachineLearningAksComputeProperties(string clusterFqdn = null, IEnumerable systemServices = null, int? agentCount = null, string agentVmSize = null, MachineLearningClusterPurpose? clusterPurpose = null, MachineLearningSslConfiguration sslConfiguration = null, MachineLearningAksNetworkingConfiguration aksNetworkingConfiguration = null, MachineLearningLoadBalancerType? loadBalancerType = null, string loadBalancerSubnet = null) + { + systemServices ??= new List(); + + return new MachineLearningAksComputeProperties( + clusterFqdn, + systemServices?.ToList(), + agentCount, + agentVmSize, + clusterPurpose, + sslConfiguration, + aksNetworkingConfiguration, + loadBalancerType, + loadBalancerSubnet, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The type of this system service. + /// Public IP address. + /// The version for this type. + /// A new instance for mocking. + public static MachineLearningComputeSystemService MachineLearningComputeSystemService(string systemServiceType = null, string publicIPAddress = null, string version = null) + { + return new MachineLearningComputeSystemService(systemServiceType, publicIPAddress, version, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Location for the underlying compute. + /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + /// The description of the Machine Learning compute. + /// The time at which the compute was created. + /// The time at which the compute was last modified. + /// ARM resource id of the underlying compute. + /// Errors during provisioning. + /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + /// Properties of Kubernetes. + /// A new instance for mocking. + public static MachineLearningKubernetesCompute MachineLearningKubernetesCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningKubernetesProperties properties = null) + { + provisioningErrors ??= new List(); + + return new MachineLearningKubernetesCompute( + ComputeType.Kubernetes, + computeLocation, + provisioningState, + description, + createdOn, + modifiedOn, + resourceId, + provisioningErrors?.ToList(), + isAttachedCompute, + disableLocalAuth, + serializedAdditionalRawData: null, + properties); + } + + /// Initializes a new instance of . + /// Compute OS Type. + /// Virtual Machine Size. + /// Virtual Machine priority. + /// Virtual Machine image for AML Compute - windows only. + /// Network is isolated or not. + /// Scale settings for AML Compute. + /// Credentials for an administrator user account that will be created on each compute node. + /// Virtual network subnet resource ID the compute nodes belong to. + /// State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled. + /// Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute. + /// The time at which the compute entered its current allocation state. + /// Collection of errors encountered by various compute nodes during node setup. + /// The number of compute nodes currently assigned to the compute. + /// The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation. + /// Counts of various node states on the compute. + /// Enable or disable node public IP address provisioning. Possible values are: Possible values are: true - Indicates that the compute nodes will have public IPs provisioned. false - Indicates that the compute nodes will have a private endpoint and no public IPs. + /// A property bag containing additional properties. + /// A new instance for mocking. + public static AmlComputeProperties AmlComputeProperties(MachineLearningOSType? osType = null, string vmSize = null, MachineLearningVmPriority? vmPriority = null, string virtualMachineImageId = null, bool? isolatedNetwork = null, AmlComputeScaleSettings scaleSettings = null, MachineLearningUserAccountCredentials userAccountCredentials = null, ResourceIdentifier subnetId = null, MachineLearningRemoteLoginPortPublicAccess? remoteLoginPortPublicAccess = null, MachineLearningAllocationState? allocationState = null, DateTimeOffset? allocationStateTransitionOn = null, IEnumerable errors = null, int? currentNodeCount = null, int? targetNodeCount = null, MachineLearningNodeStateCounts nodeStateCounts = null, bool? enableNodePublicIP = null, BinaryData propertyBag = null) + { + errors ??= new List(); + + return new AmlComputeProperties( + osType, + vmSize, + vmPriority, + virtualMachineImageId != null ? new VirtualMachineImage(virtualMachineImageId, serializedAdditionalRawData: null) : null, + isolatedNetwork, + scaleSettings, + userAccountCredentials, + subnetId != null ? new ResourceId(subnetId, serializedAdditionalRawData: null) : null, + remoteLoginPortPublicAccess, + allocationState, + allocationStateTransitionOn, + errors?.ToList(), + currentNodeCount, + targetNodeCount, + nodeStateCounts, + enableNodePublicIP, + propertyBag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Number of compute nodes in idle state. + /// Number of compute nodes which are running jobs. + /// Number of compute nodes which are being prepared. + /// Number of compute nodes which are in unusable state. + /// Number of compute nodes which are leaving the amlCompute. + /// Number of compute nodes which are in preempted state. + /// A new instance for mocking. + public static MachineLearningNodeStateCounts MachineLearningNodeStateCounts(int? idleNodeCount = null, int? runningNodeCount = null, int? preparingNodeCount = null, int? unusableNodeCount = null, int? leavingNodeCount = null, int? preemptedNodeCount = null) + { + return new MachineLearningNodeStateCounts( + idleNodeCount, + runningNodeCount, + preparingNodeCount, + unusableNodeCount, + leavingNodeCount, + preemptedNodeCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Location for the underlying compute. + /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + /// The description of the Machine Learning compute. + /// The time at which the compute was created. + /// The time at which the compute was last modified. + /// ARM resource id of the underlying compute. + /// Errors during provisioning. + /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + /// Properties of AmlCompute. + /// A new instance for mocking. + public static AmlCompute AmlCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, AmlComputeProperties properties = null) + { + provisioningErrors ??= new List(); + + return new AmlCompute( + ComputeType.AmlCompute, + computeLocation, + provisioningState, + description, + createdOn, + modifiedOn, + resourceId, + provisioningErrors?.ToList(), + isAttachedCompute, + disableLocalAuth, + serializedAdditionalRawData: null, + properties); + } + + /// Initializes a new instance of . + /// State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable. + /// Describes the admin user name. + /// Describes the port for connecting through SSH. + /// Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs. + /// A new instance for mocking. + public static MachineLearningComputeInstanceSshSettings MachineLearningComputeInstanceSshSettings(MachineLearningSshPublicAccess? sshPublicAccess = null, string adminUserName = null, int? sshPort = null, string adminPublicKey = null) + { + return new MachineLearningComputeInstanceSshSettings(sshPublicAccess, adminUserName, sshPort, adminPublicKey, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Specifies the current operating system image version this compute instance is running on. + /// Specifies the latest available operating system image version. + /// Specifies whether this compute instance is running on the latest operating system image. + /// Metadata about the os patching. + /// A new instance for mocking. + public static ImageMetadata ImageMetadata(string currentImageVersion = null, string latestImageVersion = null, bool? isLatestOSImageVersion = null, OSPatchingStatus osPatchingStatus = null) + { + return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, osPatchingStatus, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The os patching status. + /// Time of the latest os patching. + /// Specifies whether this compute instance is pending for reboot to finish os patching. + /// Time of scheduled reboot. + /// Collection of errors encountered when doing os patching. + /// A new instance for mocking. + public static OSPatchingStatus OSPatchingStatus(PatchStatus? patchStatus = null, DateTimeOffset? latestPatchOn = null, bool? rebootPending = null, DateTimeOffset? scheduledRebootOn = null, IEnumerable osPatchingErrors = null) + { + osPatchingErrors ??= new List(); + + return new OSPatchingStatus( + patchStatus, + latestPatchOn, + rebootPending, + scheduledRebootOn, + osPatchingErrors?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Public IP Address of this ComputeInstance. + /// Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is deployed). + /// A new instance for mocking. + public static MachineLearningComputeInstanceConnectivityEndpoints MachineLearningComputeInstanceConnectivityEndpoints(string publicIPAddress = null, string privateIPAddress = null) + { + return new MachineLearningComputeInstanceConnectivityEndpoints(publicIPAddress, privateIPAddress, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the ComputeInstance application. + /// Application' endpoint URI. + /// A new instance for mocking. + public static MachineLearningComputeInstanceApplication MachineLearningComputeInstanceApplication(string displayName = null, Uri endpointUri = null) + { + return new MachineLearningComputeInstanceApplication(displayName, endpointUri, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the user. + /// Uniquely identifies user' Azure Active Directory organization. + /// Uniquely identifies the user within his/her organization. + /// A new instance for mocking. + public static MachineLearningComputeInstanceCreatedBy MachineLearningComputeInstanceCreatedBy(string userName = null, string userOrgId = null, string userId = null) + { + return new MachineLearningComputeInstanceCreatedBy(userName, userOrgId, userId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the last operation. + /// Time of the last operation. + /// Operation status. + /// Trigger of operation. + /// A new instance for mocking. + public static MachineLearningComputeInstanceLastOperation MachineLearningComputeInstanceLastOperation(MachineLearningOperationName? operationName = null, DateTimeOffset? operationOn = null, MachineLearningOperationStatus? operationStatus = null, MachineLearningOperationTrigger? operationTrigger = null) + { + return new MachineLearningComputeInstanceLastOperation(operationName, operationOn, operationStatus, operationTrigger, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A system assigned id for the schedule. + /// The current deployment state of schedule. + /// Is the schedule enabled or disabled?. + /// [Required] The compute power action. + /// [Required] The schedule trigger type. + /// Required if triggerType is Recurrence. + /// Required if triggerType is Cron. + /// [Deprecated] Not used any more. + /// A new instance for mocking. + public static MachineLearningComputeStartStopSchedule MachineLearningComputeStartStopSchedule(string id = null, MachineLearningComputeProvisioningStatus? provisioningStatus = null, MachineLearningScheduleStatus? status = null, MachineLearningComputePowerAction? action = null, MachineLearningTriggerType? triggerType = null, ComputeStartStopRecurrenceSchedule recurrenceSchedule = null, ComputeStartStopCronSchedule cronSchedule = null, MachineLearningScheduleBase schedule = null) + { + return new MachineLearningComputeStartStopSchedule( + id, + provisioningStatus, + status, + action, + triggerType, + recurrenceSchedule, + cronSchedule, + schedule, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the ComputeInstance container. + /// Auto save settings. + /// Information of GPU. + /// network of this container. + /// Environment information of this container. + /// services of this containers. + /// A new instance for mocking. + public static MachineLearningComputeInstanceContainer MachineLearningComputeInstanceContainer(string name = null, MachineLearningComputeInstanceAutosave? autosave = null, string gpu = null, MachineLearningNetwork? network = null, MachineLearningComputeInstanceEnvironmentInfo environment = null, IEnumerable services = null) + { + services ??= new List(); + + return new MachineLearningComputeInstanceContainer( + name, + autosave, + gpu, + network, + environment, + services?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// name of environment. + /// version of environment. + /// A new instance for mocking. + public static MachineLearningComputeInstanceEnvironmentInfo MachineLearningComputeInstanceEnvironmentInfo(string name = null, string version = null) + { + return new MachineLearningComputeInstanceEnvironmentInfo(name, version, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Caching type of Data Disk. + /// The initial disk size in gigabytes. + /// The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. + /// type of this storage account. + /// A new instance for mocking. + public static MachineLearningComputeInstanceDataDisk MachineLearningComputeInstanceDataDisk(MachineLearningCachingType? caching = null, int? diskSizeGB = null, int? lun = null, MachineLearningStorageAccountType? storageAccountType = null) + { + return new MachineLearningComputeInstanceDataDisk(caching, diskSizeGB, lun, storageAccountType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Location for the underlying compute. + /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + /// The description of the Machine Learning compute. + /// The time at which the compute was created. + /// The time at which the compute was last modified. + /// ARM resource id of the underlying compute. + /// Errors during provisioning. + /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + /// Properties of ComputeInstance. + /// A new instance for mocking. + public static MachineLearningComputeInstance MachineLearningComputeInstance(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningComputeInstanceProperties properties = null) + { + provisioningErrors ??= new List(); + + return new MachineLearningComputeInstance( + ComputeType.ComputeInstance, + computeLocation, + provisioningState, + description, + createdOn, + modifiedOn, + resourceId, + provisioningErrors?.ToList(), + isAttachedCompute, + disableLocalAuth, + serializedAdditionalRawData: null, + properties); + } + + /// Initializes a new instance of . + /// Location for the underlying compute. + /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + /// The description of the Machine Learning compute. + /// The time at which the compute was created. + /// The time at which the compute was last modified. + /// ARM resource id of the underlying compute. + /// Errors during provisioning. + /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + /// + /// A new instance for mocking. + public static MachineLearningVirtualMachineCompute MachineLearningVirtualMachineCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningVirtualMachineProperties properties = null) + { + provisioningErrors ??= new List(); + + return new MachineLearningVirtualMachineCompute( + ComputeType.VirtualMachine, + computeLocation, + provisioningState, + description, + createdOn, + modifiedOn, + resourceId, + provisioningErrors?.ToList(), + isAttachedCompute, + disableLocalAuth, + serializedAdditionalRawData: null, + properties); + } + + /// Initializes a new instance of . + /// Location for the underlying compute. + /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + /// The description of the Machine Learning compute. + /// The time at which the compute was created. + /// The time at which the compute was last modified. + /// ARM resource id of the underlying compute. + /// Errors during provisioning. + /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + /// HDInsight compute properties. + /// A new instance for mocking. + public static MachineLearningHDInsightCompute MachineLearningHDInsightCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningHDInsightProperties properties = null) + { + provisioningErrors ??= new List(); + + return new MachineLearningHDInsightCompute( + ComputeType.HDInsight, + computeLocation, + provisioningState, + description, + createdOn, + modifiedOn, + resourceId, + provisioningErrors?.ToList(), + isAttachedCompute, + disableLocalAuth, + serializedAdditionalRawData: null, + properties); + } + + /// Initializes a new instance of . + /// Location for the underlying compute. + /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + /// The description of the Machine Learning compute. + /// The time at which the compute was created. + /// The time at which the compute was last modified. + /// ARM resource id of the underlying compute. + /// Errors during provisioning. + /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + /// A new instance for mocking. + public static MachineLearningDataFactoryCompute MachineLearningDataFactoryCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null) + { + provisioningErrors ??= new List(); + + return new MachineLearningDataFactoryCompute( + ComputeType.DataFactory, + computeLocation, + provisioningState, + description, + createdOn, + modifiedOn, + resourceId, + provisioningErrors?.ToList(), + isAttachedCompute, + disableLocalAuth, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Location for the underlying compute. + /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + /// The description of the Machine Learning compute. + /// The time at which the compute was created. + /// The time at which the compute was last modified. + /// ARM resource id of the underlying compute. + /// Errors during provisioning. + /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + /// Properties of Databricks. + /// A new instance for mocking. + public static MachineLearningDatabricksCompute MachineLearningDatabricksCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningDatabricksProperties properties = null) + { + provisioningErrors ??= new List(); + + return new MachineLearningDatabricksCompute( + ComputeType.Databricks, + computeLocation, + provisioningState, + description, + createdOn, + modifiedOn, + resourceId, + provisioningErrors?.ToList(), + isAttachedCompute, + disableLocalAuth, + serializedAdditionalRawData: null, + properties); + } + + /// Initializes a new instance of . + /// Location for the underlying compute. + /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + /// The description of the Machine Learning compute. + /// The time at which the compute was created. + /// The time at which the compute was last modified. + /// ARM resource id of the underlying compute. + /// Errors during provisioning. + /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + /// + /// A new instance for mocking. + public static MachineLearningDataLakeAnalytics MachineLearningDataLakeAnalytics(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, string dataLakeStoreAccountName = null) + { + provisioningErrors ??= new List(); + + return new MachineLearningDataLakeAnalytics( + ComputeType.DataLakeAnalytics, + computeLocation, + provisioningState, + description, + createdOn, + modifiedOn, + resourceId, + provisioningErrors?.ToList(), + isAttachedCompute, + disableLocalAuth, + serializedAdditionalRawData: null, + dataLakeStoreAccountName != null ? new MachineLearningDataLakeAnalyticsProperties(dataLakeStoreAccountName, serializedAdditionalRawData: null) : null); + } + + /// Initializes a new instance of . + /// Location for the underlying compute. + /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. + /// The description of the Machine Learning compute. + /// The time at which the compute was created. + /// The time at which the compute was last modified. + /// ARM resource id of the underlying compute. + /// Errors during provisioning. + /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. + /// + /// A new instance for mocking. + public static MachineLearningSynapseSpark MachineLearningSynapseSpark(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningSynapseSparkProperties properties = null) + { + provisioningErrors ??= new List(); + + return new MachineLearningSynapseSpark( + ComputeType.SynapseSpark, + computeLocation, + provisioningState, + description, + createdOn, + modifiedOn, + resourceId, + provisioningErrors?.ToList(), + isAttachedCompute, + disableLocalAuth, + serializedAdditionalRawData: null, + properties); + } + + /// Initializes a new instance of . + /// Content of kubeconfig file that can be used to connect to the Kubernetes cluster. + /// Content of kubeconfig file that can be used to connect to the Kubernetes cluster. + /// Image registry pull secret. + /// A new instance for mocking. + public static MachineLearningAksComputeSecrets MachineLearningAksComputeSecrets(string userKubeConfig = null, string adminKubeConfig = null, string imagePullSecretName = null) + { + return new MachineLearningAksComputeSecrets(ComputeType.Aks, serializedAdditionalRawData: null, userKubeConfig, adminKubeConfig, imagePullSecretName); + } + + /// Initializes a new instance of . + /// Admin credentials for virtual machine. + /// A new instance for mocking. + public static MachineLearningVirtualMachineSecrets MachineLearningVirtualMachineSecrets(MachineLearningVmSshCredentials administratorAccount = null) + { + return new MachineLearningVirtualMachineSecrets(ComputeType.VirtualMachine, serializedAdditionalRawData: null, administratorAccount); + } + + /// Initializes a new instance of . + /// access token for databricks account. + /// A new instance for mocking. + public static MachineLearningDatabricksComputeSecrets MachineLearningDatabricksComputeSecrets(string databricksAccessToken = null) + { + return new MachineLearningDatabricksComputeSecrets(ComputeType.Databricks, serializedAdditionalRawData: null, databricksAccessToken); + } + +<<<<<<< HEAD +======= + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Is the asset archived?. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// + /// The ARM resource ID of the Environment specification for the job. + /// This is optional value to provide, if not provided, AutoML will default this to Production AutoML curated environment version when running the job. + /// + /// Environment variables included in the job. + /// + /// Mapping of output data bindings used in the job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// Queue settings for the job. + /// Compute Resource configuration for the job. + /// + /// [Required] This represents scenario which can be one of Tables/NLP/Image + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , and . + /// + /// A new instance for mocking. + public static AutoMLJob AutoMLJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, string environmentId = null, IDictionary environmentVariables = null, IDictionary outputs = null, JobTier? queueJobTier = null, MachineLearningJobResourceConfiguration resources = null, AutoMLVertical taskDetails = null) + { + properties ??= new Dictionary(); + tags ??= new Dictionary(); + services ??= new Dictionary(); + environmentVariables ??= new Dictionary(); + outputs ??= new Dictionary(); + + return new AutoMLJob( + description, + properties, + tags, + serializedAdditionalRawData: null, + componentId, + computeId, + displayName, + experimentName, + identity, + isArchived, + JobType.AutoML, + notificationSetting, + services, + status, + environmentId, + environmentVariables, + outputs, + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, + resources, + taskDetails); + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// + /// [Required] Account credentials. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Readonly property to indicate if datastore is the workspace default datastore. + /// Storage account name. + /// Storage account container name. + /// Azure cloud endpoint for the storage account. + /// Protocol used to communicate with the storage account. + /// Indicates which identity to use to authenticate service data access to customer's storage. + /// Azure Resource Group name. + /// Azure Subscription Id. + /// A new instance for mocking. + public static MachineLearningAzureBlobDatastore MachineLearningAzureBlobDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, string accountName = null, string containerName = null, string endpoint = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) + { + properties ??= new Dictionary(); + tags ??= new Dictionary(); + + return new MachineLearningAzureBlobDatastore( + description, + properties, + tags, + serializedAdditionalRawData: null, + credentials, + DatastoreType.AzureBlob, + isDefault, + accountName, + containerName, + endpoint, + protocol, + serviceDataAccessAuthIdentity, + resourceGroup, + subscriptionId); + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// + /// [Required] Account credentials. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Readonly property to indicate if datastore is the workspace default datastore. + /// Indicates which identity to use to authenticate service data access to customer's storage. + /// [Required] Azure Data Lake store name. + /// Azure Resource Group name. + /// Azure Subscription Id. + /// A new instance for mocking. + public static MachineLearningAzureDataLakeGen1Datastore MachineLearningAzureDataLakeGen1Datastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string storeName = null, string resourceGroup = null, string subscriptionId = null) + { + properties ??= new Dictionary(); + tags ??= new Dictionary(); + + return new MachineLearningAzureDataLakeGen1Datastore( + description, + properties, + tags, + serializedAdditionalRawData: null, + credentials, + DatastoreType.AzureDataLakeGen1, + isDefault, + serviceDataAccessAuthIdentity, + storeName, + resourceGroup, + subscriptionId); + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// + /// [Required] Account credentials. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Readonly property to indicate if datastore is the workspace default datastore. + /// [Required] Storage account name. + /// Azure cloud endpoint for the storage account. + /// [Required] The name of the Data Lake Gen2 filesystem. + /// Protocol used to communicate with the storage account. + /// Indicates which identity to use to authenticate service data access to customer's storage. + /// Azure Resource Group name. + /// Azure Subscription Id. + /// A new instance for mocking. + public static MachineLearningAzureDataLakeGen2Datastore MachineLearningAzureDataLakeGen2Datastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, string accountName = null, string endpoint = null, string filesystem = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) + { + properties ??= new Dictionary(); + tags ??= new Dictionary(); + + return new MachineLearningAzureDataLakeGen2Datastore( + description, + properties, + tags, + serializedAdditionalRawData: null, + credentials, + DatastoreType.AzureDataLakeGen2, + isDefault, + accountName, + endpoint, + filesystem, + protocol, + serviceDataAccessAuthIdentity, + resourceGroup, + subscriptionId); + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// + /// [Required] Account credentials. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Readonly property to indicate if datastore is the workspace default datastore. + /// [Required] Storage account name. + /// Azure cloud endpoint for the storage account. + /// [Required] The name of the Azure file share that the datastore points to. + /// Protocol used to communicate with the storage account. + /// Indicates which identity to use to authenticate service data access to customer's storage. + /// Azure Resource Group name. + /// Azure Subscription Id. + /// A new instance for mocking. + public static MachineLearningAzureFileDatastore MachineLearningAzureFileDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, string accountName = null, string endpoint = null, string fileShareName = null, string protocol = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null, string resourceGroup = null, string subscriptionId = null) + { + properties ??= new Dictionary(); + tags ??= new Dictionary(); + + return new MachineLearningAzureFileDatastore( + description, + properties, + tags, + serializedAdditionalRawData: null, + credentials, + DatastoreType.AzureFile, + isDefault, + accountName, + endpoint, + fileShareName, + protocol, + serviceDataAccessAuthIdentity, + resourceGroup, + subscriptionId); + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Is the asset archived?. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// ARM resource ID of the code asset. + /// [Required] The command to execute on startup of the job. eg. "python train.py". + /// + /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// [Required] The ARM resource ID of the Environment specification for the job. + /// Environment variables included in the job. + /// + /// Mapping of input data bindings used in the job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// Command Job limit. + /// + /// Mapping of output data bindings used in the job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// Input parameters. + /// Queue settings for the job. + /// Compute Resource configuration for the job. + /// A new instance for mocking. + public static MachineLearningCommandJob MachineLearningCommandJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, ResourceIdentifier codeId = null, string command = null, MachineLearningDistributionConfiguration distribution = null, ResourceIdentifier environmentId = null, IDictionary environmentVariables = null, IDictionary inputs = null, MachineLearningCommandJobLimits limits = null, IDictionary outputs = null, BinaryData parameters = null, JobTier? queueJobTier = null, MachineLearningJobResourceConfiguration resources = null) + { + properties ??= new Dictionary(); + tags ??= new Dictionary(); + services ??= new Dictionary(); + environmentVariables ??= new Dictionary(); + inputs ??= new Dictionary(); + outputs ??= new Dictionary(); + + return new MachineLearningCommandJob( + description, + properties, + tags, + serializedAdditionalRawData: null, + componentId, + computeId, + displayName, + experimentName, + identity, + isArchived, + JobType.Command, + notificationSetting, + services, + status, + codeId, + command, + distribution, + environmentId, + environmentVariables, + inputs, + limits, + outputs, + parameters, + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, + resources); + } + + /// Initializes a new instance of . + /// DockerCredential user password. + /// DockerCredential user name. + /// A new instance for mocking. + public static DockerCredential DockerCredential(string password = null, string userName = null) + { + return new DockerCredential(DataReferenceCredentialType.DockerCredentials, serializedAdditionalRawData: null, password, userName); + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Is the asset archived?. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Instance types and other resources for the job. + /// Queue settings for the job. + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// A new instance for mocking. + public static FineTuningJob FineTuningJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, FineTuningVertical fineTuningDetails = null, IEnumerable resourcesInstanceTypes = null, JobTier? queueJobTier = null, IDictionary outputs = null) + { + properties ??= new Dictionary(); + tags ??= new Dictionary(); + services ??= new Dictionary(); + resourcesInstanceTypes ??= new List(); + outputs ??= new Dictionary(); + + return new FineTuningJob( + description, + properties, + tags, + serializedAdditionalRawData: null, + componentId, + computeId, + displayName, + experimentName, + identity, + isArchived, + JobType.FineTuning, + notificationSetting, + services, + status, + fineTuningDetails, + resourcesInstanceTypes != null ? new JobResources(resourcesInstanceTypes?.ToList(), serializedAdditionalRawData: null) : null, + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, + outputs); + } + + /// Initializes a new instance of . + /// Code configuration for the endpoint deployment. + /// Description of the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. + /// Environment variables configuration for the deployment. + /// Property dictionary. Properties can be added, but not removed or altered. + /// If true, enables Application Insights logging. + /// The mdc configuration, we disable mdc when it's null. + /// If Enabled, allow egress public network access. If Disabled, this will create secure egress. Default: Enabled. + /// Compute instance type. + /// Liveness probe monitors the health of the container regularly. + /// The URI path to the model. + /// The path to mount the model in custom container. + /// Provisioning state for the endpoint deployment. + /// Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same as liveness probe. + /// Request settings for the deployment. + /// + /// Scale settings for the deployment. + /// If it is null or not provided, + /// it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment + /// and to DefaultScaleSettings for ManagedOnlineDeployment. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// The resource requirements for the container (cpu and memory). + /// A new instance for mocking. + public static MachineLearningKubernetesOnlineDeployment MachineLearningKubernetesOnlineDeployment(MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, IDictionary environmentVariables = null, IDictionary properties = null, bool? appInsightsEnabled = null, DataCollector dataCollector = null, MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = null, string instanceType = null, MachineLearningProbeSettings livenessProbe = null, string model = null, string modelMountPath = null, MachineLearningDeploymentProvisioningState? provisioningState = null, MachineLearningProbeSettings readinessProbe = null, MachineLearningOnlineRequestSettings requestSettings = null, MachineLearningOnlineScaleSettings scaleSettings = null, MachineLearningContainerResourceRequirements containerResourceRequirements = null) + { + environmentVariables ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningKubernetesOnlineDeployment( + codeConfiguration, + description, + environmentId, + environmentVariables, + properties, + serializedAdditionalRawData: null, + appInsightsEnabled, + dataCollector, + egressPublicNetworkAccess, + MachineLearningEndpointComputeType.Kubernetes, + instanceType, + livenessProbe, + model, + modelMountPath, + provisioningState, + readinessProbe, + requestSettings, + scaleSettings, + containerResourceRequirements); + } + + /// Initializes a new instance of . + /// ManagedIdentityCredential identity type. + /// ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + /// TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// A new instance for mocking. + public static ManagedIdentityCredential ManagedIdentityCredential(string managedIdentityType = null, string userManagedIdentityClientId = null, string userManagedIdentityPrincipalId = null, string userManagedIdentityResourceId = null, string userManagedIdentityTenantId = null) + { + return new ManagedIdentityCredential( + DataReferenceCredentialType.ManagedIdentity, + serializedAdditionalRawData: null, + managedIdentityType, + userManagedIdentityClientId, + userManagedIdentityPrincipalId, + userManagedIdentityResourceId, + userManagedIdentityTenantId); + } + + /// Initializes a new instance of . + /// Code configuration for the endpoint deployment. + /// Description of the endpoint deployment. + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. + /// Environment variables configuration for the deployment. + /// Property dictionary. Properties can be added, but not removed or altered. + /// If true, enables Application Insights logging. + /// The mdc configuration, we disable mdc when it's null. + /// If Enabled, allow egress public network access. If Disabled, this will create secure egress. Default: Enabled. + /// Compute instance type. + /// Liveness probe monitors the health of the container regularly. + /// The URI path to the model. + /// The path to mount the model in custom container. + /// Provisioning state for the endpoint deployment. + /// Readiness probe validates if the container is ready to serve traffic. The properties and defaults are the same as liveness probe. + /// Request settings for the deployment. + /// + /// Scale settings for the deployment. + /// If it is null or not provided, + /// it defaults to TargetUtilizationScaleSettings for KubernetesOnlineDeployment + /// and to DefaultScaleSettings for ManagedOnlineDeployment. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// A new instance for mocking. + public static MachineLearningManagedOnlineDeployment MachineLearningManagedOnlineDeployment(MachineLearningCodeConfiguration codeConfiguration = null, string description = null, string environmentId = null, IDictionary environmentVariables = null, IDictionary properties = null, bool? appInsightsEnabled = null, DataCollector dataCollector = null, MachineLearningEgressPublicNetworkAccessType? egressPublicNetworkAccess = null, string instanceType = null, MachineLearningProbeSettings livenessProbe = null, string model = null, string modelMountPath = null, MachineLearningDeploymentProvisioningState? provisioningState = null, MachineLearningProbeSettings readinessProbe = null, MachineLearningOnlineRequestSettings requestSettings = null, MachineLearningOnlineScaleSettings scaleSettings = null) + { + environmentVariables ??= new Dictionary(); + properties ??= new Dictionary(); + + return new MachineLearningManagedOnlineDeployment( + codeConfiguration, + description, + environmentId, + environmentVariables, + properties, + serializedAdditionalRawData: null, + appInsightsEnabled, + dataCollector, + egressPublicNetworkAccess, + MachineLearningEndpointComputeType.Managed, + instanceType, + livenessProbe, + model, + modelMountPath, + provisioningState, + readinessProbe, + requestSettings, + scaleSettings); + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// + /// [Required] Account credentials. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Readonly property to indicate if datastore is the workspace default datastore. + /// + /// [Required] OneLake artifact backing the datastore. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// OneLake endpoint to use for the datastore. + /// [Required] OneLake workspace name. + /// Indicates which identity to use to authenticate service data access to customer's storage. + /// A new instance for mocking. + public static OneLakeDatastore OneLakeDatastore(string description = null, IDictionary properties = null, IDictionary tags = null, MachineLearningDatastoreCredentials credentials = null, bool? isDefault = null, OneLakeArtifact artifact = null, string endpoint = null, string oneLakeWorkspaceName = null, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity = null) + { + properties ??= new Dictionary(); + tags ??= new Dictionary(); + + return new OneLakeDatastore( + description, + properties, + tags, + serializedAdditionalRawData: null, + credentials, + DatastoreType.OneLake, + isDefault, + artifact, + endpoint, + oneLakeWorkspaceName, + serviceDataAccessAuthIdentity); + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Is the asset archived?. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// + /// Inputs for the pipeline job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// Jobs construct the Pipeline Job. + /// + /// Outputs for the pipeline job + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// Pipeline settings, for things like ContinueRunOnStepFailure etc. + /// ARM resource ID of source job. + /// A new instance for mocking. + public static MachineLearningPipelineJob MachineLearningPipelineJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, IDictionary inputs = null, IDictionary jobs = null, IDictionary outputs = null, BinaryData settings = null, ResourceIdentifier sourceJobId = null) + { + properties ??= new Dictionary(); + tags ??= new Dictionary(); + services ??= new Dictionary(); + inputs ??= new Dictionary(); + jobs ??= new Dictionary(); + outputs ??= new Dictionary(); + + return new MachineLearningPipelineJob( + description, + properties, + tags, + serializedAdditionalRawData: null, + componentId, + computeId, + displayName, + experimentName, + identity, + isArchived, + JobType.Pipeline, + notificationSetting, + services, + status, + inputs, + jobs, + outputs, + settings, + sourceJobId); + } + + /// Initializes a new instance of . + /// Full SAS Uri, including the storage, container/blob path and SAS token. + /// A new instance for mocking. + public static SasCredential SasCredential(Uri sasUri = null) + { + return new SasCredential(DataReferenceCredentialType.Sas, serializedAdditionalRawData: null, sasUri); + } + + /// Initializes a new instance of . + /// Full SAS Uri, including the storage, container/blob path and SAS token. + /// A new instance for mocking. + public static SasCredentialDto SasCredentialDto(Uri sasUri = null) + { + return new SasCredentialDto(PendingUploadCredentialType.Sas, serializedAdditionalRawData: null, sasUri); + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Is the asset archived?. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// Archive files used in the job. + /// Arguments for the job. + /// [Required] arm-id of the code asset. + /// Spark configured properties. + /// + /// [Required] The entry to execute on startup of the job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// The ARM resource ID of the Environment specification for the job. + /// Environment variables included in the job. + /// Files used in the job. + /// + /// Mapping of input data bindings used in the job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// Jar files used in the job. + /// + /// Mapping of output data bindings used in the job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// Python files used in the job. + /// Queue settings for the job. + /// Compute Resource configuration for the job. + /// A new instance for mocking. + public static SparkJob SparkJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, IEnumerable archives = null, string args = null, ResourceIdentifier codeId = null, IDictionary conf = null, SparkJobEntry entry = null, ResourceIdentifier environmentId = null, IDictionary environmentVariables = null, IEnumerable files = null, IDictionary inputs = null, IEnumerable jars = null, IDictionary outputs = null, IEnumerable pyFiles = null, JobTier? queueJobTier = null, SparkResourceConfiguration resources = null) + { + properties ??= new Dictionary(); + tags ??= new Dictionary(); + services ??= new Dictionary(); + archives ??= new List(); + conf ??= new Dictionary(); + environmentVariables ??= new Dictionary(); + files ??= new List(); + inputs ??= new Dictionary(); + jars ??= new List(); + outputs ??= new Dictionary(); + pyFiles ??= new List(); + + return new SparkJob( + description, + properties, + tags, + serializedAdditionalRawData: null, + componentId, + computeId, + displayName, + experimentName, + identity, + isArchived, + JobType.Spark, + notificationSetting, + services, + status, + archives?.ToList(), + args, + codeId, + conf, + entry, + environmentId, + environmentVariables, + files?.ToList(), + inputs, + jars?.ToList(), + outputs, + pyFiles?.ToList(), + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, + resources); + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Is the asset archived?. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// + /// Early termination policies enable canceling poor-performing runs before they complete + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// + /// Mapping of input data bindings used in the job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// Sweep Job limit. + /// [Required] Optimization objective. + /// + /// Mapping of output data bindings used in the job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// Queue settings for the job. + /// + /// [Required] The hyperparameter sampling algorithm + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// [Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the parameter. + /// [Required] Trial component definition. + /// A new instance for mocking. + public static MachineLearningSweepJob MachineLearningSweepJob(string description = null, IDictionary properties = null, IDictionary tags = null, ResourceIdentifier componentId = null, ResourceIdentifier computeId = null, string displayName = null, string experimentName = null, MachineLearningIdentityConfiguration identity = null, bool? isArchived = null, NotificationSetting notificationSetting = null, IDictionary services = null, MachineLearningJobStatus? status = null, MachineLearningEarlyTerminationPolicy earlyTermination = null, IDictionary inputs = null, MachineLearningSweepJobLimits limits = null, MachineLearningObjective objective = null, IDictionary outputs = null, JobTier? queueJobTier = null, SamplingAlgorithm samplingAlgorithm = null, BinaryData searchSpace = null, MachineLearningTrialComponent trial = null) { - provisioningErrors ??= new List(); + properties ??= new Dictionary(); + tags ??= new Dictionary(); + services ??= new Dictionary(); + inputs ??= new Dictionary(); + outputs ??= new Dictionary(); - return new AmlCompute( - ComputeType.AmlCompute, - computeLocation, - provisioningState, + return new MachineLearningSweepJob( description, - createdOn, - modifiedOn, - resourceId, - provisioningErrors?.ToList(), - isAttachedCompute, - disableLocalAuth, + properties, + tags, serializedAdditionalRawData: null, - properties); + componentId, + computeId, + displayName, + experimentName, + identity, + isArchived, + JobType.Sweep, + notificationSetting, + services, + status, + earlyTermination, + inputs, + limits, + objective, + outputs, + queueJobTier != null ? new JobQueueSettings(queueJobTier, serializedAdditionalRawData: null) : null, + samplingAlgorithm, + searchSpace, + trial); } - /// Initializes a new instance of . - /// State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on this instance. Enabled - Indicates that the public ssh port is open and accessible according to the VNet/subnet policy if applicable. - /// Describes the admin user name. - /// Describes the port for connecting through SSH. - /// Specifies the SSH rsa public key file as a string. Use "ssh-keygen -t rsa -b 2048" to generate your SSH key pairs. - /// A new instance for mocking. - public static MachineLearningComputeInstanceSshSettings MachineLearningComputeInstanceSshSettings(MachineLearningSshPublicAccess? sshPublicAccess = null, string adminUserName = null, int? sshPort = null, string adminPublicKey = null) + /// Initializes a new instance of . + /// Log verbosity for the job. + /// + /// Target column name: This is prediction values column. + /// Also known as label column name in context of classification tasks. + /// + /// [Required] Training data input. + /// + /// Primary metric for Text-Classification-Multilabel task. + /// Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. + /// + /// Featurization inputs needed for AutoML job. + /// Execution constraints for AutoMLJob. + /// Validation data inputs. + /// A new instance for mocking. + public static TextClassificationMultilabel TextClassificationMultilabel(MachineLearningLogVerbosity? logVerbosity = null, string targetColumnName = null, MachineLearningTableJobInput trainingData = null, ClassificationMultilabelPrimaryMetric? primaryMetric = null, string featurizationDatasetLanguage = null, NlpVerticalLimitSettings limitSettings = null, MachineLearningTableJobInput validationData = null) { - return new MachineLearningComputeInstanceSshSettings(sshPublicAccess, adminUserName, sshPort, adminPublicKey, serializedAdditionalRawData: null); + return new TextClassificationMultilabel( + logVerbosity, + targetColumnName, + TaskType.TextClassificationMultilabel, + trainingData, + serializedAdditionalRawData: null, + primaryMetric, + featurizationDatasetLanguage != null ? new NlpVerticalFeaturizationSettings(featurizationDatasetLanguage, serializedAdditionalRawData: null) : null, + limitSettings, + validationData); } - /// Initializes a new instance of . - /// Specifies the current operating system image version this compute instance is running on. - /// Specifies the latest available operating system image version. - /// Specifies whether this compute instance is running on the latest operating system image. - /// A new instance for mocking. - public static ImageMetadata ImageMetadata(string currentImageVersion = null, string latestImageVersion = null, bool? isLatestOSImageVersion = null) + /// Initializes a new instance of . + /// Log verbosity for the job. + /// + /// Target column name: This is prediction values column. + /// Also known as label column name in context of classification tasks. + /// + /// [Required] Training data input. + /// + /// Primary metric for Text-NER task. + /// Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. + /// + /// Featurization inputs needed for AutoML job. + /// Execution constraints for AutoMLJob. + /// Validation data inputs. + /// A new instance for mocking. + public static TextNer TextNer(MachineLearningLogVerbosity? logVerbosity = null, string targetColumnName = null, MachineLearningTableJobInput trainingData = null, ClassificationPrimaryMetric? primaryMetric = null, string featurizationDatasetLanguage = null, NlpVerticalLimitSettings limitSettings = null, MachineLearningTableJobInput validationData = null) { - return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, serializedAdditionalRawData: null); + return new TextNer( + logVerbosity, + targetColumnName, + TaskType.TextNER, + trainingData, + serializedAdditionalRawData: null, + primaryMetric, + featurizationDatasetLanguage != null ? new NlpVerticalFeaturizationSettings(featurizationDatasetLanguage, serializedAdditionalRawData: null) : null, + limitSettings, + validationData); } - /// Initializes a new instance of . - /// Public IP Address of this ComputeInstance. - /// Private IP Address of this ComputeInstance (local to the VNET in which the compute instance is deployed). - /// A new instance for mocking. - public static MachineLearningComputeInstanceConnectivityEndpoints MachineLearningComputeInstanceConnectivityEndpoints(string publicIPAddress = null, string privateIPAddress = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AadAuthTypeWorkspaceConnectionProperties AadAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) { - return new MachineLearningComputeInstanceConnectivityEndpoints(publicIPAddress, privateIPAddress, serializedAdditionalRawData: null); + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AadAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.Aad, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Name of the ComputeInstance application. - /// Application' endpoint URI. - /// A new instance for mocking. - public static MachineLearningComputeInstanceApplication MachineLearningComputeInstanceApplication(string displayName = null, Uri endpointUri = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static AccessKeyAuthTypeWorkspaceConnectionProperties AccessKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, WorkspaceConnectionAccessKey credentials = null) { - return new MachineLearningComputeInstanceApplication(displayName, endpointUri, serializedAdditionalRawData: null); + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AccessKeyAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.AccessKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); } - /// Initializes a new instance of . - /// Name of the user. - /// Uniquely identifies user' Azure Active Directory organization. - /// Uniquely identifies the user within his/her organization. - /// A new instance for mocking. - public static MachineLearningComputeInstanceCreatedBy MachineLearningComputeInstanceCreatedBy(string userName = null, string userOrgId = null, string userId = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Account key object for workspace connection credential. + /// A new instance for mocking. + public static AccountKeyAuthTypeWorkspaceConnectionProperties AccountKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsKey = null) { - return new MachineLearningComputeInstanceCreatedBy(userName, userOrgId, userId, serializedAdditionalRawData: null); + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new AccountKeyAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.AccountKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKey != null ? new WorkspaceConnectionAccountKey(credentialsKey, serializedAdditionalRawData: null) : null); } - /// Initializes a new instance of . - /// Name of the last operation. - /// Time of the last operation. - /// Operation status. - /// Trigger of operation. - /// A new instance for mocking. - public static MachineLearningComputeInstanceLastOperation MachineLearningComputeInstanceLastOperation(MachineLearningOperationName? operationName = null, DateTimeOffset? operationOn = null, MachineLearningOperationStatus? operationStatus = null, MachineLearningOperationTrigger? operationTrigger = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Api key object for workspace connection credential. + /// A new instance for mocking. + public static ApiKeyAuthWorkspaceConnectionProperties ApiKeyAuthWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsKey = null) { - return new MachineLearningComputeInstanceLastOperation(operationName, operationOn, operationStatus, operationTrigger, serializedAdditionalRawData: null); + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new ApiKeyAuthWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.ApiKey, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKey != null ? new WorkspaceConnectionApiKey(credentialsKey, serializedAdditionalRawData: null) : null); } - /// Initializes a new instance of . - /// A system assigned id for the schedule. - /// The current deployment state of schedule. - /// Is the schedule enabled or disabled?. - /// [Required] The compute power action. - /// [Required] The schedule trigger type. - /// Required if triggerType is Recurrence. - /// Required if triggerType is Cron. - /// [Deprecated] Not used any more. - /// A new instance for mocking. - public static MachineLearningComputeStartStopSchedule MachineLearningComputeStartStopSchedule(string id = null, MachineLearningComputeProvisioningStatus? provisioningStatus = null, MachineLearningScheduleStatus? status = null, MachineLearningComputePowerAction? action = null, MachineLearningTriggerType? triggerType = null, ComputeStartStopRecurrenceSchedule recurrenceSchedule = null, ComputeStartStopCronSchedule cronSchedule = null, MachineLearningScheduleBase schedule = null) + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + /// A new instance for mocking. + public static ContentSafetyEndpointDeploymentResourceProperties ContentSafetyEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, EndpointDeploymentModel model = null, string raiPolicyName = null, DeploymentModelVersionUpgradeOption? versionUpgradeOption = null) { - return new MachineLearningComputeStartStopSchedule( - id, - provisioningStatus, - status, - action, - triggerType, - recurrenceSchedule, - cronSchedule, - schedule, + return new ContentSafetyEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "Azure.ContentSafety", + serializedAdditionalRawData: null, + model, + raiPolicyName, + versionUpgradeOption); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static ContentSafetyEndpointResourceProperties ContentSafetyEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new ContentSafetyEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.AzureContentSafety, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Name of the ComputeInstance container. - /// Auto save settings. - /// Information of GPU. - /// network of this container. - /// Environment information of this container. - /// services of this containers. - /// A new instance for mocking. - public static MachineLearningComputeInstanceContainer MachineLearningComputeInstanceContainer(string name = null, MachineLearningComputeInstanceAutosave? autosave = null, string gpu = null, MachineLearningNetwork? network = null, MachineLearningComputeInstanceEnvironmentInfo environment = null, IEnumerable services = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Custom Keys credential object. + /// A new instance for mocking. + public static CustomKeysWorkspaceConnectionProperties CustomKeysWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, IDictionary credentialsKeys = null) { - services ??= new List(); + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + credentialsKeys ??= new Dictionary(); - return new MachineLearningComputeInstanceContainer( - name, - autosave, - gpu, - network, - environment, - services?.ToList(), - serializedAdditionalRawData: null); + return new CustomKeysWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.CustomKeys, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentialsKeys != null ? new CustomKeys(credentialsKeys, serializedAdditionalRawData: null) : null); } - /// Initializes a new instance of . - /// name of environment. - /// version of environment. - /// A new instance for mocking. - public static MachineLearningComputeInstanceEnvironmentInfo MachineLearningComputeInstanceEnvironmentInfo(string name = null, string version = null) + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// + /// A new instance for mocking. + public static FqdnOutboundRule FqdnOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, string destination = null) { - return new MachineLearningComputeInstanceEnvironmentInfo(name, version, serializedAdditionalRawData: null); + parentRuleNames ??= new List(); + + return new FqdnOutboundRule( + category, + parentRuleNames?.ToList(), + status, + OutboundRuleType.Fqdn, + serializedAdditionalRawData: null, + destination); } - /// Initializes a new instance of . - /// Caching type of Data Disk. - /// The initial disk size in gigabytes. - /// The lun is used to uniquely identify each data disk. If attaching multiple disks, each should have a distinct lun. - /// type of this storage account. - /// A new instance for mocking. - public static MachineLearningComputeInstanceDataDisk MachineLearningComputeInstanceDataDisk(MachineLearningCachingType? caching = null, int? diskSizeGB = null, int? lun = null, MachineLearningStorageAccountType? storageAccountType = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningManagedIdentityAuthTypeWorkspaceConnection MachineLearningManagedIdentityAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, MachineLearningWorkspaceConnectionManagedIdentity credentials = null) { - return new MachineLearningComputeInstanceDataDisk(caching, diskSizeGB, lun, storageAccountType, serializedAdditionalRawData: null); - } + metadata ??= new Dictionary(); + sharedUserList ??= new List(); - /// Initializes a new instance of . - /// Source of the ComputeInstance data mount. - /// Data source type. - /// name of the ComputeInstance data mount. - /// Mount Action. - /// who this data mount created by. - /// Path of this data mount. - /// Mount state. - /// The time when the disk mounted. - /// Error of this data mount. - /// A new instance for mocking. - public static MachineLearningComputeInstanceDataMount MachineLearningComputeInstanceDataMount(string source = null, MachineLearningSourceType? sourceType = null, string mountName = null, MachineLearningMountAction? mountAction = null, string createdBy = null, string mountPath = null, MachineLearningMountState? mountState = null, DateTimeOffset? mountedOn = null, string error = null) - { - return new MachineLearningComputeInstanceDataMount( - source, - sourceType, - mountName, - mountAction, - createdBy, - mountPath, - mountState, - mountedOn, + return new MachineLearningManagedIdentityAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.ManagedIdentity, + category, + createdByWorkspaceArmId, error, - serializedAdditionalRawData: null); + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); } - /// Initializes a new instance of . - /// Location for the underlying compute. - /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. - /// The description of the Machine Learning compute. - /// The time at which the compute was created. - /// The time at which the compute was last modified. - /// ARM resource id of the underlying compute. - /// Errors during provisioning. - /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. - /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - /// Properties of ComputeInstance. - /// A new instance for mocking. - public static MachineLearningComputeInstance MachineLearningComputeInstance(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningComputeInstanceProperties properties = null) + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Enum to determine endpoint compute type. + /// + /// A new instance for mocking. + public static ManagedOnlineEndpointDeploymentResourceProperties ManagedOnlineEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, MachineLearningEndpointComputeType? endpointComputeType = null, string model = null) { - provisioningErrors ??= new List(); + return new ManagedOnlineEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "managedOnlineEndpoint", + serializedAdditionalRawData: null, + endpointComputeType, + model); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Enum to determine endpoint authentication mode. + /// + /// + /// Dictionary of <integer>. + /// + /// Dictionary of <integer>. + /// A new instance for mocking. + public static ManagedOnlineEndpointResourceProperties ManagedOnlineEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null, MachineLearningEndpointAuthMode? authMode = null, string compute = null, string description = null, IDictionary mirrorTraffic = null, Uri scoringUri = null, IDictionary traffic = null) + { + deployments ??= new List(); + mirrorTraffic ??= new Dictionary(); + traffic ??= new Dictionary(); - return new MachineLearningComputeInstance( - ComputeType.ComputeInstance, - computeLocation, + return new ManagedOnlineEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.ManagedOnlineEndpoint, + endpointUri, + failureReason, + location, + name, provisioningState, - description, - createdOn, - modifiedOn, - resourceId, - provisioningErrors?.ToList(), - isAttachedCompute, - disableLocalAuth, + shouldCreateAiServicesEndpoint, serializedAdditionalRawData: null, - properties); + authMode, + compute, + description, + mirrorTraffic, + scoringUri, + traffic); } - /// Initializes a new instance of . - /// Location for the underlying compute. - /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. - /// The description of the Machine Learning compute. - /// The time at which the compute was created. - /// The time at which the compute was last modified. - /// ARM resource id of the underlying compute. - /// Errors during provisioning. - /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. - /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - /// - /// A new instance for mocking. - public static MachineLearningVirtualMachineCompute MachineLearningVirtualMachineCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningVirtualMachineProperties properties = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningNoneAuthTypeWorkspaceConnection MachineLearningNoneAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null) { - provisioningErrors ??= new List(); + metadata ??= new Dictionary(); + sharedUserList ??= new List(); - return new MachineLearningVirtualMachineCompute( - ComputeType.VirtualMachine, - computeLocation, - provisioningState, - description, - createdOn, - modifiedOn, - resourceId, - provisioningErrors?.ToList(), - isAttachedCompute, - disableLocalAuth, - serializedAdditionalRawData: null, - properties); + return new MachineLearningNoneAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.None, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Location for the underlying compute. - /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. - /// The description of the Machine Learning compute. - /// The time at which the compute was created. - /// The time at which the compute was last modified. - /// ARM resource id of the underlying compute. - /// Errors during provisioning. - /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. - /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - /// HDInsight compute properties. - /// A new instance for mocking. - public static MachineLearningHDInsightCompute MachineLearningHDInsightCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningHDInsightProperties properties = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// ClientId and ClientSecret are required. Other properties are optional + /// depending on each OAuth2 provider's implementation. + /// + /// A new instance for mocking. + public static OAuth2AuthTypeWorkspaceConnectionProperties OAuth2AuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, WorkspaceConnectionOAuth2 credentials = null) { - provisioningErrors ??= new List(); + metadata ??= new Dictionary(); + sharedUserList ??= new List(); - return new MachineLearningHDInsightCompute( - ComputeType.HDInsight, - computeLocation, - provisioningState, - description, - createdOn, - modifiedOn, - resourceId, - provisioningErrors?.ToList(), - isAttachedCompute, - disableLocalAuth, + return new OAuth2AuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.OAuth2, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, serializedAdditionalRawData: null, - properties); + credentials); } - /// Initializes a new instance of . - /// Location for the underlying compute. - /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. - /// The description of the Machine Learning compute. - /// The time at which the compute was created. - /// The time at which the compute was last modified. - /// ARM resource id of the underlying compute. - /// Errors during provisioning. - /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. - /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - /// A new instance for mocking. - public static MachineLearningDataFactoryCompute MachineLearningDataFactoryCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null) + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + /// A new instance for mocking. + public static OpenAIEndpointDeploymentResourceProperties OpenAIEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, EndpointDeploymentModel model = null, string raiPolicyName = null, DeploymentModelVersionUpgradeOption? versionUpgradeOption = null) { - provisioningErrors ??= new List(); - - return new MachineLearningDataFactoryCompute( - ComputeType.DataFactory, - computeLocation, + return new OpenAIEndpointDeploymentResourceProperties( + failureReason, provisioningState, - description, - createdOn, - modifiedOn, - resourceId, - provisioningErrors?.ToList(), - isAttachedCompute, - disableLocalAuth, + "Azure.OpenAI", + serializedAdditionalRawData: null, + model, + raiPolicyName, + versionUpgradeOption); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static OpenAIEndpointResourceProperties OpenAIEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new OpenAIEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.AzureOpenAI, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Location for the underlying compute. - /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. - /// The description of the Machine Learning compute. - /// The time at which the compute was created. - /// The time at which the compute was last modified. - /// ARM resource id of the underlying compute. - /// Errors during provisioning. - /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. - /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - /// Properties of Databricks. - /// A new instance for mocking. - public static MachineLearningDatabricksCompute MachineLearningDatabricksCompute(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningDatabricksProperties properties = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningPatAuthTypeWorkspaceConnection MachineLearningPatAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsPat = null) { - provisioningErrors ??= new List(); + metadata ??= new Dictionary(); + sharedUserList ??= new List(); - return new MachineLearningDatabricksCompute( - ComputeType.Databricks, - computeLocation, - provisioningState, - description, - createdOn, - modifiedOn, - resourceId, - provisioningErrors?.ToList(), - isAttachedCompute, - disableLocalAuth, + return new MachineLearningPatAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.Pat, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, serializedAdditionalRawData: null, - properties); + credentialsPat != null ? new WorkspaceConnectionPersonalAccessToken(credentialsPat, serializedAdditionalRawData: null) : null); } - /// Initializes a new instance of . - /// Location for the underlying compute. - /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. - /// The description of the Machine Learning compute. - /// The time at which the compute was created. - /// The time at which the compute was last modified. - /// ARM resource id of the underlying compute. - /// Errors during provisioning. - /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. - /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - /// - /// A new instance for mocking. - public static MachineLearningDataLakeAnalytics MachineLearningDataLakeAnalytics(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, string dataLakeStoreAccountName = null) + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. + /// + /// A new instance for mocking. + public static PrivateEndpointOutboundRule PrivateEndpointOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, PrivateEndpointDestination destination = null, IEnumerable fqdns = null) { - provisioningErrors ??= new List(); + parentRuleNames ??= new List(); + fqdns ??= new List(); - return new MachineLearningDataLakeAnalytics( - ComputeType.DataLakeAnalytics, - computeLocation, - provisioningState, - description, - createdOn, - modifiedOn, - resourceId, - provisioningErrors?.ToList(), - isAttachedCompute, - disableLocalAuth, + return new PrivateEndpointOutboundRule( + category, + parentRuleNames?.ToList(), + status, + OutboundRuleType.PrivateEndpoint, serializedAdditionalRawData: null, - dataLakeStoreAccountName != null ? new MachineLearningDataLakeAnalyticsProperties(dataLakeStoreAccountName, serializedAdditionalRawData: null) : null); + destination, + fqdns?.ToList()); } - /// Initializes a new instance of . - /// Location for the underlying compute. - /// The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. - /// The description of the Machine Learning compute. - /// The time at which the compute was created. - /// The time at which the compute was last modified. - /// ARM resource id of the underlying compute. - /// Errors during provisioning. - /// Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. - /// Opt-out of local authentication and ensure customers can use only MSI and AAD exclusively for authentication. - /// - /// A new instance for mocking. - public static MachineLearningSynapseSpark MachineLearningSynapseSpark(string computeLocation = null, MachineLearningProvisioningState? provisioningState = null, string description = null, DateTimeOffset? createdOn = null, DateTimeOffset? modifiedOn = null, ResourceIdentifier resourceId = null, IEnumerable provisioningErrors = null, bool? isAttachedCompute = null, bool? disableLocalAuth = null, MachineLearningSynapseSparkProperties properties = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningSasAuthTypeWorkspaceConnection MachineLearningSasAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, string credentialsSas = null) { - provisioningErrors ??= new List(); + metadata ??= new Dictionary(); + sharedUserList ??= new List(); - return new MachineLearningSynapseSpark( - ComputeType.SynapseSpark, - computeLocation, - provisioningState, - description, - createdOn, - modifiedOn, - resourceId, - provisioningErrors?.ToList(), - isAttachedCompute, - disableLocalAuth, + return new MachineLearningSasAuthTypeWorkspaceConnection( + MachineLearningConnectionAuthType.Sas, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, serializedAdditionalRawData: null, - properties); + credentialsSas != null ? new WorkspaceConnectionSharedAccessSignature(credentialsSas, serializedAdditionalRawData: null) : null); } - /// Initializes a new instance of . - /// Content of kubeconfig file that can be used to connect to the Kubernetes cluster. - /// Content of kubeconfig file that can be used to connect to the Kubernetes cluster. - /// Image registry pull secret. - /// A new instance for mocking. - public static MachineLearningAksComputeSecrets MachineLearningAksComputeSecrets(string userKubeConfig = null, string adminKubeConfig = null, string imagePullSecretName = null) - { - return new MachineLearningAksComputeSecrets(ComputeType.Aks, serializedAdditionalRawData: null, userKubeConfig, adminKubeConfig, imagePullSecretName); + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// + /// + /// + /// State of the Serverless Endpoint. + /// + /// + /// Anything. + /// + /// + /// A new instance for mocking. + public static ServerlessEndpointResourceProperties ServerlessEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null, ServerlessInferenceEndpointAuthMode? authMode = null, ServerlessEndpointCapacityReservation capacityReservation = null, ContentSafetyStatus? contentSafetyStatus = null, ServerlessEndpointState? endpointState = null, ServerlessEndpointInferenceEndpoint inferenceEndpoint = null, string marketplaceSubscriptionId = null, BinaryData metadata = null, string modelId = null, ServerlessOffer offer = null) + { + deployments ??= new List(); + + return new ServerlessEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.ServerlessEndpoint, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null, + authMode, + capacityReservation, + contentSafetyStatus.HasValue ? new ServerlessEndpointContentSafety(contentSafetyStatus.Value, serializedAdditionalRawData: null) : null, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + metadata, + modelId != null ? new ServerlessEndpointModelSettings(modelId, serializedAdditionalRawData: null) : null, + offer); } - /// Initializes a new instance of . - /// Admin credentials for virtual machine. - /// A new instance for mocking. - public static MachineLearningVirtualMachineSecrets MachineLearningVirtualMachineSecrets(MachineLearningVmSshCredentials administratorAccount = null) + /// Initializes a new instance of . + /// Dictionary of <string>. + /// + /// A new instance for mocking. + public static ServerlessEndpointInferenceEndpoint ServerlessEndpointInferenceEndpoint(IReadOnlyDictionary headers = null, Uri uri = null) { - return new MachineLearningVirtualMachineSecrets(ComputeType.VirtualMachine, serializedAdditionalRawData: null, administratorAccount); + headers ??= new Dictionary(); + + return new ServerlessEndpointInferenceEndpoint(headers, uri, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// access token for databricks account. - /// A new instance for mocking. - public static MachineLearningDatabricksComputeSecrets MachineLearningDatabricksComputeSecrets(string databricksAccessToken = null) + /// Initializes a new instance of . + /// Category of the connection. + /// + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static ServicePrincipalAuthTypeWorkspaceConnectionProperties ServicePrincipalAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, WorkspaceConnectionServicePrincipal credentials = null) { - return new MachineLearningDatabricksComputeSecrets(ComputeType.Databricks, serializedAdditionalRawData: null, databricksAccessToken); + metadata ??= new Dictionary(); + sharedUserList ??= new List(); + + return new ServicePrincipalAuthTypeWorkspaceConnectionProperties( + MachineLearningConnectionAuthType.ServicePrincipal, + category, + createdByWorkspaceArmId, + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Initializes a new instance of . /// The action enum for networking rule. /// Optional, if provided, the ServiceTag property will be ignored. @@ -2790,6 +6413,7 @@ public static ServiceTagDestination ServiceTagDestination(NetworkingRuleAction? serializedAdditionalRawData: null); } +<<<<<<< HEAD /// Initializes a new instance of . /// Category of the connection. /// @@ -2856,11 +6480,82 @@ public static MachineLearningSasAuthTypeWorkspaceConnection MachineLearningSasAu valueFormat, serializedAdditionalRawData: null, credentialsSas != null ? new WorkspaceConnectionSharedAccessSignature(credentialsSas, serializedAdditionalRawData: null) : null); +======= + /// Initializes a new instance of . + /// Category of a managed network Outbound Rule of a machine learning workspace. + /// + /// Type of a managed network Outbound Rule of a machine learning workspace. + /// Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. + /// A new instance for mocking. + public static ServiceTagOutboundRule ServiceTagOutboundRule(OutboundRuleCategory? category = null, IEnumerable parentRuleNames = null, OutboundRuleStatus? status = null, ServiceTagDestination destination = null) + { + parentRuleNames ??= new List(); + + return new ServiceTagOutboundRule( + category, + parentRuleNames?.ToList(), + status, + OutboundRuleType.ServiceTag, + serializedAdditionalRawData: null, + destination); + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + /// A new instance for mocking. + public static SpeechEndpointDeploymentResourceProperties SpeechEndpointDeploymentResourceProperties(string failureReason = null, DefaultResourceProvisioningState? provisioningState = null, EndpointDeploymentModel model = null, string raiPolicyName = null, DeploymentModelVersionUpgradeOption? versionUpgradeOption = null) + { + return new SpeechEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + "Azure.Speech", + serializedAdditionalRawData: null, + model, + raiPolicyName, + versionUpgradeOption); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// A new instance for mocking. + public static SpeechEndpointResourceProperties SpeechEndpointResourceProperties(ResourceIdentifier associatedResourceId = null, IEnumerable deployments = null, Uri endpointUri = null, string failureReason = null, AzureLocation? location = null, string name = null, DefaultResourceProvisioningState? provisioningState = null, bool? shouldCreateAiServicesEndpoint = null) + { + deployments ??= new List(); + + return new SpeechEndpointResourceProperties( + associatedResourceId, + deployments?.ToList(), + EndpointType.AzureSpeech, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData: null); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } /// Initializes a new instance of . /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -2872,6 +6567,21 @@ public static MachineLearningSasAuthTypeWorkspaceConnection MachineLearningSasAu /// /// A new instance for mocking. public static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, string target = null, IDictionary metadata = null, IEnumerable sharedUserList = null, string value = null, MachineLearningValueFormat? valueFormat = null, MachineLearningWorkspaceConnectionUsernamePassword credentials = null) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// + /// A new instance for mocking. + public static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(MachineLearningConnectionCategory? category = null, ResourceIdentifier createdByWorkspaceArmId = null, string error = null, DateTimeOffset? expiryOn = null, ConnectionGroup? group = null, bool? isSharedToAll = null, IDictionary metadata = null, ManagedPERequirement? peRequirement = null, ManagedPEStatus? peStatus = null, IEnumerable sharedUserList = null, string target = null, bool? useWorkspaceManagedIdentity = null, MachineLearningWorkspaceConnectionUsernamePassword credentials = null) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { metadata ??= new Dictionary(); sharedUserList ??= new List(); @@ -2880,6 +6590,7 @@ public static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Machine MachineLearningConnectionAuthType.UsernamePassword, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryOn, group, isSharedToAll, @@ -3987,5 +7698,20 @@ public static TextNer TextNer(MachineLearningLogVerbosity? logVerbosity = null, featurizationDatasetLanguage != null ? new NlpVerticalFeaturizationSettings(featurizationDatasetLanguage, serializedAdditionalRawData: null) : null, validationData); } +======= + error, + expiryOn, + group, + isSharedToAll, + metadata, + peRequirement, + peStatus, + sharedUserList?.ToList(), + target, + useWorkspaceManagedIdentity, + serializedAdditionalRawData: null, + credentials); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.Serialization.cs new file mode 100644 index 000000000000..ad099275825d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class EndpointDeploymentResourcePropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement, options); + } + + internal static EndpointDeploymentResourcePropertiesBasicResourceData DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentResourceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = EndpointDeploymentResourceProperties.DeserializeEndpointDeploymentResourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointDeploymentResourcePropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.cs new file mode 100644 index 000000000000..1860ef8e1a60 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointDeploymentResourcePropertiesBasicResourceData.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the EndpointDeploymentResourcePropertiesBasicResource data model. + public partial class EndpointDeploymentResourcePropertiesBasicResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// is null. + public EndpointDeploymentResourcePropertiesBasicResourceData(EndpointDeploymentResourceProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentResourcePropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EndpointDeploymentResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EndpointDeploymentResourcePropertiesBasicResourceData() + { + } + + /// + /// Gets or sets the properties + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public EndpointDeploymentResourceProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.Serialization.cs new file mode 100644 index 000000000000..5b6d65792001 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class EndpointResourcePropertiesBasicResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EndpointResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EndpointResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.cs new file mode 100644 index 000000000000..8fb6c0371ce2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResource.cs @@ -0,0 +1,623 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing an EndpointResourcePropertiesBasicResource along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetEndpointResourcePropertiesBasicResource method. + /// Otherwise you can get one from its parent resource using the GetEndpointResourcePropertiesBasicResource method. + /// + public partial class EndpointResourcePropertiesBasicResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The endpointName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics; + private readonly EndpointRestOperations _endpointResourcePropertiesBasicResourceEndpointRestClient; + private readonly EndpointResourcePropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/endpoints"; + + /// Initializes a new instance of the class for mocking. + protected EndpointResourcePropertiesBasicResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal EndpointResourcePropertiesBasicResource(ArmClient client, EndpointResourcePropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal EndpointResourcePropertiesBasicResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string endpointResourcePropertiesBasicResourceEndpointApiVersion); + _endpointResourcePropertiesBasicResourceEndpointRestClient = new EndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, endpointResourcePropertiesBasicResourceEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual EndpointResourcePropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of WorkspaceEndpointDeploymentResources in the EndpointResourcePropertiesBasicResource. + /// An object representing collection of WorkspaceEndpointDeploymentResources and their operations over a WorkspaceEndpointDeploymentResource. + public virtual WorkspaceEndpointDeploymentCollection GetWorkspaceEndpointDeployments() + { + return GetCachedClient(client => new WorkspaceEndpointDeploymentCollection(client, Id)); + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceEndpointDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceEndpointDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceEndpointDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetWorkspaceEndpointDeployments().Get(deploymentName, cancellationToken); + } + + /// Gets a collection of WorkspaceEndpointRaiPolicyResources in the EndpointResourcePropertiesBasicResource. + /// An object representing collection of WorkspaceEndpointRaiPolicyResources and their operations over a WorkspaceEndpointRaiPolicyResource. + public virtual WorkspaceEndpointRaiPolicyCollection GetWorkspaceEndpointRaiPolicies() + { + return GetCachedClient(client => new WorkspaceEndpointRaiPolicyCollection(client, Id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceEndpointRaiPolicyAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceEndpointRaiPolicies().GetAsync(raiPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceEndpointRaiPolicy(string raiPolicyName, CancellationToken cancellationToken = default) + { + return GetWorkspaceEndpointRaiPolicies().Get(raiPolicyName, cancellationToken); + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Endpoint resource object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Endpoint resource object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List keys for the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys + /// + /// + /// Operation Id + /// Endpoint_ListKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetKeysAsync(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.GetKeys"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.ListKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List keys for the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/listKeys + /// + /// + /// Operation Id + /// Endpoint_ListKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetKeys(CancellationToken cancellationToken = default) + { + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.GetKeys"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.ListKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get available models under the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models + /// + /// + /// Operation Id + /// Endpoint_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetModelsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResource.GetModels", "value", "nextLink", cancellationToken); + } + + /// + /// Get available models under the endpoint resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/models + /// + /// + /// Operation Id + /// Endpoint_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetModels(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResource.GetModels", "value", "nextLink", cancellationToken); + } + + /// + /// Regenerate account keys + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey + /// + /// + /// Operation Id + /// Endpoint_RegenerateKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> RegenerateKeysAsync(RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.RegenerateKeys"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.RegenerateKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Regenerate account keys + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/regenerateKey + /// + /// + /// Operation Id + /// Endpoint_RegenerateKeys + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual Response RegenerateKeys(RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResource.RegenerateKeys"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.RegenerateKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceCollection.cs new file mode 100644 index 000000000000..246888d98fca --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceCollection.cs @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetEndpointResourcePropertiesBasicResources method from an instance of . + /// + public partial class EndpointResourcePropertiesBasicResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics; + private readonly EndpointRestOperations _endpointResourcePropertiesBasicResourceEndpointRestClient; + + /// Initializes a new instance of the class for mocking. + protected EndpointResourcePropertiesBasicResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal EndpointResourcePropertiesBasicResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", EndpointResourcePropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EndpointResourcePropertiesBasicResource.ResourceType, out string endpointResourcePropertiesBasicResourceEndpointApiVersion); + _endpointResourcePropertiesBasicResourceEndpointRestClient = new EndpointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, endpointResourcePropertiesBasicResourceEndpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceResource.ResourceType), nameof(id)); + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new EndpointResourcePropertiesBasicResourceOperationSource(Client), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List All the endpoints under this workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints + /// + /// + /// Operation Id + /// Endpoint_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EndpointResourcePropertiesBasicResource(Client, EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(e)), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List All the endpoints under this workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints + /// + /// + /// Operation Id + /// Endpoint_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointResourcePropertiesBasicResourceEndpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, includeInferenceEndpoints, skip, expand); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EndpointResourcePropertiesBasicResource(Client, EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(e)), _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics, Pipeline, "EndpointResourcePropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _endpointResourcePropertiesBasicResourceEndpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointResourcePropertiesBasicResourceEndpointClientDiagnostics.CreateScope("EndpointResourcePropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _endpointResourcePropertiesBasicResourceEndpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EndpointResourcePropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.Serialization.cs new file mode 100644 index 000000000000..37c675081d5d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class EndpointResourcePropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement, options); + } + + internal static EndpointResourcePropertiesBasicResourceData DeserializeEndpointResourcePropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointResourceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = EndpointResourceProperties.DeserializeEndpointResourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointResourcePropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.cs new file mode 100644 index 000000000000..1a2f0a42b734 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/EndpointResourcePropertiesBasicResourceData.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the EndpointResourcePropertiesBasicResource data model. + public partial class EndpointResourcePropertiesBasicResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// is null. + public EndpointResourcePropertiesBasicResourceData(EndpointResourceProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Keeps track of any properties unknown to the library. + internal EndpointResourcePropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EndpointResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EndpointResourcePropertiesBasicResourceData() + { + } + + /// + /// Gets or sets the properties + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public EndpointResourceProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs index 29db59b6ddfc..84f4d844358d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MachineLearningExtensions.cs @@ -432,6 +432,25 @@ public static MachineLearningEnvironmentVersionResource GetMachineLearningEnviro return GetMockableMachineLearningArmClient(client).GetMachineLearningEnvironmentVersionResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetMarketplaceSubscriptionResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -680,6 +699,7 @@ public static MachineLearningJobResource GetMachineLearningJobResource(this ArmC } /// +<<<<<<< HEAD /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. /// @@ -699,6 +719,8 @@ public static MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource } /// +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. /// @@ -794,6 +816,311 @@ public static MachineLearningRegistryResource GetMachineLearningRegistryResource } /// +<<<<<<< HEAD +======= + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MachineLearningWorkspaceResource GetMachineLearningWorkspaceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetMachineLearningWorkspaceResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MachineLearningWorkspaceConnectionResource GetMachineLearningWorkspaceConnectionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetMachineLearningWorkspaceConnectionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceConnectionDeploymentResource GetWorkspaceConnectionDeploymentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceConnectionDeploymentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceEndpointDeploymentResource GetWorkspaceEndpointDeploymentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceEndpointDeploymentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static RaiBlocklistPropertiesBasicResource GetRaiBlocklistPropertiesBasicResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetRaiBlocklistPropertiesBasicResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static RaiBlocklistItemPropertiesBasicResource GetRaiBlocklistItemPropertiesBasicResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetRaiBlocklistItemPropertiesBasicResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceConnectionRaiPolicyResource GetWorkspaceConnectionRaiPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceConnectionRaiPolicyResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static WorkspaceEndpointRaiPolicyResource GetWorkspaceEndpointRaiPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetWorkspaceEndpointRaiPolicyResource(id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static EndpointResourcePropertiesBasicResource GetEndpointResourcePropertiesBasicResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetEndpointResourcePropertiesBasicResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MachineLearningOutboundRuleBasicResource GetMachineLearningOutboundRuleBasicResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetMachineLearningOutboundRuleBasicResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static MachineLearningPrivateEndpointConnectionResource GetMachineLearningPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMachineLearningArmClient(client).GetMachineLearningPrivateEndpointConnectionResource(id); + } + + /// + /// Gets a collection of MachineLearningRegistryResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of MachineLearningRegistryResources and their operations over a MachineLearningRegistryResource. + public static MachineLearningRegistryCollection GetMachineLearningRegistries(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMachineLearningResourceGroupResource(resourceGroupResource).GetMachineLearningRegistries(); + } + + /// + /// Get registry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName} + /// + /// + /// Operation Id + /// Registries_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of Azure Machine Learning registry. This is case-insensitive. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetMachineLearningRegistryAsync(this ResourceGroupResource resourceGroupResource, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableMachineLearningResourceGroupResource(resourceGroupResource).GetMachineLearningRegistryAsync(registryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get registry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName} + /// + /// + /// Operation Id + /// Registries_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of Azure Machine Learning registry. This is case-insensitive. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetMachineLearningRegistry(this ResourceGroupResource resourceGroupResource, string registryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMachineLearningResourceGroupResource(resourceGroupResource).GetMachineLearningRegistry(registryName, cancellationToken); + } + + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Gets a collection of MachineLearningWorkspaceResources in the ResourceGroupResource. /// /// Mocking @@ -823,7 +1150,11 @@ public static MachineLearningWorkspaceCollection GetMachineLearningWorkspaces(th /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -836,7 +1167,7 @@ public static MachineLearningWorkspaceCollection GetMachineLearningWorkspaces(th /// /// /// The instance the method will execute against. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -861,7 +1192,11 @@ public static async Task> GetMachineL /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -874,7 +1209,7 @@ public static async Task> GetMachineL /// /// /// The instance the method will execute against. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -992,7 +1327,11 @@ public static Response GetMachineLearningRegist /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -1025,7 +1364,11 @@ public static AsyncPageable GetMachineLearningUsagesAsync( /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -1058,7 +1401,11 @@ public static Pageable GetMachineLearningUsages(this Subsc /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -1091,7 +1438,11 @@ public static AsyncPageable GetMachineLearningVmSizesAsyn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -1124,7 +1475,11 @@ public static Pageable GetMachineLearningVmSizes(this Sub /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -1158,7 +1513,11 @@ public static AsyncPageable UpdateMachineLe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -1192,7 +1551,11 @@ public static Pageable UpdateMachineLearnin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -1225,7 +1588,11 @@ public static AsyncPageable GetMachineLearningQuot /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -1258,7 +1625,11 @@ public static Pageable GetMachineLearningQuotas(th /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -1294,7 +1665,11 @@ public static AsyncPageable GetMachineLearningR /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -1316,5 +1691,86 @@ public static Pageable GetMachineLearningRegist return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningRegistries(cancellationToken); } +<<<<<<< HEAD +======= + + /// + /// Lists all the available machine learning workspaces under the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces + /// + /// + /// Operation Id + /// Workspaces_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetMachineLearningWorkspacesAsync(this SubscriptionResource subscriptionResource, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningWorkspacesAsync(kind, skip, aiCapabilities, cancellationToken); + } + + /// + /// Lists all the available machine learning workspaces under the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces + /// + /// + /// Operation Id + /// Workspaces_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetMachineLearningWorkspaces(this SubscriptionResource subscriptionResource, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableMachineLearningSubscriptionResource(subscriptionResource).GetMachineLearningWorkspaces(kind, skip, aiCapabilities, cancellationToken); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs index 64009e42bc59..5aa639f0d0e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningArmClient.cs @@ -286,6 +286,18 @@ public virtual MachineLearningEnvironmentVersionResource GetMachineLearningEnvir return new MachineLearningEnvironmentVersionResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MarketplaceSubscriptionResource GetMarketplaceSubscriptionResource(ResourceIdentifier id) + { + MarketplaceSubscriptionResource.ValidateResourceId(id); + return new MarketplaceSubscriptionResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -443,6 +455,7 @@ public virtual MachineLearningJobResource GetMachineLearningJobResource(Resource } /// +<<<<<<< HEAD /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. /// @@ -455,6 +468,8 @@ public virtual MarketplaceSubscriptionResource GetMarketplaceSubscriptionResourc } /// +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. /// @@ -513,5 +528,140 @@ public virtual MachineLearningRegistryResource GetMachineLearningRegistryResourc MachineLearningRegistryResource.ValidateResourceId(id); return new MachineLearningRegistryResource(Client, id); } +<<<<<<< HEAD +======= + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MachineLearningWorkspaceResource GetMachineLearningWorkspaceResource(ResourceIdentifier id) + { + MachineLearningWorkspaceResource.ValidateResourceId(id); + return new MachineLearningWorkspaceResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MachineLearningWorkspaceConnectionResource GetMachineLearningWorkspaceConnectionResource(ResourceIdentifier id) + { + MachineLearningWorkspaceConnectionResource.ValidateResourceId(id); + return new MachineLearningWorkspaceConnectionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceConnectionDeploymentResource GetWorkspaceConnectionDeploymentResource(ResourceIdentifier id) + { + WorkspaceConnectionDeploymentResource.ValidateResourceId(id); + return new WorkspaceConnectionDeploymentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceEndpointDeploymentResource GetWorkspaceEndpointDeploymentResource(ResourceIdentifier id) + { + WorkspaceEndpointDeploymentResource.ValidateResourceId(id); + return new WorkspaceEndpointDeploymentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RaiBlocklistPropertiesBasicResource GetRaiBlocklistPropertiesBasicResource(ResourceIdentifier id) + { + RaiBlocklistPropertiesBasicResource.ValidateResourceId(id); + return new RaiBlocklistPropertiesBasicResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual RaiBlocklistItemPropertiesBasicResource GetRaiBlocklistItemPropertiesBasicResource(ResourceIdentifier id) + { + RaiBlocklistItemPropertiesBasicResource.ValidateResourceId(id); + return new RaiBlocklistItemPropertiesBasicResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceConnectionRaiPolicyResource GetWorkspaceConnectionRaiPolicyResource(ResourceIdentifier id) + { + WorkspaceConnectionRaiPolicyResource.ValidateResourceId(id); + return new WorkspaceConnectionRaiPolicyResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual WorkspaceEndpointRaiPolicyResource GetWorkspaceEndpointRaiPolicyResource(ResourceIdentifier id) + { + WorkspaceEndpointRaiPolicyResource.ValidateResourceId(id); + return new WorkspaceEndpointRaiPolicyResource(Client, id); + } + + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual EndpointResourcePropertiesBasicResource GetEndpointResourcePropertiesBasicResource(ResourceIdentifier id) + { + EndpointResourcePropertiesBasicResource.ValidateResourceId(id); + return new EndpointResourcePropertiesBasicResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MachineLearningOutboundRuleBasicResource GetMachineLearningOutboundRuleBasicResource(ResourceIdentifier id) + { + MachineLearningOutboundRuleBasicResource.ValidateResourceId(id); + return new MachineLearningOutboundRuleBasicResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual MachineLearningPrivateEndpointConnectionResource GetMachineLearningPrivateEndpointConnectionResource(ResourceIdentifier id) + { + MachineLearningPrivateEndpointConnectionResource.ValidateResourceId(id); + return new MachineLearningPrivateEndpointConnectionResource(Client, id); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs index f76739261ead..7b34238ce9f9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningResourceGroupResource.cs @@ -33,6 +33,78 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } +<<<<<<< HEAD +======= + /// Gets a collection of MachineLearningRegistryResources in the ResourceGroupResource. + /// An object representing collection of MachineLearningRegistryResources and their operations over a MachineLearningRegistryResource. + public virtual MachineLearningRegistryCollection GetMachineLearningRegistries() + { + return GetCachedClient(client => new MachineLearningRegistryCollection(client, Id)); + } + + /// + /// Get registry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName} + /// + /// + /// Operation Id + /// Registries_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Azure Machine Learning registry. This is case-insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningRegistryAsync(string registryName, CancellationToken cancellationToken = default) + { + return await GetMachineLearningRegistries().GetAsync(registryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get registry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/registries/{registryName} + /// + /// + /// Operation Id + /// Registries_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of Azure Machine Learning registry. This is case-insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningRegistry(string registryName, CancellationToken cancellationToken = default) + { + return GetMachineLearningRegistries().Get(registryName, cancellationToken); + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Gets a collection of MachineLearningWorkspaceResources in the ResourceGroupResource. /// An object representing collection of MachineLearningWorkspaceResources and their operations over a MachineLearningWorkspaceResource. public virtual MachineLearningWorkspaceCollection GetMachineLearningWorkspaces() @@ -53,7 +125,11 @@ public virtual MachineLearningWorkspaceCollection GetMachineLearningWorkspaces() /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -61,7 +137,7 @@ public virtual MachineLearningWorkspaceCollection GetMachineLearningWorkspaces() /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -84,7 +160,11 @@ public virtual async Task> GetMachine /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -92,7 +172,7 @@ public virtual async Task> GetMachine /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs index 776af233036b..5a5ec9f75f48 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Extensions/MockableMachineLearningSubscriptionResource.cs @@ -132,7 +132,11 @@ public virtual Pageable GetMachineLearningWork /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -159,7 +163,11 @@ public virtual AsyncPageable GetMachineLearningUsagesAsync /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -186,7 +194,11 @@ public virtual Pageable GetMachineLearningUsages(AzureLoca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -212,7 +224,11 @@ public virtual AsyncPageable GetMachineLearningVmSizesAsy /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -238,7 +254,11 @@ public virtual Pageable GetMachineLearningVmSizes(AzureLo /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -268,7 +288,11 @@ public virtual AsyncPageable UpdateMachineL /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -298,7 +322,11 @@ public virtual Pageable UpdateMachineLearni /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -325,7 +353,11 @@ public virtual AsyncPageable GetMachineLearningQuo /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -352,7 +384,11 @@ public virtual Pageable GetMachineLearningQuotas(A /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -382,7 +418,11 @@ public virtual AsyncPageable GetMachineLearning /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -398,5 +438,74 @@ public virtual Pageable GetMachineLearningRegis HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningRegistryRegistriesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningRegistryResource(Client, MachineLearningRegistryData.DeserializeMachineLearningRegistryData(e)), MachineLearningRegistryRegistriesClientDiagnostics, Pipeline, "MockableMachineLearningSubscriptionResource.GetMachineLearningRegistries", "value", "nextLink", cancellationToken); } +<<<<<<< HEAD +======= + + /// + /// Lists all the available machine learning workspaces under the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces + /// + /// + /// Operation Id + /// Workspaces_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetMachineLearningWorkspacesAsync(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, kind, skip, aiCapabilities); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), MachineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MockableMachineLearningSubscriptionResource.GetMachineLearningWorkspaces", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all the available machine learning workspaces under the specified subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces + /// + /// + /// Operation Id + /// Workspaces_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetMachineLearningWorkspaces(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MachineLearningWorkspaceWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, kind, skip, aiCapabilities); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), MachineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MockableMachineLearningSubscriptionResource.GetMachineLearningWorkspaces", "value", "nextLink", cancellationToken); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/EndpointResourcePropertiesBasicResourceOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/EndpointResourcePropertiesBasicResourceOperationSource.cs new file mode 100644 index 000000000000..4f554006d1f0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/EndpointResourcePropertiesBasicResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class EndpointResourcePropertiesBasicResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal EndpointResourcePropertiesBasicResourceOperationSource(ArmClient client) + { + _client = client; + } + + EndpointResourcePropertiesBasicResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return new EndpointResourcePropertiesBasicResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return new EndpointResourcePropertiesBasicResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/IListOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/IListOperationSource.cs new file mode 100644 index 000000000000..431b3ba29f5c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/IListOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class IListOperationSource : IOperationSource> + { + IList IOperationSource>.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(item)); + } + return array; + } + + async ValueTask> IOperationSource>.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(item)); + } + return array; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistItemPropertiesBasicResourceOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistItemPropertiesBasicResourceOperationSource.cs new file mode 100644 index 000000000000..426c54311b8a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistItemPropertiesBasicResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class RaiBlocklistItemPropertiesBasicResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal RaiBlocklistItemPropertiesBasicResourceOperationSource(ArmClient client) + { + _client = client; + } + + RaiBlocklistItemPropertiesBasicResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistItemPropertiesBasicResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistItemPropertiesBasicResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistPropertiesBasicResourceOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistPropertiesBasicResourceOperationSource.cs new file mode 100644 index 000000000000..793b43a3cc61 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/RaiBlocklistPropertiesBasicResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class RaiBlocklistPropertiesBasicResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal RaiBlocklistPropertiesBasicResourceOperationSource(ArmClient client) + { + _client = client; + } + + RaiBlocklistPropertiesBasicResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistPropertiesBasicResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return new RaiBlocklistPropertiesBasicResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionDeploymentOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionDeploymentOperationSource.cs new file mode 100644 index 000000000000..c5b5ab80b58b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionDeploymentOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceConnectionDeploymentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceConnectionDeploymentOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceConnectionDeploymentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionDeploymentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionDeploymentResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionRaiPolicyOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionRaiPolicyOperationSource.cs new file mode 100644 index 000000000000..73fa1799c27a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceConnectionRaiPolicyOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceConnectionRaiPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceConnectionRaiPolicyOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceConnectionRaiPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionRaiPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceConnectionRaiPolicyResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointDeploymentOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointDeploymentOperationSource.cs new file mode 100644 index 000000000000..e6ea7c9ca04c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointDeploymentOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceEndpointDeploymentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceEndpointDeploymentOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceEndpointDeploymentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointDeploymentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointDeploymentResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointRaiPolicyOperationSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointRaiPolicyOperationSource.cs new file mode 100644 index 000000000000..5a67333ed125 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/LongRunningOperation/WorkspaceEndpointRaiPolicyOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning +{ + internal class WorkspaceEndpointRaiPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal WorkspaceEndpointRaiPolicyOperationSource(ArmClient client) + { + _client = client; + } + + WorkspaceEndpointRaiPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointRaiPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return new WorkspaceEndpointRaiPolicyResource(_client, data); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs index 1e96aec5060a..0cfe482f0133 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation Cr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(st /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -283,7 +303,11 @@ public virtual AsyncPageable G /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -314,7 +338,11 @@ public virtual Pageable GetAll /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -357,7 +385,11 @@ public virtual async Task> ExistsAsync(string componentName, Canc /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -400,7 +432,11 @@ public virtual Response Exists(string componentName, CancellationToken can /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -445,7 +481,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs index 91706d262886..03436cf43730 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearninRegistryComponentVersionCollection GetMachineLearni /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMachi /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get(Ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -292,7 +312,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -334,7 +358,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -380,7 +408,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs index d3358b9ef092..f76a5d85e3eb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation Crea /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(stri /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -285,7 +305,11 @@ public virtual AsyncPageable Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -318,7 +342,11 @@ public virtual Pageable GetAll(s /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -361,7 +389,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -404,7 +436,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -449,7 +485,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs index dd2c03309597..9ee3c5b3e4b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearninRegistryComponentVersionResource.cs @@ -102,7 +102,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -142,7 +146,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -182,7 +190,11 @@ public virtual Response Get(Canc /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -224,7 +236,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -266,7 +282,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -312,7 +332,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs index 6ad356e5523f..f87c015aa35d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task> GetA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(string deplo /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -285,7 +305,11 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -318,7 +342,11 @@ public virtual Pageable GetAll(string or /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -361,7 +389,11 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -404,7 +436,11 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -449,7 +485,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs index b0249edf98d6..c94a99dcbb0b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchDeploymentResource.cs @@ -104,7 +104,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -144,7 +148,11 @@ public virtual async Task> GetA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -184,7 +192,11 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -226,7 +238,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -268,7 +284,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -314,7 +334,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -360,7 +384,11 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -422,7 +450,11 @@ public virtual async Task> AddT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -484,7 +516,11 @@ public virtual Response AddTag(string ke /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -541,7 +577,11 @@ public virtual async Task> SetT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -598,7 +638,11 @@ public virtual Response SetTags(IDiction /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -658,7 +702,11 @@ public virtual async Task> Remo /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs index fe6459c0fea5..15e2dc48e3e9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task> Cr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task> GetAsy /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(string endpoin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -284,7 +304,11 @@ public virtual AsyncPageable GetAllAsync(i /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -316,7 +340,11 @@ public virtual Pageable GetAll(int? count /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -359,7 +387,11 @@ public virtual async Task> ExistsAsync(string endpointName, Cance /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -402,7 +434,11 @@ public virtual Response Exists(string endpointName, CancellationToken canc /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -447,7 +483,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs index 8ab9d09226c0..a9c4d71c0da9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningBatchEndpointResource.cs @@ -110,7 +110,11 @@ public virtual MachineLearningBatchDeploymentCollection GetMachineLearningBatchD /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -141,7 +145,11 @@ public virtual async Task> GetM /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -172,7 +180,11 @@ public virtual Response GetMachineLearni /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> GetAsy /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -294,7 +314,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -336,7 +360,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -382,7 +410,11 @@ public virtual async Task> Up /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -428,7 +460,11 @@ public virtual ArmOperation Update(WaitUnt /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -466,7 +502,11 @@ public virtual async Task> GetKeysAsyn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -504,7 +544,11 @@ public virtual Response GetKeys(CancellationTok /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -566,7 +610,11 @@ public virtual async Task> AddTag /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -628,7 +676,11 @@ public virtual Response AddTag(string key, /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -685,7 +737,11 @@ public virtual async Task> SetTag /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -742,7 +798,11 @@ public virtual Response SetTags(IDictionar /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -802,7 +862,11 @@ public virtual async Task> Remove /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs index 3ad5d799d90a..b56e8e6f2942 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -115,7 +119,11 @@ public virtual async Task> Cr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -166,7 +174,11 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -211,7 +223,11 @@ public virtual async Task> GetAsy /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -256,7 +272,11 @@ public virtual Response Get(string name, C /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -287,7 +307,11 @@ public virtual AsyncPageable GetAllAsync(s /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -318,7 +342,11 @@ public virtual Pageable GetAll(string skip /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -361,7 +389,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -404,7 +436,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -449,7 +485,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs index 1e3a517f9403..7ba48fc9face 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningCodeVersionCollection GetMachineLearningCodeVersio /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task> GetMachi /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMachineLearningCo /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task> GetAsy /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -294,7 +314,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -338,7 +362,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -386,7 +414,11 @@ public virtual async Task> Up /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs index 16c0ac964ae1..ef3af17932bb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -115,7 +119,11 @@ public virtual async Task> Crea /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -166,7 +174,11 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -211,7 +223,11 @@ public virtual async Task> GetAsync /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -256,7 +272,11 @@ public virtual Response Get(string version, /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -291,7 +311,11 @@ public virtual AsyncPageable GetAllAsync(str /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -326,7 +350,11 @@ public virtual Pageable GetAll(string orderB /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -369,7 +397,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -412,7 +444,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -457,7 +493,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs index 542336307492..09440efca0eb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningCodeVersionResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> GetAsync /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -227,7 +239,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -271,7 +287,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +339,11 @@ public virtual async Task> Upda /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -367,7 +391,11 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -413,7 +441,11 @@ public virtual async Task PublishAsync(WaitUntil waitUntil, Destin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -459,7 +491,11 @@ public virtual ArmOperation Publish(WaitUntil waitUntil, DestinationAsset body, /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -501,7 +537,11 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs index 21edafba6f36..eefb992d9d0b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -116,7 +120,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -167,7 +175,11 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> G /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -257,7 +273,11 @@ public virtual Response Get(string na /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -289,7 +309,11 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -321,7 +345,11 @@ public virtual Pageable GetAll(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -364,7 +392,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -407,7 +439,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -452,7 +488,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs index fe6c9b0ee865..d3b16662ffc7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningComponentVersionCollection GetMachineLearningCompo /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task> Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMachineLearn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task> G /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -294,7 +314,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -338,7 +362,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -386,7 +414,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs index 17bcf8195013..a41be29bfd78 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -116,7 +120,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -167,7 +175,11 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -257,7 +273,11 @@ public virtual Response Get(string vers /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -291,7 +311,11 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -325,7 +349,11 @@ public virtual Pageable GetAll(string o /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -368,7 +396,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -411,7 +443,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -456,7 +492,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs index 265073cfdca5..627b41c935b8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComponentVersionResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -227,7 +239,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -271,7 +287,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +339,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -367,7 +391,11 @@ public virtual ArmOperation Update(Wait /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -413,7 +441,11 @@ public virtual async Task PublishAsync(WaitUntil waitUntil, Destin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs index aae52b88343e..cce1883dfe0b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task> CreateOr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation CreateOrUpdate(WaitU /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(string computeName, /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -283,7 +303,11 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -314,7 +338,11 @@ public virtual Pageable GetAll(string skip = nul /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -357,7 +385,11 @@ public virtual async Task> ExistsAsync(string computeName, Cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -400,7 +432,11 @@ public virtual Response Exists(string computeName, CancellationToken cance /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -445,7 +481,11 @@ public virtual async Task> GetI /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs index 93b888efa5a3..41e012cf89c1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningComputeResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual Response Get(CancellationToken ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -226,7 +238,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Machine /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -269,7 +285,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, MachineLearningUnderlyin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -315,7 +335,11 @@ public virtual async Task> UpdateAs /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -349,6 +373,93 @@ public virtual ArmOperation Update(WaitUntil wai } /// +<<<<<<< HEAD +======= + /// Updates the custom services list. The list of custom services provided shall be overwritten + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices + /// + /// + /// Operation Id + /// Compute_UpdateCustomServices + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// New list of Custom Services. + /// The cancellation token to use. + /// is null. + public virtual async Task UpdateCustomServicesAsync(IEnumerable customServices, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(customServices, nameof(customServices)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.UpdateCustomServices"); + scope.Start(); + try + { + var response = await _machineLearningComputeComputeRestClient.UpdateCustomServicesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, customServices, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the custom services list. The list of custom services provided shall be overwritten + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/customServices + /// + /// + /// Operation Id + /// Compute_UpdateCustomServices + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// New list of Custom Services. + /// The cancellation token to use. + /// is null. + public virtual Response UpdateCustomServices(IEnumerable customServices, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(customServices, nameof(customServices)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.UpdateCustomServices"); + scope.Start(); + try + { + var response = _machineLearningComputeComputeRestClient.UpdateCustomServices(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, customServices, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Get the details (e.g IP address, port etc) of all the compute nodes in the compute. /// /// @@ -361,7 +472,11 @@ public virtual ArmOperation Update(WaitUntil wai /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -391,7 +506,11 @@ public virtual AsyncPageable GetNodesAsync(Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -421,7 +540,11 @@ public virtual Pageable GetNodes(CancellationToken ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -459,7 +582,11 @@ public virtual async Task> GetKeysAsync( /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -484,6 +611,90 @@ public virtual Response GetKeys(CancellationToken } } + /// + /// Update Data Mounts of a Machine Learning compute. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts + /// + /// + /// Operation Id + /// Compute_UpdateDataMounts + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// is null. + public virtual async Task UpdateDataMountsAsync(IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.UpdateDataMounts"); + scope.Start(); + try + { + var response = await _machineLearningComputeComputeRestClient.UpdateDataMountsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataMounts, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update Data Mounts of a Machine Learning compute. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateDataMounts + /// + /// + /// Operation Id + /// Compute_UpdateDataMounts + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// is null. + public virtual Response UpdateDataMounts(IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.UpdateDataMounts"); + scope.Start(); + try + { + var response = _machineLearningComputeComputeRestClient.UpdateDataMounts(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, dataMounts, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Posts a start action to a compute instance /// @@ -497,7 +708,11 @@ public virtual Response GetKeys(CancellationToken /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -539,7 +754,11 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -581,7 +800,11 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -623,7 +846,11 @@ public virtual async Task StopAsync(WaitUntil waitUntil, Cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -665,7 +892,11 @@ public virtual ArmOperation Stop(WaitUntil waitUntil, CancellationToken cancella /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -707,7 +938,11 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, Cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -735,5 +970,242 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, CancellationToken cance throw; } } +<<<<<<< HEAD +======= + + /// + /// Updates the idle shutdown setting of a compute instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting + /// + /// + /// Operation Id + /// Compute_UpdateIdleShutdownSetting + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The object for updating idle shutdown setting of specified ComputeInstance. + /// The cancellation token to use. + /// is null. + public virtual async Task UpdateIdleShutdownSettingAsync(IdleShutdownSetting idleShutdownSetting, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(idleShutdownSetting, nameof(idleShutdownSetting)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.UpdateIdleShutdownSetting"); + scope.Start(); + try + { + var response = await _machineLearningComputeComputeRestClient.UpdateIdleShutdownSettingAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, idleShutdownSetting, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the idle shutdown setting of a compute instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/updateIdleShutdownSetting + /// + /// + /// Operation Id + /// Compute_UpdateIdleShutdownSetting + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The object for updating idle shutdown setting of specified ComputeInstance. + /// The cancellation token to use. + /// is null. + public virtual Response UpdateIdleShutdownSetting(IdleShutdownSetting idleShutdownSetting, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(idleShutdownSetting, nameof(idleShutdownSetting)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.UpdateIdleShutdownSetting"); + scope.Start(); + try + { + var response = _machineLearningComputeComputeRestClient.UpdateIdleShutdownSetting(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, idleShutdownSetting, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns supported virtual machine sizes for resize + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize + /// + /// + /// Operation Id + /// Compute_GetAllowedResizeSizes + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllowedResizeSizesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComputeComputeRestClient.CreateGetAllowedResizeSizesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => MachineLearningVmSize.DeserializeMachineLearningVmSize(e), _machineLearningComputeComputeClientDiagnostics, Pipeline, "MachineLearningComputeResource.GetAllowedResizeSizes", "value", null, cancellationToken); + } + + /// + /// Returns supported virtual machine sizes for resize + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/getAllowedVmSizesForResize + /// + /// + /// Operation Id + /// Compute_GetAllowedResizeSizes + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAllowedResizeSizes(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningComputeComputeRestClient.CreateGetAllowedResizeSizesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => MachineLearningVmSize.DeserializeMachineLearningVmSize(e), _machineLearningComputeComputeClientDiagnostics, Pipeline, "MachineLearningComputeResource.GetAllowedResizeSizes", "value", null, cancellationToken); + } + + /// + /// Updates the size of a Compute Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize + /// + /// + /// Operation Id + /// Compute_Resize + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// is null. + public virtual async Task ResizeAsync(WaitUntil waitUntil, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.Resize"); + scope.Start(); + try + { + var response = await _machineLearningComputeComputeRestClient.ResizeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningComputeComputeClientDiagnostics, Pipeline, _machineLearningComputeComputeRestClient.CreateResizeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the size of a Compute Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/resize + /// + /// + /// Operation Id + /// Compute_Resize + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Resize(WaitUntil waitUntil, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var scope = _machineLearningComputeComputeClientDiagnostics.CreateScope("MachineLearningComputeResource.Resize"); + scope.Start(); + try + { + var response = _machineLearningComputeComputeRestClient.Resize(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningComputeComputeClientDiagnostics, Pipeline, _machineLearningComputeComputeRestClient.CreateResizeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, resizeSchema).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs index 8ee198204e1d..191ab41ab051 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -116,7 +120,11 @@ public virtual async Task> Cr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -167,7 +175,11 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> GetAsy /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -257,7 +273,11 @@ public virtual Response Get(string name, C /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -289,7 +309,11 @@ public virtual AsyncPageable GetAllAsync(s /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -321,7 +345,11 @@ public virtual Pageable GetAll(string skip /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -364,7 +392,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -407,7 +439,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -452,7 +488,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs index 2b75cabca3cd..d76e68fcb853 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningDataVersionCollection GetMachineLearningDataVersio /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task> GetMachi /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMachineLearningDa /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task> GetAsy /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -294,7 +314,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -338,7 +362,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -386,7 +414,11 @@ public virtual async Task> Up /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs index b6aebd44e7d2..d7697a5a85e5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -116,7 +120,11 @@ public virtual async Task> Crea /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -167,7 +175,11 @@ public virtual ArmOperation CreateOrUpdate(W /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> GetAsync /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -257,7 +273,11 @@ public virtual Response Get(string version, /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -295,7 +315,11 @@ public virtual AsyncPageable GetAllAsync(str /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -333,7 +357,11 @@ public virtual Pageable GetAll(string orderB /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -376,7 +404,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -419,7 +451,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -464,7 +500,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs index 3d7eb0154506..ee6b25453187 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDataVersionResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> GetAsync /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual Response Get(CancellationToke /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -227,7 +239,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -271,7 +287,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +339,11 @@ public virtual async Task> Upda /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -367,7 +391,11 @@ public virtual ArmOperation Update(WaitUntil /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -413,7 +441,11 @@ public virtual async Task PublishAsync(WaitUntil waitUntil, Destin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs index 7288fc94d07a..7bd0ca9db2e6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -117,7 +121,11 @@ public virtual async Task> Create /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -169,7 +177,11 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -214,7 +226,11 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -259,7 +275,11 @@ public virtual Response Get(string name, Cance /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -292,7 +312,11 @@ public virtual AsyncPageable GetAllAsync(Machi /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -325,7 +349,11 @@ public virtual Pageable GetAll(MachineLearning /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -368,7 +396,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -411,7 +443,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -456,7 +492,11 @@ public virtual async Task> Ge /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs index c53077c276dc..4dc2e2f398cd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningDatastoreResource.cs @@ -102,7 +102,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -142,7 +146,11 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -182,7 +190,11 @@ public virtual Response Get(CancellationToken /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -226,7 +238,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -270,7 +286,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +339,11 @@ public virtual async Task> Update /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -368,7 +392,11 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -376,14 +404,15 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// + /// Secret expiry information. /// The cancellation token to use. - public virtual async Task> GetSecretsAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetSecretsAsync(SecretExpiry body = null, CancellationToken cancellationToken = default) { using var scope = _machineLearningDatastoreDatastoresClientDiagnostics.CreateScope("MachineLearningDatastoreResource.GetSecrets"); scope.Start(); try { - var response = await _machineLearningDatastoreDatastoresRestClient.ListSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _machineLearningDatastoreDatastoresRestClient.ListSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -406,7 +435,11 @@ public virtual async Task> GetSecretsA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -414,14 +447,15 @@ public virtual async Task> GetSecretsA /// /// /// + /// Secret expiry information. /// The cancellation token to use. - public virtual Response GetSecrets(CancellationToken cancellationToken = default) + public virtual Response GetSecrets(SecretExpiry body = null, CancellationToken cancellationToken = default) { using var scope = _machineLearningDatastoreDatastoresClientDiagnostics.CreateScope("MachineLearningDatastoreResource.GetSecrets"); scope.Start(); try { - var response = _machineLearningDatastoreDatastoresRestClient.ListSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _machineLearningDatastoreDatastoresRestClient.ListSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); return response; } catch (Exception e) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs index 41f983e1a1ed..303975d0a7a8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -116,7 +120,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -167,7 +175,11 @@ public virtual ArmOperation CreateO /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -257,7 +273,11 @@ public virtual Response Get(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -289,7 +309,11 @@ public virtual AsyncPageable GetAll /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -321,7 +345,11 @@ public virtual Pageable GetAll(stri /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -364,7 +392,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -407,7 +439,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -452,7 +488,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs index 1ef6797498e5..9493865ee8aa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningEnvironmentVersionCollection GetMachineLearningEnv /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task> G /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMachineLea /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get(Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -294,7 +314,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -338,7 +362,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -386,7 +414,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs index 3a0c40071031..96e3a2884f17 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -116,7 +120,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -167,7 +175,11 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> G /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -257,7 +273,11 @@ public virtual Response Get(string ve /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -291,7 +311,11 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -325,7 +349,11 @@ public virtual Pageable GetAll(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -368,7 +396,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -411,7 +443,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -456,7 +492,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs index ef5f51cae116..61ebbc4bcaed 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningEnvironmentVersionResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> G /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -227,7 +239,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -271,7 +287,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +339,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -367,7 +391,11 @@ public virtual ArmOperation Update(Wa /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -413,7 +441,11 @@ public virtual async Task PublishAsync(WaitUntil waitUntil, Destin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs index 42b79b6d46dd..b0721c08cfb0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -110,7 +114,11 @@ public virtual async Task> GetAsync(str /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -155,7 +163,11 @@ public virtual Response Get(string featureName, /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -188,7 +200,11 @@ public virtual AsyncPageable GetAllAsync(Machine /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -221,7 +237,11 @@ public virtual Pageable GetAll(MachineLearningFe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -264,7 +284,11 @@ public virtual async Task> ExistsAsync(string featureName, Cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -307,7 +331,11 @@ public virtual Response Exists(string featureName, CancellationToken cance /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -352,7 +380,11 @@ public virtual async Task> GetI /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs index 7d44b82c90e4..d401b186fb8a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> GetAsync(Can /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs index 66b7f563cc96..5f2bcdf4a046 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(string n /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -286,7 +306,11 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +343,11 @@ public virtual Pageable GetAll(Machi /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -362,7 +390,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -405,7 +437,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -450,7 +486,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs index a9fbd06533d3..8609f490d89e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningFeatureSetVersionCollection GetMachineLearningFeat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task> Ge /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMachineLear /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get(Cancella /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -292,7 +312,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -334,7 +358,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -380,7 +408,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs index 6a3bfd242556..3fcf3cd59d01 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task> Ge /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(string ver /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -286,7 +306,11 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +343,11 @@ public virtual Pageable GetAll(Machine /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -362,7 +390,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -405,7 +437,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -450,7 +486,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs index ae66134c9d4d..6bf930667a16 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureSetVersionResource.cs @@ -110,7 +110,11 @@ public virtual MachineLearningFeatureCollection GetMachineLearningFeatures() /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -141,7 +145,11 @@ public virtual async Task> GetMachineLe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -172,7 +180,11 @@ public virtual Response GetMachineLearningFeatur /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> Ge /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -294,7 +314,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -336,7 +360,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -382,7 +410,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -428,7 +460,11 @@ public virtual ArmOperation Update(Wai /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -474,7 +510,11 @@ public virtual async Task> Backf /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs index aec3b7249d07..b22044ab08f1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get( /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -286,7 +306,11 @@ public virtual AsyncPageable /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +343,11 @@ public virtual Pageable GetA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -362,7 +390,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -405,7 +437,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -450,7 +486,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs index 2d5836cb3a23..ee86a752295f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeatureStoreEntityContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningFeaturestoreEntityVersionCollection GetMachineLear /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMac /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get( /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -292,7 +312,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -334,7 +358,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -380,7 +408,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs index 8d6b544fe8be..d3c03eccea15 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation Cr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(st /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -286,7 +306,11 @@ public virtual AsyncPageable G /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +343,11 @@ public virtual Pageable GetAll /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -362,7 +390,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -405,7 +437,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -450,7 +486,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs index ee89fee2c524..8758ebd16472 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningFeaturestoreEntityVersionResource.cs @@ -102,7 +102,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -142,7 +146,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -182,7 +190,11 @@ public virtual Response Get(Ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -224,7 +236,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -266,7 +282,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -312,7 +332,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs index 9a61c7cb97af..1f8e99b93bde 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobCollection.cs @@ -66,7 +66,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -118,7 +122,11 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -169,7 +177,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -214,7 +226,11 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -259,7 +275,11 @@ public virtual Response Get(string id, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -294,7 +314,11 @@ public virtual AsyncPageable GetAllAsync(string skip /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -329,7 +353,11 @@ public virtual Pageable GetAll(string skip = null, s /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -372,7 +400,11 @@ public virtual async Task> ExistsAsync(string id, CancellationTok /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -415,7 +447,11 @@ public virtual Response Exists(string id, CancellationToken cancellationTo /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -460,7 +496,11 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs index 2af12cd71102..94b076129e06 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobData.cs @@ -55,7 +55,11 @@ public partial class MachineLearningJobData : ResourceData /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +<<<<<<< HEAD /// The available derived classes include , , , and . +======= + /// The available derived classes include , , , , and . +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// is null. public MachineLearningJobData(MachineLearningJobProperties properties) @@ -73,7 +77,11 @@ public MachineLearningJobData(MachineLearningJobProperties properties) /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +<<<<<<< HEAD /// The available derived classes include , , , and . +======= + /// The available derived classes include , , , , and . +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Keeps track of any properties unknown to the library. internal MachineLearningJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MachineLearningJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) @@ -90,7 +98,11 @@ internal MachineLearningJobData() /// /// [Required] Additional attributes of the entity. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +<<<<<<< HEAD /// The available derived classes include , , , and . +======= + /// The available derived classes include , , , , and . +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// public MachineLearningJobProperties Properties { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs index e4dc248a2920..c8062a032fb3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningJobResource.cs @@ -101,7 +101,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -141,7 +145,11 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -181,7 +189,11 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -223,7 +235,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -265,7 +281,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -307,7 +327,11 @@ public virtual async Task CancelAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs index fdcfdb819237..38422de99132 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -116,7 +120,11 @@ public virtual async Task> C /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -167,7 +175,11 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> GetAs /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -257,7 +273,11 @@ public virtual Response Get(string name, /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -290,7 +310,11 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -323,7 +347,11 @@ public virtual Pageable GetAll(string ski /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -366,7 +394,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -409,7 +441,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -454,7 +490,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs index 6b30019d715d..b29c54b037ac 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningModelVersionCollection GetMachineLearningModelVers /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task> GetMach /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMachineLearningM /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task> GetAs /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -294,7 +314,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -338,7 +362,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -386,7 +414,11 @@ public virtual async Task> U /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs index 936a04139aec..bf003cbac068 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -116,7 +120,11 @@ public virtual async Task> Cre /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -167,7 +175,11 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -257,7 +273,11 @@ public virtual Response Get(string version, /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -290,7 +310,11 @@ public virtual AsyncPageable GetAllAsync(Ma /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -323,7 +347,11 @@ public virtual Pageable GetAll(MachineLearn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -366,7 +394,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -409,7 +441,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -454,7 +490,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs index 6c28f456ed48..b1692649ed53 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningModelVersionResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual Response Get(CancellationTok /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -227,7 +239,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -271,7 +287,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +339,11 @@ public virtual async Task> Upd /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -367,7 +391,11 @@ public virtual ArmOperation Update(WaitUnti /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -413,7 +441,11 @@ public virtual async Task PublishAsync(WaitUntil waitUntil, Destin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs index 08366d3f954e..4c11110852be 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task> Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(string depl /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -285,7 +305,11 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -318,7 +342,11 @@ public virtual Pageable GetAll(string o /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -361,7 +389,11 @@ public virtual async Task> ExistsAsync(string deploymentName, Can /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -404,7 +436,11 @@ public virtual Response Exists(string deploymentName, CancellationToken ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -449,7 +485,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs index 0c1353a83bd4..f153ccb38220 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineDeploymentResource.cs @@ -105,7 +105,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -145,7 +149,11 @@ public virtual async Task> Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -185,7 +193,11 @@ public virtual Response Get(Cancellatio /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -227,7 +239,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -269,7 +285,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -315,7 +335,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -361,7 +385,11 @@ public virtual ArmOperation Update(Wait /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -403,7 +431,11 @@ public virtual async Task> GetLogsAsync( /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -445,7 +477,11 @@ public virtual Response GetLogs(MachineLearningDe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -477,7 +513,11 @@ public virtual AsyncPageable GetSkusAsync(int? count = /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -509,7 +549,11 @@ public virtual Pageable GetSkus(int? count = null, str /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -571,7 +615,11 @@ public virtual async Task> Add /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -633,7 +681,11 @@ public virtual Response AddTag(string k /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -690,7 +742,11 @@ public virtual async Task> Set /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -747,7 +803,11 @@ public virtual Response SetTags(IDictio /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -807,7 +867,11 @@ public virtual async Task> Rem /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs index 3b4afa9bece8..20e36bb33500 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task> C /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task> GetAs /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(string endpoi /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -286,7 +306,11 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +343,11 @@ public virtual Pageable GetAll(MachineLea /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -362,7 +390,11 @@ public virtual async Task> ExistsAsync(string endpointName, Cance /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -405,7 +437,11 @@ public virtual Response Exists(string endpointName, CancellationToken canc /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -450,7 +486,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs index 168f4824826b..40faccd3a330 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOnlineEndpointResource.cs @@ -110,7 +110,11 @@ public virtual MachineLearningOnlineDeploymentCollection GetMachineLearningOnlin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -141,7 +145,11 @@ public virtual async Task> Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -172,7 +180,11 @@ public virtual Response GetMachineLearn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -212,7 +224,11 @@ public virtual async Task> GetAs /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -294,7 +314,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -336,7 +360,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -382,7 +410,11 @@ public virtual async Task> U /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -428,7 +460,11 @@ public virtual ArmOperation Update(WaitUn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -466,7 +502,11 @@ public virtual async Task> GetKeysAsyn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -504,7 +544,11 @@ public virtual Response GetKeys(CancellationTok /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -550,7 +594,11 @@ public virtual async Task RegenerateKeysAsync(WaitUntil waitUntil, /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -596,7 +644,11 @@ public virtual ArmOperation RegenerateKeys(WaitUntil waitUntil, MachineLearningE /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -634,7 +686,11 @@ public virtual async Task> GetTokenAs /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -672,7 +728,11 @@ public virtual Response GetToken(CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -734,7 +794,11 @@ public virtual async Task> AddTa /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -796,7 +860,11 @@ public virtual Response AddTag(string key /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -853,7 +921,11 @@ public virtual async Task> SetTa /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -910,7 +982,11 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -970,7 +1046,11 @@ public virtual async Task> Remov /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs index 9e7866b514f6..d2a30e5cd088 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task> Ge /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(string rul /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -282,7 +302,11 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -312,7 +336,11 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -355,7 +383,11 @@ public virtual async Task> ExistsAsync(string ruleName, Cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -398,7 +430,11 @@ public virtual Response Exists(string ruleName, CancellationToken cancella /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -443,7 +479,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs index 54fd952bf6b2..6a9059c92dec 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicData.cs @@ -13,10 +13,7 @@ namespace Azure.ResourceManager.MachineLearning { - /// - /// A class representing the MachineLearningOutboundRuleBasic data model. - /// Outbound Rule Basic Resource for the managed network of a machine learning workspace. - /// + /// A class representing the MachineLearningOutboundRuleBasic data model. public partial class MachineLearningOutboundRuleBasicData : ResourceData { /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs index 8e78ecb861c2..7c2ac3571b5c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningOutboundRuleBasicResource.cs @@ -101,7 +101,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -141,7 +145,11 @@ public virtual async Task> Ge /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -181,7 +189,11 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -223,7 +235,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -265,7 +281,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -311,7 +331,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs index cab62aca98da..c6956ff55ee0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -115,7 +119,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -166,7 +174,11 @@ public virtual ArmOperation Cr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -211,7 +223,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -256,7 +272,11 @@ public virtual Response Get(st /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -285,7 +305,11 @@ public virtual AsyncPageable G /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -314,7 +338,11 @@ public virtual Pageable GetAll /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -357,7 +385,11 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -400,7 +432,11 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -445,7 +481,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs index eded94a366e4..cdb1cefe97ad 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.Serialization.cs @@ -85,7 +85,7 @@ void IJsonModel.Write(Utf8JsonWrit writer.WritePropertyName("privateLinkServiceConnectionState"u8); writer.WriteObjectValue(ConnectionState, options); } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + if (Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs index 2f656ae05bc6..f1ce46958c7b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionData.cs @@ -100,7 +100,12 @@ public ResourceIdentifier SubResourceId /// A collection of information about the state of the connection between service consumer and provider. public MachineLearningPrivateLinkServiceConnectionState ConnectionState { get; set; } +<<<<<<< HEAD /// The provisioning state of the private endpoint connection resource. public MachineLearningPrivateEndpointConnectionProvisioningState? ProvisioningState { get; } +======= + /// The current provisioning state. + public MachineLearningPrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs index 9619ba4dcae0..e329c7ffb6d4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningPrivateEndpointConnectionResource.cs @@ -102,7 +102,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -142,7 +146,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -182,7 +190,11 @@ public virtual Response Get(Ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -226,7 +238,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -270,7 +286,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -318,7 +338,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -366,7 +390,11 @@ public virtual ArmOperation Up /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -423,7 +451,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -480,7 +512,11 @@ public virtual Response AddTag /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -536,7 +572,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -592,7 +632,11 @@ public virtual Response SetTag /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -647,7 +691,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs index aff8d8bc30f4..82847e267c2b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation Create /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -283,7 +303,11 @@ public virtual AsyncPageable GetAl /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -314,7 +338,11 @@ public virtual Pageable GetAll(str /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -357,7 +385,11 @@ public virtual async Task> ExistsAsync(string codeName, Cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -400,7 +432,11 @@ public virtual Response Exists(string codeName, CancellationToken cancella /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -445,7 +481,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs index e4efe773cfcc..6aed46a88069 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningRegistryCodeVersionCollection GetMachineLearningRe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMachineLe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get(Cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -292,7 +312,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -334,7 +358,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -380,7 +408,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs index 3d80b5435a23..18c9b76aaa71 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(string v /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -285,7 +305,11 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -318,7 +342,11 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -361,7 +389,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -404,7 +436,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -449,7 +485,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs index c4ee10e03d70..c0055621a9fa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCodeVersionResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual Response Get(Cancella /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -225,7 +237,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -267,7 +283,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -313,7 +333,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -359,7 +383,11 @@ public virtual ArmOperation Update(W /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -401,7 +429,11 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs index 69cf5a3951c3..2d87b3c3cda1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task> CreateO /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(string registryName /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -283,7 +303,11 @@ public virtual AsyncPageable GetAllAsync(Cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -313,7 +337,11 @@ public virtual Pageable GetAll(CancellationToke /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -356,7 +384,11 @@ public virtual async Task> ExistsAsync(string registryName, Cance /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -399,7 +431,11 @@ public virtual Response Exists(string registryName, CancellationToken canc /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -444,7 +480,11 @@ public virtual async Task> Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs index f881ca4a2931..f583515e0ebf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.Serialization.cs @@ -115,6 +115,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("managedResourceGroup"); } } + if (Optional.IsDefined(ManagedResourceGroupSettings)) + { + if (ManagedResourceGroupSettings != null) + { + writer.WritePropertyName("managedResourceGroupSettings"u8); + writer.WriteObjectValue(ManagedResourceGroupSettings, options); + } + else + { + writer.WriteNull("managedResourceGroupSettings"); + } + } if (Optional.IsDefined(MlFlowRegistryUri)) { if (MlFlowRegistryUri != null) @@ -224,6 +236,7 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa Uri discoveryUrl = default; string intellectualPropertyPublisher = default; ArmResourceId managedResourceGroup = default; + ManagedResourceGroupSettings managedResourceGroupSettings = default; Uri mlFlowRegistryUri = default; IList registryPrivateEndpointConnections = default; string publicNetworkAccess = default; @@ -338,6 +351,16 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa managedResourceGroup = ArmResourceId.DeserializeArmResourceId(property0.Value, options); continue; } + if (property0.NameEquals("managedResourceGroupSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + managedResourceGroupSettings = null; + continue; + } + managedResourceGroupSettings = ManagedResourceGroupSettings.DeserializeManagedResourceGroupSettings(property0.Value, options); + continue; + } if (property0.NameEquals("mlFlowRegistryUri"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -410,6 +433,7 @@ internal static MachineLearningRegistryData DeserializeMachineLearningRegistryDa discoveryUrl, intellectualPropertyPublisher, managedResourceGroup, + managedResourceGroupSettings, mlFlowRegistryUri, registryPrivateEndpointConnections ?? new ChangeTrackingList(), publicNetworkAccess, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs index 5304cb0d1847..defbc98f0d2d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryData.cs @@ -69,6 +69,7 @@ public MachineLearningRegistryData(AzureLocation location) : base(location) /// Discovery URL for the Registry. /// IntellectualPropertyPublisher for the registry. /// ResourceId of the managed RG if the registry has system created resources. + /// Managed resource group specific settings. /// MLFlow Registry URI for the Registry. /// Private endpoint connections info used for pending connections in private link portal. /// @@ -77,7 +78,11 @@ public MachineLearningRegistryData(AzureLocation location) : base(location) /// /// Details of each region the registry is in. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal MachineLearningRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, Uri discoveryUri, string intellectualPropertyPublisher, ArmResourceId managedResourceGroup, Uri mlFlowRegistryUri, IList registryPrivateEndpointConnections, string publicNetworkAccess, IList regionDetails, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) +======= + internal MachineLearningRegistryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, Uri discoveryUri, string intellectualPropertyPublisher, ArmResourceId managedResourceGroup, ManagedResourceGroupSettings managedResourceGroupSettings, Uri mlFlowRegistryUri, IList registryPrivateEndpointConnections, string publicNetworkAccess, IList regionDetails, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Identity = identity; Kind = kind; @@ -85,6 +90,7 @@ internal MachineLearningRegistryData(ResourceIdentifier id, string name, Resourc DiscoveryUri = discoveryUri; IntellectualPropertyPublisher = intellectualPropertyPublisher; ManagedResourceGroup = managedResourceGroup; + ManagedResourceGroupSettings = managedResourceGroupSettings; MlFlowRegistryUri = mlFlowRegistryUri; RegistryPrivateEndpointConnections = registryPrivateEndpointConnections; PublicNetworkAccess = publicNetworkAccess; @@ -124,6 +130,20 @@ public ResourceIdentifier ManagedResourceId } } + /// Managed resource group specific settings. + internal ManagedResourceGroupSettings ManagedResourceGroupSettings { get; set; } + /// List of assigned identities for the managed resource group. + public IList ManagedResourceGroupAssignedIdentities + { + get => ManagedResourceGroupSettings is null ? default : ManagedResourceGroupSettings.AssignedIdentities; + set + { + if (ManagedResourceGroupSettings is null) + ManagedResourceGroupSettings = new ManagedResourceGroupSettings(); + ManagedResourceGroupSettings.AssignedIdentities = value; + } + } + /// MLFlow Registry URI for the Registry. public Uri MlFlowRegistryUri { get; set; } /// Private endpoint connections info used for pending connections in private link portal. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs index a4c8764e9e48..407a9a162a28 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation Create /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -285,7 +305,11 @@ public virtual AsyncPageable GetAl /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -317,7 +341,11 @@ public virtual Pageable GetAll(str /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -360,7 +388,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -403,7 +435,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -448,7 +484,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs index 00c16e459ac2..1d294ecc12db 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningRegistryDataVersionCollection GetMachineLearningRe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMachineLe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get(Cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -292,7 +312,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -334,7 +358,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -380,7 +408,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs index b8dbfa267a1a..9dcb98422b49 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(string v /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -291,7 +311,11 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -329,7 +353,11 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -372,7 +400,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -415,7 +447,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -460,7 +496,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs index 5ce21dd45e98..e0cec2423bf9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryDataVersionResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual Response Get(Cancella /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -225,7 +237,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -267,7 +283,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -313,7 +333,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -359,7 +383,11 @@ public virtual ArmOperation Update(W /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -401,7 +429,11 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs index 115fa39f692a..15662bffd335 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -285,7 +305,11 @@ public virtual AsyncPageable /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -317,7 +341,11 @@ public virtual Pageable Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -360,7 +388,11 @@ public virtual async Task> ExistsAsync(string environmentName, Ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -403,7 +435,11 @@ public virtual Response Exists(string environmentName, CancellationToken c /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -448,7 +484,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs index 42e56f61467c..6ab71dafaf18 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningRegistryEnvironmentVersionCollection GetMachineLea /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMa /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -292,7 +312,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -334,7 +358,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -380,7 +408,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs index 1e1b53e4c735..18487e7db93b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation C /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(s /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -287,7 +307,11 @@ public virtual AsyncPageable /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -321,7 +345,11 @@ public virtual Pageable GetAl /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -364,7 +392,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -407,7 +439,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -452,7 +488,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs index 36f59713ad52..f3a10ebc255c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryEnvironmentVersionResource.cs @@ -102,7 +102,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -142,7 +146,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -182,7 +190,11 @@ public virtual Response Get(C /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -224,7 +236,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -266,7 +282,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -312,7 +332,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs index 7b598a9825f5..e3e80e806bdb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation Creat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(strin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -285,7 +305,11 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -317,7 +341,11 @@ public virtual Pageable GetAll(st /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -360,7 +388,11 @@ public virtual async Task> ExistsAsync(string modelName, Cancella /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -403,7 +435,11 @@ public virtual Response Exists(string modelName, CancellationToken cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -448,7 +484,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs index 4339f6d0674c..008951326bb1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelContainerResource.cs @@ -108,7 +108,11 @@ public virtual MachineLearningRegistryModelVersionCollection GetMachineLearningR /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +143,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -170,7 +178,11 @@ public virtual Response GetMachineL /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -210,7 +222,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -250,7 +266,11 @@ public virtual Response Get(Cance /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -292,7 +312,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -334,7 +358,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -380,7 +408,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs index bffcc3416085..69baac90b56d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation CreateO /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -286,7 +306,11 @@ public virtual AsyncPageable GetAll /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -319,7 +343,11 @@ public virtual Pageable GetAll(Mach /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -362,7 +390,11 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -405,7 +437,11 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -450,7 +486,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs index 73a385e2138b..8e221e9080d9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryModelVersionResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual Response Get(Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -225,7 +237,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -267,7 +283,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -313,7 +333,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -359,7 +383,11 @@ public virtual ArmOperation Update( /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -401,7 +429,11 @@ public virtual async Task> CreateOrGetStartPe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs index 63194d1e83c1..692c2272a56b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningRegistryResource.cs @@ -114,7 +114,11 @@ public virtual MachineLearningRegistryCodeContainerCollection GetMachineLearning /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -145,7 +149,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual MachineLearninRegistryComponentContainerCollection GetMachineLear /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -214,7 +226,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual MachineLearningRegistryDataContainerCollection GetMachineLearning /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -283,7 +303,11 @@ public virtual async Task /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -321,7 +345,11 @@ public virtual MachineLearningRegistryEnvironmentContainerCollection GetMachineL /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -352,7 +380,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -390,7 +422,11 @@ public virtual MachineLearningRegistryModelContainerCollection GetMachineLearnin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -421,7 +457,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -452,7 +492,11 @@ public virtual Response GetMachin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -492,7 +536,11 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -532,7 +580,11 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -574,7 +626,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -616,7 +672,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -658,7 +718,11 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -700,7 +764,11 @@ public virtual Response Update(MachineLearningR /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -743,7 +811,11 @@ public virtual async Task> GetBlobRefer /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -786,7 +858,11 @@ public virtual Response GetBlobReferenceSasRegis /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -832,7 +908,11 @@ public virtual async Task> RemoveR /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -878,7 +958,11 @@ public virtual ArmOperation RemoveRegions(WaitU /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -940,7 +1024,11 @@ public virtual async Task> AddTagAsync /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -1002,7 +1090,11 @@ public virtual Response AddTag(string key, stri /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -1059,7 +1151,11 @@ public virtual async Task> SetTagsAsyn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -1116,7 +1212,11 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -1176,7 +1276,11 @@ public virtual async Task> RemoveTagAs /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs index 475caf26edbc..8d89fb5c7a1a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -114,7 +118,11 @@ public virtual async Task> CreateO /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -208,7 +220,11 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,7 +269,11 @@ public virtual Response Get(string name, Cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -285,7 +305,11 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -317,7 +341,11 @@ public virtual Pageable GetAll(string skip = nu /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -360,7 +388,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -403,7 +435,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -448,7 +484,11 @@ public virtual async Task> Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs index 5465a3cb507e..0e83edd814b6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningScheduleResource.cs @@ -101,7 +101,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -141,7 +145,11 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -181,7 +189,11 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -223,7 +235,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -265,7 +281,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -311,7 +331,11 @@ public virtual async Task> UpdateA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs index aa8753217523..b61e74faabf2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceCollection.cs @@ -65,7 +65,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -74,7 +78,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for creating or updating a machine learning workspace. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -114,7 +118,11 @@ public virtual async Task> Create /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -123,7 +131,7 @@ public virtual async Task> Create /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for creating or updating a machine learning workspace. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -163,7 +171,11 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -171,7 +183,7 @@ public virtual ArmOperation CreateOrUpdate(Wai /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -208,7 +220,11 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -216,7 +232,7 @@ public virtual async Task> GetAsync(s /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -253,7 +269,11 @@ public virtual Response Get(string workspaceNa /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -261,6 +281,7 @@ public virtual Response Get(string workspaceNa /// /// /// +<<<<<<< HEAD /// Continuation token for pagination. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. @@ -268,6 +289,17 @@ public virtual AsyncPageable GetAllAsync(strin { HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip); +======= + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MachineLearningWorkspaceCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -284,7 +316,11 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -292,6 +328,7 @@ public virtual AsyncPageable GetAllAsync(strin /// /// /// +<<<<<<< HEAD /// Continuation token for pagination. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. @@ -299,6 +336,17 @@ public virtual Pageable GetAll(string skip = n { HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip); +======= + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceWorkspacesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, kind, skip, aiCapabilities); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceResource(Client, MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(e)), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MachineLearningWorkspaceCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -315,7 +363,11 @@ public virtual Pageable GetAll(string skip = n /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -323,7 +375,7 @@ public virtual Pageable GetAll(string skip = n /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -358,7 +410,11 @@ public virtual async Task> ExistsAsync(string workspaceName, Canc /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -366,7 +422,7 @@ public virtual async Task> ExistsAsync(string workspaceName, Canc /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -401,7 +457,11 @@ public virtual Response Exists(string workspaceName, CancellationToken can /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -409,7 +469,7 @@ public virtual Response Exists(string workspaceName, CancellationToken can /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -446,7 +506,11 @@ public virtual async Task> Ge /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -454,7 +518,7 @@ public virtual async Task> Ge /// /// /// - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs index fda59604136c..62b5b4c00111 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionCollection.cs @@ -63,7 +63,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -163,7 +171,11 @@ public virtual ArmOperation CreateOr /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -251,7 +267,11 @@ public virtual Response Get(string c /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -261,12 +281,13 @@ public virtual Response Get(string c /// /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string target = null, string category = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceConnectionResource(Client, MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(e)), _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -282,7 +303,11 @@ public virtual AsyncPageable GetAllA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -292,12 +317,13 @@ public virtual AsyncPageable GetAllA /// /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string target = null, string category = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category); + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, target, category, includeAll); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineLearningWorkspaceConnectionResource(Client, MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(e)), _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -314,7 +340,11 @@ public virtual Pageable GetAll(strin /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -357,7 +387,11 @@ public virtual async Task> ExistsAsync(string connectionName, Can /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -400,7 +434,11 @@ public virtual Response Exists(string connectionName, CancellationToken ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -445,7 +483,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs index 95b78ab1729b..658385ca4659 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceConnectionResource.cs @@ -9,6 +9,7 @@ using System.Globalization; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; @@ -35,6 +36,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics; private readonly WorkspaceConnectionsRestOperations _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient; + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; private readonly MachineLearningWorkspaceConnectionData _data; /// Gets the resource type for the operations. @@ -62,6 +65,9 @@ internal MachineLearningWorkspaceConnectionResource(ArmClient client, ResourceId _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string machineLearningWorkspaceConnectionWorkspaceConnectionsApiVersion); _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient = new WorkspaceConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningWorkspaceConnectionWorkspaceConnectionsApiVersion); + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionDeploymentResource.ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -88,6 +94,213 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of WorkspaceConnectionDeploymentResources in the MachineLearningWorkspaceConnection. + /// An object representing collection of WorkspaceConnectionDeploymentResources and their operations over a WorkspaceConnectionDeploymentResource. + public virtual WorkspaceConnectionDeploymentCollection GetWorkspaceConnectionDeployments() + { + return GetCachedClient(client => new WorkspaceConnectionDeploymentCollection(client, Id)); + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceConnectionDeploymentAsync(string deploymentName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceConnectionDeployments().GetAsync(deploymentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceConnectionDeployment(string deploymentName, CancellationToken cancellationToken = default) + { + return GetWorkspaceConnectionDeployments().Get(deploymentName, cancellationToken); + } + + /// Gets a collection of RaiBlocklistPropertiesBasicResources in the MachineLearningWorkspaceConnection. + /// An object representing collection of RaiBlocklistPropertiesBasicResources and their operations over a RaiBlocklistPropertiesBasicResource. + public virtual RaiBlocklistPropertiesBasicResourceCollection GetRaiBlocklistPropertiesBasicResources() + { + return GetCachedClient(client => new RaiBlocklistPropertiesBasicResourceCollection(client, Id)); + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRaiBlocklistPropertiesBasicResourceAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + return await GetRaiBlocklistPropertiesBasicResources().GetAsync(raiBlocklistName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRaiBlocklistPropertiesBasicResource(string raiBlocklistName, CancellationToken cancellationToken = default) + { + return GetRaiBlocklistPropertiesBasicResources().Get(raiBlocklistName, cancellationToken); + } + + /// Gets a collection of WorkspaceConnectionRaiPolicyResources in the MachineLearningWorkspaceConnection. + /// An object representing collection of WorkspaceConnectionRaiPolicyResources and their operations over a WorkspaceConnectionRaiPolicyResource. + public virtual WorkspaceConnectionRaiPolicyCollection GetWorkspaceConnectionRaiPolicies() + { + return GetCachedClient(client => new WorkspaceConnectionRaiPolicyCollection(client, Id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWorkspaceConnectionRaiPolicyAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + return await GetWorkspaceConnectionRaiPolicies().GetAsync(raiPolicyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWorkspaceConnectionRaiPolicy(string raiPolicyName, CancellationToken cancellationToken = default) + { + return GetWorkspaceConnectionRaiPolicies().Get(raiPolicyName, cancellationToken); + } + /// /// /// @@ -100,7 +313,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -139,7 +356,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -178,7 +399,11 @@ public virtual Response Get(Cancella /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -221,7 +446,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -253,6 +482,93 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// +<<<<<<< HEAD +======= + /// Update machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName} + /// + /// + /// Operation Id + /// WorkspaceConnections_Update + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Parameters for workspace connection update. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(MachineLearningWorkspaceConnectionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics.CreateScope("MachineLearningWorkspaceConnectionResource.Update"); + scope.Start(); + try + { + var response = await _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MachineLearningWorkspaceConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName} + /// + /// + /// Operation Id + /// WorkspaceConnections_Update + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Parameters for workspace connection update. + /// The cancellation token to use. + /// is null. + public virtual Response Update(MachineLearningWorkspaceConnectionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics.CreateScope("MachineLearningWorkspaceConnectionResource.Update"); + scope.Start(); + try + { + var response = _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new MachineLearningWorkspaceConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// List all the secrets of a machine learning workspaces connections. /// /// @@ -265,7 +581,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -303,7 +623,11 @@ public virtual async Task> /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -327,5 +651,151 @@ public virtual Response GetSecrets(C throw; } } + + /// + /// Test machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection + /// + /// + /// Operation Id + /// WorkspaceConnections_TestConnection + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Workspace Connection object. + /// The cancellation token to use. + public virtual async Task TestConnectionAsync(WaitUntil waitUntil, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics.CreateScope("MachineLearningWorkspaceConnectionResource.TestConnection"); + scope.Start(); + try + { + var response = await _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.TestConnectionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateTestConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Test machine learning workspaces connections under the specified workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/testconnection + /// + /// + /// Operation Id + /// WorkspaceConnections_TestConnection + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Workspace Connection object. + /// The cancellation token to use. + public virtual ArmOperation TestConnection(WaitUntil waitUntil, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics.CreateScope("MachineLearningWorkspaceConnectionResource.TestConnection"); + scope.Start(); + try + { + var response = _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.TestConnection(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningWorkspaceConnectionWorkspaceConnectionsClientDiagnostics, Pipeline, _machineLearningWorkspaceConnectionWorkspaceConnectionsRestClient.CreateTestConnectionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get available models under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models + /// + /// + /// Operation Id + /// Connection_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetModelsConnectionsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionResource.GetModelsConnections", "value", "nextLink", cancellationToken); + } + + /// + /// Get available models under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/models + /// + /// + /// Operation Id + /// Connection_GetModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetModelsConnections(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateGetModelsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceConnectionResource.GetModelsConnections", "value", "nextLink", cancellationToken); + } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs index f86348a34a4e..bb9b95b1e429 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.Serialization.cs @@ -81,19 +81,135 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(WorkspaceId)) { +<<<<<<< HEAD writer.WritePropertyName("workspaceId"u8); writer.WriteStringValue(WorkspaceId); +======= + writer.WritePropertyName("allowPublicAccessWhenBehindVnet"u8); + writer.WriteBooleanValue(AllowPublicAccessWhenBehindVnet.Value); + } + if (Optional.IsDefined(AllowRoleAssignmentOnRG)) + { + writer.WritePropertyName("allowRoleAssignmentOnRG"u8); + writer.WriteBooleanValue(AllowRoleAssignmentOnRG.Value); + } + if (Optional.IsDefined(ApplicationInsights)) + { + writer.WritePropertyName("applicationInsights"u8); + writer.WriteStringValue(ApplicationInsights); + } + if (Optional.IsCollectionDefined(AssociatedWorkspaces)) + { + writer.WritePropertyName("associatedWorkspaces"u8); + writer.WriteStartArray(); + foreach (var item in AssociatedWorkspaces) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ContainerRegistries)) + { + writer.WritePropertyName("containerRegistries"u8); + writer.WriteStartArray(); + foreach (var item in ContainerRegistries) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ContainerRegistry)) + { + writer.WritePropertyName("containerRegistry"u8); + writer.WriteStringValue(ContainerRegistry); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(DiscoveryUri)) + { + writer.WritePropertyName("discoveryUrl"u8); + writer.WriteStringValue(DiscoveryUri.AbsoluteUri); + } + if (Optional.IsDefined(EnableDataIsolation)) + { + writer.WritePropertyName("enableDataIsolation"u8); + writer.WriteBooleanValue(EnableDataIsolation.Value); + } + if (Optional.IsDefined(EnableServiceSideCMKEncryption)) + { + writer.WritePropertyName("enableServiceSideCMKEncryption"u8); + writer.WriteBooleanValue(EnableServiceSideCMKEncryption.Value); + } + if (Optional.IsDefined(EnableSimplifiedCmk)) + { + writer.WritePropertyName("enableSimplifiedCmk"u8); + writer.WriteBooleanValue(EnableSimplifiedCmk.Value); + } + if (Optional.IsDefined(EnableSoftwareBillOfMaterials)) + { + writer.WritePropertyName("enableSoftwareBillOfMaterials"u8); + writer.WriteBooleanValue(EnableSoftwareBillOfMaterials.Value); + } + if (Optional.IsDefined(Encryption)) + { + writer.WritePropertyName("encryption"u8); + writer.WriteObjectValue(Encryption, options); + } + if (Optional.IsCollectionDefined(ExistingWorkspaces)) + { + writer.WritePropertyName("existingWorkspaces"u8); + writer.WriteStartArray(); + foreach (var item in ExistingWorkspaces) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FeatureStoreSettings)) + { + writer.WritePropertyName("featureStoreSettings"u8); + writer.WriteObjectValue(FeatureStoreSettings, options); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(FriendlyName)) { writer.WritePropertyName("friendlyName"u8); writer.WriteStringValue(FriendlyName); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(IsHbiWorkspace)) + { + writer.WritePropertyName("hbiWorkspace"u8); + writer.WriteBooleanValue(IsHbiWorkspace.Value); + } + if (Optional.IsDefined(HubResourceId)) + { + writer.WritePropertyName("hubResourceId"u8); + writer.WriteStringValue(HubResourceId); + } + if (Optional.IsDefined(ImageBuildCompute)) + { + writer.WritePropertyName("imageBuildCompute"u8); + writer.WriteStringValue(ImageBuildCompute); + } + if (Optional.IsCollectionDefined(IPAllowlist)) + { + writer.WritePropertyName("ipAllowlist"u8); + writer.WriteStartArray(); + foreach (var item in IPAllowlist) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(KeyVault)) { writer.WritePropertyName("keyVault"u8); @@ -178,9 +294,39 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } if (Optional.IsDefined(ServerlessComputeSettings)) { +<<<<<<< HEAD + writer.WritePropertyName("serverlessComputeSettings"u8); + writer.WriteObjectValue(ServerlessComputeSettings, options); +======= + writer.WritePropertyName("privateLinkCount"u8); + writer.WriteNumberValue(PrivateLinkCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(PublicNetworkAccessType)) + { + writer.WritePropertyName("publicNetworkAccess"u8); + writer.WriteStringValue(PublicNetworkAccessType.Value.ToString()); + } + if (Optional.IsDefined(ServerlessComputeSettings)) + { writer.WritePropertyName("serverlessComputeSettings"u8); writer.WriteObjectValue(ServerlessComputeSettings, options); } + if (Optional.IsDefined(ServiceManagedResourcesSettings)) + { + writer.WritePropertyName("serviceManagedResourcesSettings"u8); + writer.WriteObjectValue(ServiceManagedResourcesSettings, options); + } + if (options.Format != "W" && Optional.IsDefined(ServiceProvisionedResourceGroup)) + { + writer.WritePropertyName("serviceProvisionedResourceGroup"u8); + writer.WriteStringValue(ServiceProvisionedResourceGroup); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + } if (Optional.IsCollectionDefined(SharedPrivateLinkResources)) { writer.WritePropertyName("sharedPrivateLinkResources"u8); @@ -309,6 +455,51 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace string name = default; ResourceType type = default; SystemData systemData = default; +<<<<<<< HEAD +======= + bool? allowPublicAccessWhenBehindVnet = default; + bool? allowRoleAssignmentOnRG = default; + string applicationInsights = default; + IList associatedWorkspaces = default; + IList containerRegistries = default; + string containerRegistry = default; + string description = default; + Uri discoveryUrl = default; + bool? enableDataIsolation = default; + bool? enableServiceSideCMKEncryption = default; + bool? enableSimplifiedCmk = default; + bool? enableSoftwareBillOfMaterials = default; + MachineLearningEncryptionSetting encryption = default; + IList existingWorkspaces = default; + FeatureStoreSettings featureStoreSettings = default; + string friendlyName = default; + bool? hbiWorkspace = default; + ResourceIdentifier hubResourceId = default; + string imageBuildCompute = default; + IList ipAllowlist = default; + string keyVault = default; + IList keyVaults = default; + ManagedNetworkSettings managedNetwork = default; + Uri mlFlowTrackingUri = default; + MachineLearningNotebookResourceInfo notebookInfo = default; + string primaryUserAssignedIdentity = default; + IReadOnlyList privateEndpointConnections = default; + int? privateLinkCount = default; + MachineLearningProvisioningState? provisioningState = default; + MachineLearningPublicNetworkAccessType? publicNetworkAccess = default; + ServerlessComputeSettings serverlessComputeSettings = default; + ServiceManagedResourcesSettings serviceManagedResourcesSettings = default; + string serviceProvisionedResourceGroup = default; + IList sharedPrivateLinkResources = default; + int? softDeleteRetentionInDays = default; + string storageAccount = default; + IList storageAccounts = default; + bool? storageHnsEnabled = default; + string systemDatastoresAuthMode = default; + Guid? tenantId = default; + bool? v1LegacyMode = default; + WorkspaceHubConfig workspaceHubConfig = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 string workspaceId = default; string description = default; string friendlyName = default; @@ -441,6 +632,15 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace keyVault = property0.Value.GetString(); continue; } + if (property0.NameEquals("allowRoleAssignmentOnRG"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowRoleAssignmentOnRG = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("applicationInsights"u8)) { applicationInsights = property0.Value.GetString(); @@ -479,6 +679,33 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace provisioningState = new MachineLearningProvisioningState(property0.Value.GetString()); continue; } + if (property0.NameEquals("enableServiceSideCMKEncryption"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableServiceSideCMKEncryption = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("enableSimplifiedCmk"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSimplifiedCmk = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("enableSoftwareBillOfMaterials"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSoftwareBillOfMaterials = property0.Value.GetBoolean(); + continue; + } if (property0.NameEquals("encryption"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -516,7 +743,30 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace imageBuildCompute = property0.Value.GetString(); continue; } +<<<<<<< HEAD if (property0.NameEquals("allowPublicAccessWhenBehindVnet"u8)) +======= + if (property0.NameEquals("ipAllowlist"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAllowlist = array; + continue; + } + if (property0.NameEquals("keyVault"u8)) + { + keyVault = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("keyVaults"u8)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { if (property0.Value.ValueKind == JsonValueKind.Null) { @@ -554,7 +804,52 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace { continue; } +<<<<<<< HEAD serverlessComputeSettings = ServerlessComputeSettings.DeserializeServerlessComputeSettings(property0.Value, options); +======= + privateLinkCount = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MachineLearningProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("publicNetworkAccess"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicNetworkAccess = new MachineLearningPublicNetworkAccessType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("serverlessComputeSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverlessComputeSettings = ServerlessComputeSettings.DeserializeServerlessComputeSettings(property0.Value, options); + continue; + } + if (property0.NameEquals("serviceManagedResourcesSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceManagedResourcesSettings = ServiceManagedResourcesSettings.DeserializeServiceManagedResourcesSettings(property0.Value, options); + continue; + } + if (property0.NameEquals("serviceProvisionedResourceGroup"u8)) + { + serviceProvisionedResourceGroup = property0.Value.GetString(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property0.NameEquals("sharedPrivateLinkResources"u8)) @@ -708,6 +1003,51 @@ internal static MachineLearningWorkspaceData DeserializeMachineLearningWorkspace identity, kind, sku, +<<<<<<< HEAD +======= + allowPublicAccessWhenBehindVnet, + allowRoleAssignmentOnRG, + applicationInsights, + associatedWorkspaces ?? new ChangeTrackingList(), + containerRegistries ?? new ChangeTrackingList(), + containerRegistry, + description, + discoveryUrl, + enableDataIsolation, + enableServiceSideCMKEncryption, + enableSimplifiedCmk, + enableSoftwareBillOfMaterials, + encryption, + existingWorkspaces ?? new ChangeTrackingList(), + featureStoreSettings, + friendlyName, + hbiWorkspace, + hubResourceId, + imageBuildCompute, + ipAllowlist ?? new ChangeTrackingList(), + keyVault, + keyVaults ?? new ChangeTrackingList(), + managedNetwork, + mlFlowTrackingUri, + notebookInfo, + primaryUserAssignedIdentity, + privateEndpointConnections ?? new ChangeTrackingList(), + privateLinkCount, + provisioningState, + publicNetworkAccess, + serverlessComputeSettings, + serviceManagedResourcesSettings, + serviceProvisionedResourceGroup, + sharedPrivateLinkResources ?? new ChangeTrackingList(), + softDeleteRetentionInDays, + storageAccount, + storageAccounts ?? new ChangeTrackingList(), + storageHnsEnabled, + systemDatastoresAuthMode, + tenantId, + v1LegacyMode, + workspaceHubConfig, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 workspaceId, description, friendlyName, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs index a64a7f4433f0..78aa2d8eb48f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceData.cs @@ -55,6 +55,14 @@ public partial class MachineLearningWorkspaceData : TrackedResourceData /// The location. public MachineLearningWorkspaceData(AzureLocation location) : base(location) { +<<<<<<< HEAD +======= + AssociatedWorkspaces = new ChangeTrackingList(); + ContainerRegistries = new ChangeTrackingList(); + ExistingWorkspaces = new ChangeTrackingList(); + IPAllowlist = new ChangeTrackingList(); + KeyVaults = new ChangeTrackingList(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 PrivateEndpointConnections = new ChangeTrackingList(); SharedPrivateLinkResources = new ChangeTrackingList(); AssociatedWorkspaces = new ChangeTrackingList(); @@ -69,7 +77,53 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// The location. /// The identity of the resource. /// +<<<<<<< HEAD /// The sku of the workspace. +======= + /// Optional. This field is required to be implemented by the RP because AML is supporting more than one tier. + /// The flag to indicate whether to allow public access when behind VNet. + /// The flag to indicate whether we will do role assignment for the workspace MSI on resource group level. + /// ARM id of the application insights associated with this workspace. + /// + /// + /// ARM id of the container registry associated with this workspace. + /// The description of this workspace. + /// Url for the discovery service to identify regional endpoints for machine learning experimentation services. + /// + /// + /// Flag to tell if simplified CMK should be enabled for this workspace. + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. + /// + /// + /// Settings for feature store type workspace. + /// The friendly name for this workspace. This name in mutable. + /// The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service. + /// + /// The compute name for image build. + /// The list of IPv4 addresses that are allowed to access the workspace. + /// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created. + /// + /// Managed Network settings for a machine learning workspace. + /// The URI associated with this workspace that machine learning flow must point at to set up tracking. + /// The notebook info of Azure ML workspace. + /// The user assigned identity resource id that represents the workspace identity. + /// The list of private endpoint connections in the workspace. + /// Count of private connections in the workspace. + /// The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. + /// Whether requests from Public Network are allowed. + /// Settings for serverless compute in a workspace. + /// The service managed resource settings. + /// The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace. + /// The list of shared private link resources in this workspace. + /// Retention time in days after workspace get soft deleted. + /// ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created. + /// + /// If the storage associated with the workspace has hierarchical namespace(HNS) enabled. + /// The auth mode used for accessing the system datastores of the workspace. + /// The tenant id associated with this workspace. + /// Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. + /// WorkspaceHub's configuration object. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The immutable id associated with this workspace. /// The description of this workspace. /// The friendly name for this workspace. This name in mutable. @@ -103,11 +157,60 @@ public MachineLearningWorkspaceData(AzureLocation location) : base(location) /// /// WorkspaceHub's configuration object. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, string workspaceId, string description, string friendlyName, string keyVault, string applicationInsights, string containerRegistry, string storageAccount, Uri discoveryUri, MachineLearningProvisioningState? provisioningState, MachineLearningEncryptionSetting encryption, bool? isHbiWorkspace, string serviceProvisionedResourceGroup, int? privateLinkCount, string imageBuildCompute, bool? allowPublicAccessWhenBehindVnet, PublicNetworkAccess? publicNetworkAccessType, IReadOnlyList privateEndpointConnections, ServerlessComputeSettings serverlessComputeSettings, IList sharedPrivateLinkResources, MachineLearningNotebookResourceInfo notebookInfo, ServiceManagedResourcesSettings serviceManagedResourcesSettings, string primaryUserAssignedIdentity, Guid? tenantId, bool? isStorageHnsEnabled, Uri mlFlowTrackingUri, bool? isV1LegacyMode, ManagedNetworkSettings managedNetwork, FeatureStoreSettings featureStoreSettings, IList associatedWorkspaces, bool? enableDataIsolation, ResourceIdentifier hubResourceId, WorkspaceHubConfig workspaceHubConfig, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) +======= + internal MachineLearningWorkspaceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, MachineLearningSku sku, bool? allowPublicAccessWhenBehindVnet, bool? allowRoleAssignmentOnRG, string applicationInsights, IList associatedWorkspaces, IList containerRegistries, string containerRegistry, string description, Uri discoveryUri, bool? enableDataIsolation, bool? enableServiceSideCMKEncryption, bool? enableSimplifiedCmk, bool? enableSoftwareBillOfMaterials, MachineLearningEncryptionSetting encryption, IList existingWorkspaces, FeatureStoreSettings featureStoreSettings, string friendlyName, bool? isHbiWorkspace, ResourceIdentifier hubResourceId, string imageBuildCompute, IList ipAllowlist, string keyVault, IList keyVaults, ManagedNetworkSettings managedNetwork, Uri mlFlowTrackingUri, MachineLearningNotebookResourceInfo notebookInfo, string primaryUserAssignedIdentity, IReadOnlyList privateEndpointConnections, int? privateLinkCount, MachineLearningProvisioningState? provisioningState, MachineLearningPublicNetworkAccessType? publicNetworkAccessType, ServerlessComputeSettings serverlessComputeSettings, ServiceManagedResourcesSettings serviceManagedResourcesSettings, string serviceProvisionedResourceGroup, IList sharedPrivateLinkResources, int? softDeleteRetentionInDays, string storageAccount, IList storageAccounts, bool? isStorageHnsEnabled, string systemDatastoresAuthMode, Guid? tenantId, bool? isV1LegacyMode, WorkspaceHubConfig workspaceHubConfig, string workspaceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Identity = identity; Kind = kind; Sku = sku; +<<<<<<< HEAD +======= + AllowPublicAccessWhenBehindVnet = allowPublicAccessWhenBehindVnet; + AllowRoleAssignmentOnRG = allowRoleAssignmentOnRG; + ApplicationInsights = applicationInsights; + AssociatedWorkspaces = associatedWorkspaces; + ContainerRegistries = containerRegistries; + ContainerRegistry = containerRegistry; + Description = description; + DiscoveryUri = discoveryUri; + EnableDataIsolation = enableDataIsolation; + EnableServiceSideCMKEncryption = enableServiceSideCMKEncryption; + EnableSimplifiedCmk = enableSimplifiedCmk; + EnableSoftwareBillOfMaterials = enableSoftwareBillOfMaterials; + Encryption = encryption; + ExistingWorkspaces = existingWorkspaces; + FeatureStoreSettings = featureStoreSettings; + FriendlyName = friendlyName; + IsHbiWorkspace = isHbiWorkspace; + HubResourceId = hubResourceId; + ImageBuildCompute = imageBuildCompute; + IPAllowlist = ipAllowlist; + KeyVault = keyVault; + KeyVaults = keyVaults; + ManagedNetwork = managedNetwork; + MlFlowTrackingUri = mlFlowTrackingUri; + NotebookInfo = notebookInfo; + PrimaryUserAssignedIdentity = primaryUserAssignedIdentity; + PrivateEndpointConnections = privateEndpointConnections; + PrivateLinkCount = privateLinkCount; + ProvisioningState = provisioningState; + PublicNetworkAccessType = publicNetworkAccessType; + ServerlessComputeSettings = serverlessComputeSettings; + ServiceManagedResourcesSettings = serviceManagedResourcesSettings; + ServiceProvisionedResourceGroup = serviceProvisionedResourceGroup; + SharedPrivateLinkResources = sharedPrivateLinkResources; + SoftDeleteRetentionInDays = softDeleteRetentionInDays; + StorageAccount = storageAccount; + StorageAccounts = storageAccounts; + IsStorageHnsEnabled = isStorageHnsEnabled; + SystemDatastoresAuthMode = systemDatastoresAuthMode; + TenantId = tenantId; + IsV1LegacyMode = isV1LegacyMode; + WorkspaceHubConfig = workspaceHubConfig; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 WorkspaceId = workspaceId; Description = description; FriendlyName = friendlyName; @@ -154,12 +257,55 @@ internal MachineLearningWorkspaceData() public string Kind { get; set; } /// The sku of the workspace. public MachineLearningSku Sku { get; set; } +<<<<<<< HEAD /// The immutable id associated with this workspace. public string WorkspaceId { get; } /// The description of this workspace. public string Description { get; set; } /// The friendly name for this workspace. This name in mutable. public string FriendlyName { get; set; } +======= + /// The flag to indicate whether to allow public access when behind VNet. + public bool? AllowPublicAccessWhenBehindVnet { get; set; } + /// The flag to indicate whether we will do role assignment for the workspace MSI on resource group level. + public bool? AllowRoleAssignmentOnRG { get; set; } + /// ARM id of the application insights associated with this workspace. + public string ApplicationInsights { get; set; } + /// Gets the associated workspaces. + public IList AssociatedWorkspaces { get; } + /// Gets the container registries. + public IList ContainerRegistries { get; } + /// ARM id of the container registry associated with this workspace. + public string ContainerRegistry { get; set; } + /// The description of this workspace. + public string Description { get; set; } + /// Url for the discovery service to identify regional endpoints for machine learning experimentation services. + public Uri DiscoveryUri { get; set; } + /// Gets or sets the enable data isolation. + public bool? EnableDataIsolation { get; set; } + /// Gets or sets the enable service side cmk encryption. + public bool? EnableServiceSideCMKEncryption { get; set; } + /// Flag to tell if simplified CMK should be enabled for this workspace. + public bool? EnableSimplifiedCmk { get; set; } + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. + public bool? EnableSoftwareBillOfMaterials { get; set; } + /// Gets or sets the encryption. + public MachineLearningEncryptionSetting Encryption { get; set; } + /// Gets the existing workspaces. + public IList ExistingWorkspaces { get; } + /// Settings for feature store type workspace. + public FeatureStoreSettings FeatureStoreSettings { get; set; } + /// The friendly name for this workspace. This name in mutable. + public string FriendlyName { get; set; } + /// The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service. + public bool? IsHbiWorkspace { get; set; } + /// Gets or sets the hub resource id. + public ResourceIdentifier HubResourceId { get; set; } + /// The compute name for image build. + public string ImageBuildCompute { get; set; } + /// The list of IPv4 addresses that are allowed to access the workspace. + public IList IPAllowlist { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created. public string KeyVault { get; set; } /// ARM id of the application insights associated with this workspace. @@ -185,6 +331,7 @@ internal MachineLearningWorkspaceData() /// The flag to indicate whether to allow public access when behind VNet. public bool? AllowPublicAccessWhenBehindVnet { get; set; } /// Whether requests from Public Network are allowed. +<<<<<<< HEAD public PublicNetworkAccess? PublicNetworkAccessType { get; set; } /// The list of private endpoint connections in the workspace. public IReadOnlyList PrivateEndpointConnections { get; } @@ -194,6 +341,11 @@ internal MachineLearningWorkspaceData() public IList SharedPrivateLinkResources { get; } /// The notebook info of Azure ML workspace. public MachineLearningNotebookResourceInfo NotebookInfo { get; } +======= + public MachineLearningPublicNetworkAccessType? PublicNetworkAccessType { get; set; } + /// Settings for serverless compute in a workspace. + public ServerlessComputeSettings ServerlessComputeSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The service managed resource settings. internal ServiceManagedResourcesSettings ServiceManagedResourcesSettings { get; set; } /// The throughput of the collections in cosmosdb database. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs index 7f2836503333..7a07584f0c0b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MachineLearningWorkspaceResource.cs @@ -38,6 +38,15 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _machineLearningWorkspaceWorkspacesClientDiagnostics; private readonly WorkspacesRestOperations _machineLearningWorkspaceWorkspacesRestClient; +<<<<<<< HEAD +======= + private readonly ClientDiagnostics _workspaceFeaturesClientDiagnostics; + private readonly WorkspaceFeaturesRestOperations _workspaceFeaturesRestClient; + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; + private readonly ClientDiagnostics _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics; + private readonly EndpointDeploymentRestOperations _workspaceEndpointDeploymentEndpointDeploymentRestClient; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; private readonly ClientDiagnostics _managedNetworkProvisionsClientDiagnostics; @@ -71,6 +80,17 @@ internal MachineLearningWorkspaceResource(ArmClient client, ResourceIdentifier i _machineLearningWorkspaceWorkspacesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string machineLearningWorkspaceWorkspacesApiVersion); _machineLearningWorkspaceWorkspacesRestClient = new WorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineLearningWorkspaceWorkspacesApiVersion); +<<<<<<< HEAD +======= + _workspaceFeaturesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _workspaceFeaturesRestClient = new WorkspaceFeaturesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionDeploymentResource.ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointDeploymentResource.ResourceType, out string workspaceEndpointDeploymentEndpointDeploymentApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentRestClient = new EndpointDeploymentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointDeploymentEndpointDeploymentApiVersion); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _managedNetworkProvisionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ProviderConstants.DefaultProviderNamespace, Diagnostics); @@ -123,7 +143,11 @@ public virtual MachineLearningComputeCollection GetMachineLearningComputes() /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -154,7 +178,11 @@ public virtual async Task> GetMachineLe /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -192,7 +220,11 @@ public virtual MachineLearningPrivateEndpointConnectionCollection GetMachineLear /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -223,7 +255,11 @@ public virtual async Task /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -238,150 +274,155 @@ public virtual async Task GetMachineLearningPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { +<<<<<<< HEAD return GetMachineLearningPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); +======= + return GetMachineLearningCodeContainers().Get(name, cancellationToken); } - /// Gets a collection of MachineLearningWorkspaceConnectionResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningWorkspaceConnectionResources and their operations over a MachineLearningWorkspaceConnectionResource. - public virtual MachineLearningWorkspaceConnectionCollection GetMachineLearningWorkspaceConnections() + /// Gets a collection of MachineLearningComponentContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningComponentContainerResources and their operations over a MachineLearningComponentContainerResource. + public virtual MachineLearningComponentContainerCollection GetMachineLearningComponentContainers() { - return GetCachedClient(client => new MachineLearningWorkspaceConnectionCollection(client, Id)); + return GetCachedClient(client => new MachineLearningComponentContainerCollection(client, Id)); } /// + /// Get container. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name} /// /// /// Operation Id - /// WorkspaceConnections_Get + /// ComponentContainers_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Friendly name of the workspace connection. + /// Container name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningWorkspaceConnectionAsync(string connectionName, CancellationToken cancellationToken = default) + public virtual async Task> GetMachineLearningComponentContainerAsync(string name, CancellationToken cancellationToken = default) { - return await GetMachineLearningWorkspaceConnections().GetAsync(connectionName, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningComponentContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); } /// + /// Get container. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name} /// /// /// Operation Id - /// WorkspaceConnections_Get + /// ComponentContainers_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Friendly name of the workspace connection. + /// Container name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningWorkspaceConnection(string connectionName, CancellationToken cancellationToken = default) + public virtual Response GetMachineLearningComponentContainer(string name, CancellationToken cancellationToken = default) { - return GetMachineLearningWorkspaceConnections().Get(connectionName, cancellationToken); + return GetMachineLearningComponentContainers().Get(name, cancellationToken); } - /// Gets a collection of MachineLearningOutboundRuleBasicResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningOutboundRuleBasicResources and their operations over a MachineLearningOutboundRuleBasicResource. - public virtual MachineLearningOutboundRuleBasicCollection GetMachineLearningOutboundRuleBasics() + /// Gets a collection of MachineLearningDataContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningDataContainerResources and their operations over a MachineLearningDataContainerResource. + public virtual MachineLearningDataContainerCollection GetMachineLearningDataContainers() { - return GetCachedClient(client => new MachineLearningOutboundRuleBasicCollection(client, Id)); + return GetCachedClient(client => new MachineLearningDataContainerCollection(client, Id)); } /// - /// Gets an outbound rule from the managed network of a machine learning workspace. + /// Get container. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name} /// /// /// Operation Id - /// ManagedNetworkSettingsRule_Get + /// DataContainers_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the workspace managed network outbound rule. + /// Container name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningOutboundRuleBasicAsync(string ruleName, CancellationToken cancellationToken = default) + public virtual async Task> GetMachineLearningDataContainerAsync(string name, CancellationToken cancellationToken = default) { - return await GetMachineLearningOutboundRuleBasics().GetAsync(ruleName, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningDataContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); } /// - /// Gets an outbound rule from the managed network of a machine learning workspace. + /// Get container. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name} /// /// /// Operation Id - /// ManagedNetworkSettingsRule_Get + /// DataContainers_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Name of the workspace managed network outbound rule. + /// Container name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningOutboundRuleBasic(string ruleName, CancellationToken cancellationToken = default) + public virtual Response GetMachineLearningDataContainer(string name, CancellationToken cancellationToken = default) { - return GetMachineLearningOutboundRuleBasics().Get(ruleName, cancellationToken); + return GetMachineLearningDataContainers().Get(name, cancellationToken); } - /// Gets a collection of MachineLearningCodeContainerResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningCodeContainerResources and their operations over a MachineLearningCodeContainerResource. - public virtual MachineLearningCodeContainerCollection GetMachineLearningCodeContainers() + /// Gets a collection of MachineLearningEnvironmentContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningEnvironmentContainerResources and their operations over a MachineLearningEnvironmentContainerResource. + public virtual MachineLearningEnvironmentContainerCollection GetMachineLearningEnvironmentContainers() { - return GetCachedClient(client => new MachineLearningCodeContainerCollection(client, Id)); + return GetCachedClient(client => new MachineLearningEnvironmentContainerCollection(client, Id)); } /// @@ -389,19 +430,19 @@ public virtual MachineLearningCodeContainerCollection GetMachineLearningCodeCont /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name} /// /// /// Operation Id - /// CodeContainers_Get + /// EnvironmentContainers_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// @@ -410,9 +451,9 @@ public virtual MachineLearningCodeContainerCollection GetMachineLearningCodeCont /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningCodeContainerAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> GetMachineLearningEnvironmentContainerAsync(string name, CancellationToken cancellationToken = default) { - return await GetMachineLearningCodeContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningEnvironmentContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -420,19 +461,19 @@ public virtual async Task> GetMac /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name} /// /// /// Operation Id - /// CodeContainers_Get + /// EnvironmentContainers_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// @@ -441,16 +482,16 @@ public virtual async Task> GetMac /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningCodeContainer(string name, CancellationToken cancellationToken = default) + public virtual Response GetMachineLearningEnvironmentContainer(string name, CancellationToken cancellationToken = default) { - return GetMachineLearningCodeContainers().Get(name, cancellationToken); + return GetMachineLearningEnvironmentContainers().Get(name, cancellationToken); } - /// Gets a collection of MachineLearningComponentContainerResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningComponentContainerResources and their operations over a MachineLearningComponentContainerResource. - public virtual MachineLearningComponentContainerCollection GetMachineLearningComponentContainers() + /// Gets a collection of MarketplaceSubscriptionResources in the MachineLearningWorkspace. + /// An object representing collection of MarketplaceSubscriptionResources and their operations over a MarketplaceSubscriptionResource. + public virtual MarketplaceSubscriptionCollection GetMarketplaceSubscriptions() { - return GetCachedClient(client => new MachineLearningComponentContainerCollection(client, Id)); + return GetCachedClient(client => new MarketplaceSubscriptionCollection(client, Id)); } /// @@ -458,19 +499,19 @@ public virtual MachineLearningComponentContainerCollection GetMachineLearningCom /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} /// /// /// Operation Id - /// ComponentContainers_Get + /// MarketplaceSubscriptions_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// @@ -479,9 +520,9 @@ public virtual MachineLearningComponentContainerCollection GetMachineLearningCom /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningComponentContainerAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> GetMarketplaceSubscriptionAsync(string name, CancellationToken cancellationToken = default) { - return await GetMachineLearningComponentContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetMarketplaceSubscriptions().GetAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -489,19 +530,19 @@ public virtual async Task> G /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} /// /// /// Operation Id - /// ComponentContainers_Get + /// MarketplaceSubscriptions_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// @@ -510,16 +551,16 @@ public virtual async Task> G /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningComponentContainer(string name, CancellationToken cancellationToken = default) + public virtual Response GetMarketplaceSubscription(string name, CancellationToken cancellationToken = default) { - return GetMachineLearningComponentContainers().Get(name, cancellationToken); + return GetMarketplaceSubscriptions().Get(name, cancellationToken); } - /// Gets a collection of MachineLearningDataContainerResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningDataContainerResources and their operations over a MachineLearningDataContainerResource. - public virtual MachineLearningDataContainerCollection GetMachineLearningDataContainers() + /// Gets a collection of MachineLearningModelContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningModelContainerResources and their operations over a MachineLearningModelContainerResource. + public virtual MachineLearningModelContainerCollection GetMachineLearningModelContainers() { - return GetCachedClient(client => new MachineLearningDataContainerCollection(client, Id)); + return GetCachedClient(client => new MachineLearningModelContainerCollection(client, Id)); } /// @@ -527,30 +568,30 @@ public virtual MachineLearningDataContainerCollection GetMachineLearningDataCont /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name} /// /// /// Operation Id - /// DataContainers_Get + /// ModelContainers_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Container name. + /// Container name. This is case-sensitive. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningDataContainerAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> GetMachineLearningModelContainerAsync(string name, CancellationToken cancellationToken = default) { - return await GetMachineLearningDataContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningModelContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); } /// @@ -558,273 +599,135 @@ public virtual async Task> GetMac /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name} /// /// /// Operation Id - /// DataContainers_Get + /// ModelContainers_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Container name. + /// Container name. This is case-sensitive. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningDataContainer(string name, CancellationToken cancellationToken = default) + public virtual Response GetMachineLearningModelContainer(string name, CancellationToken cancellationToken = default) { - return GetMachineLearningDataContainers().Get(name, cancellationToken); + return GetMachineLearningModelContainers().Get(name, cancellationToken); } - /// Gets a collection of MachineLearningEnvironmentContainerResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningEnvironmentContainerResources and their operations over a MachineLearningEnvironmentContainerResource. - public virtual MachineLearningEnvironmentContainerCollection GetMachineLearningEnvironmentContainers() + /// Gets a collection of MachineLearningBatchEndpointResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningBatchEndpointResources and their operations over a MachineLearningBatchEndpointResource. + public virtual MachineLearningBatchEndpointCollection GetMachineLearningBatchEndpoints() { - return GetCachedClient(client => new MachineLearningEnvironmentContainerCollection(client, Id)); + return GetCachedClient(client => new MachineLearningBatchEndpointCollection(client, Id)); } /// - /// Get container. + /// Gets a batch inference endpoint by name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName} /// /// /// Operation Id - /// EnvironmentContainers_Get + /// BatchEndpoints_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Container name. This is case-sensitive. + /// Name for the Batch Endpoint. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningEnvironmentContainerAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> GetMachineLearningBatchEndpointAsync(string endpointName, CancellationToken cancellationToken = default) { - return await GetMachineLearningEnvironmentContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + return await GetMachineLearningBatchEndpoints().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); } /// - /// Get container. + /// Gets a batch inference endpoint by name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName} /// /// /// Operation Id - /// EnvironmentContainers_Get + /// BatchEndpoints_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Container name. This is case-sensitive. + /// Name for the Batch Endpoint. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetMachineLearningEnvironmentContainer(string name, CancellationToken cancellationToken = default) + public virtual Response GetMachineLearningBatchEndpoint(string endpointName, CancellationToken cancellationToken = default) { - return GetMachineLearningEnvironmentContainers().Get(name, cancellationToken); + return GetMachineLearningBatchEndpoints().Get(endpointName, cancellationToken); } - /// Gets a collection of MachineLearningModelContainerResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningModelContainerResources and their operations over a MachineLearningModelContainerResource. - public virtual MachineLearningModelContainerCollection GetMachineLearningModelContainers() + /// Gets a collection of MachineLearningDatastoreResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningDatastoreResources and their operations over a MachineLearningDatastoreResource. + public virtual MachineLearningDatastoreCollection GetMachineLearningDatastores() { - return GetCachedClient(client => new MachineLearningModelContainerCollection(client, Id)); + return GetCachedClient(client => new MachineLearningDatastoreCollection(client, Id)); } /// - /// Get container. + /// Get datastore. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name} /// /// /// Operation Id - /// ModelContainers_Get + /// Datastores_Get /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource - /// + /// /// /// /// - /// Container name. This is case-sensitive. + /// Datastore name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetMachineLearningModelContainerAsync(string name, CancellationToken cancellationToken = default) - { - return await GetMachineLearningModelContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get container. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name} - /// - /// - /// Operation Id - /// ModelContainers_Get - /// - /// - /// Default Api Version - /// 2024-04-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Container name. This is case-sensitive. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetMachineLearningModelContainer(string name, CancellationToken cancellationToken = default) - { - return GetMachineLearningModelContainers().Get(name, cancellationToken); - } - - /// Gets a collection of MachineLearningBatchEndpointResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningBatchEndpointResources and their operations over a MachineLearningBatchEndpointResource. - public virtual MachineLearningBatchEndpointCollection GetMachineLearningBatchEndpoints() - { - return GetCachedClient(client => new MachineLearningBatchEndpointCollection(client, Id)); - } - - /// - /// Gets a batch inference endpoint by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName} - /// - /// - /// Operation Id - /// BatchEndpoints_Get - /// - /// - /// Default Api Version - /// 2024-04-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Name for the Batch Endpoint. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetMachineLearningBatchEndpointAsync(string endpointName, CancellationToken cancellationToken = default) - { - return await GetMachineLearningBatchEndpoints().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a batch inference endpoint by name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName} - /// - /// - /// Operation Id - /// BatchEndpoints_Get - /// - /// - /// Default Api Version - /// 2024-04-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Name for the Batch Endpoint. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetMachineLearningBatchEndpoint(string endpointName, CancellationToken cancellationToken = default) - { - return GetMachineLearningBatchEndpoints().Get(endpointName, cancellationToken); - } - - /// Gets a collection of MachineLearningDatastoreResources in the MachineLearningWorkspace. - /// An object representing collection of MachineLearningDatastoreResources and their operations over a MachineLearningDatastoreResource. - public virtual MachineLearningDatastoreCollection GetMachineLearningDatastores() - { - return GetCachedClient(client => new MachineLearningDatastoreCollection(client, Id)); - } - - /// - /// Get datastore. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name} - /// - /// - /// Operation Id - /// Datastores_Get - /// - /// - /// Default Api Version - /// 2024-04-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Datastore name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetMachineLearningDatastoreAsync(string name, CancellationToken cancellationToken = default) + public virtual async Task> GetMachineLearningDatastoreAsync(string name, CancellationToken cancellationToken = default) { return await GetMachineLearningDatastores().GetAsync(name, cancellationToken).ConfigureAwait(false); } @@ -842,7 +745,7 @@ public virtual async Task> GetMachine /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -880,7 +783,7 @@ public virtual MachineLearningFeatureSetContainerCollection GetMachineLearningFe /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -911,7 +814,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -949,7 +852,7 @@ public virtual MachineLearningFeatureStoreEntityContainerCollection GetMachineLe /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -980,7 +883,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1018,7 +921,7 @@ public virtual MachineLearningJobCollection GetMachineLearningJobs() /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1049,7 +952,7 @@ public virtual async Task> GetMachineLearni /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1067,75 +970,6 @@ public virtual Response GetMachineLearningJob(string return GetMachineLearningJobs().Get(id, cancellationToken); } - /// Gets a collection of MarketplaceSubscriptionResources in the MachineLearningWorkspace. - /// An object representing collection of MarketplaceSubscriptionResources and their operations over a MarketplaceSubscriptionResource. - public virtual MarketplaceSubscriptionCollection GetMarketplaceSubscriptions() - { - return GetCachedClient(client => new MarketplaceSubscriptionCollection(client, Id)); - } - - /// - /// Get container. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} - /// - /// - /// Operation Id - /// MarketplaceSubscriptions_Get - /// - /// - /// Default Api Version - /// 2024-04-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Container name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetMarketplaceSubscriptionAsync(string name, CancellationToken cancellationToken = default) - { - return await GetMarketplaceSubscriptions().GetAsync(name, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get container. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} - /// - /// - /// Operation Id - /// MarketplaceSubscriptions_Get - /// - /// - /// Default Api Version - /// 2024-04-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Container name. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetMarketplaceSubscription(string name, CancellationToken cancellationToken = default) - { - return GetMarketplaceSubscriptions().Get(name, cancellationToken); - } - /// Gets a collection of MachineLearningOnlineEndpointResources in the MachineLearningWorkspace. /// An object representing collection of MachineLearningOnlineEndpointResources and their operations over a MachineLearningOnlineEndpointResource. public virtual MachineLearningOnlineEndpointCollection GetMachineLearningOnlineEndpoints() @@ -1156,7 +990,7 @@ public virtual MachineLearningOnlineEndpointCollection GetMachineLearningOnlineE /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1187,7 +1021,7 @@ public virtual async Task> GetMa /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1225,7 +1059,7 @@ public virtual MachineLearningScheduleCollection GetMachineLearningSchedules() /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1256,7 +1090,7 @@ public virtual async Task> GetMachineL /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1272,6 +1106,7 @@ public virtual async Task> GetMachineL public virtual Response GetMachineLearningSchedule(string name, CancellationToken cancellationToken = default) { return GetMachineLearningSchedules().Get(name, cancellationToken); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } /// Gets a collection of ServerlessEndpointResources in the MachineLearningWorkspace. @@ -1294,7 +1129,7 @@ public virtual ServerlessEndpointCollection GetServerlessEndpoints() /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1325,7 +1160,7 @@ public virtual async Task> GetServerlessEnd /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1343,48 +1178,1435 @@ public virtual Response GetServerlessEndpoint(string return GetServerlessEndpoints().Get(name, cancellationToken); } + /// Gets a collection of MachineLearningWorkspaceConnectionResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningWorkspaceConnectionResources and their operations over a MachineLearningWorkspaceConnectionResource. + public virtual MachineLearningWorkspaceConnectionCollection GetMachineLearningWorkspaceConnections() + { + return GetCachedClient(client => new MachineLearningWorkspaceConnectionCollection(client, Id)); + } + /// - /// Gets the properties of the specified machine learning workspace. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName} /// /// /// Operation Id - /// Workspaces_Get + /// WorkspaceConnections_Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource - /// + /// /// /// /// + /// Friendly name of the workspace connection. /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningWorkspaceConnectionAsync(string connectionName, CancellationToken cancellationToken = default) { - using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Get"); - scope.Start(); - try - { - var response = await _machineLearningWorkspaceWorkspacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineLearningWorkspaceResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + return await GetMachineLearningWorkspaceConnections().GetAsync(connectionName, cancellationToken).ConfigureAwait(false); } /// - /// Gets the properties of the specified machine learning workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName} + /// + /// + /// Operation Id + /// WorkspaceConnections_Get + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningWorkspaceConnection(string connectionName, CancellationToken cancellationToken = default) + { + return GetMachineLearningWorkspaceConnections().Get(connectionName, cancellationToken); + } + + /// Gets a collection of EndpointResourcePropertiesBasicResources in the MachineLearningWorkspace. + /// An object representing collection of EndpointResourcePropertiesBasicResources and their operations over a EndpointResourcePropertiesBasicResource. + public virtual EndpointResourcePropertiesBasicResourceCollection GetEndpointResourcePropertiesBasicResources() + { + return GetCachedClient(client => new EndpointResourcePropertiesBasicResourceCollection(client, Id)); + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEndpointResourcePropertiesBasicResourceAsync(string endpointName, CancellationToken cancellationToken = default) + { + return await GetEndpointResourcePropertiesBasicResources().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets endpoint resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the endpoint resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEndpointResourcePropertiesBasicResource(string endpointName, CancellationToken cancellationToken = default) + { + return GetEndpointResourcePropertiesBasicResources().Get(endpointName, cancellationToken); + } + + /// Gets a collection of MachineLearningOutboundRuleBasicResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningOutboundRuleBasicResources and their operations over a MachineLearningOutboundRuleBasicResource. + public virtual MachineLearningOutboundRuleBasicCollection GetMachineLearningOutboundRuleBasics() + { + return GetCachedClient(client => new MachineLearningOutboundRuleBasicCollection(client, Id)); + } + + /// + /// Gets an outbound rule from the managed network of a machine learning workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName} + /// + /// + /// Operation Id + /// ManagedNetworkSettingsRule_Get + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the workspace managed network outbound rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningOutboundRuleBasicAsync(string ruleName, CancellationToken cancellationToken = default) + { + return await GetMachineLearningOutboundRuleBasics().GetAsync(ruleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an outbound rule from the managed network of a machine learning workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundRules/{ruleName} + /// + /// + /// Operation Id + /// ManagedNetworkSettingsRule_Get + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the workspace managed network outbound rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningOutboundRuleBasic(string ruleName, CancellationToken cancellationToken = default) + { + return GetMachineLearningOutboundRuleBasics().Get(ruleName, cancellationToken); + } + + /// Gets a collection of MachineLearningCodeContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningCodeContainerResources and their operations over a MachineLearningCodeContainerResource. + public virtual MachineLearningCodeContainerCollection GetMachineLearningCodeContainers() + { + return GetCachedClient(client => new MachineLearningCodeContainerCollection(client, Id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name} + /// + /// + /// Operation Id + /// CodeContainers_Get + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningCodeContainerAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMachineLearningCodeContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes/{name} + /// + /// + /// Operation Id + /// CodeContainers_Get + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningCodeContainer(string name, CancellationToken cancellationToken = default) + { + return GetMachineLearningCodeContainers().Get(name, cancellationToken); + } + + /// Gets a collection of MachineLearningComponentContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningComponentContainerResources and their operations over a MachineLearningComponentContainerResource. + public virtual MachineLearningComponentContainerCollection GetMachineLearningComponentContainers() + { + return GetCachedClient(client => new MachineLearningComponentContainerCollection(client, Id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name} + /// + /// + /// Operation Id + /// ComponentContainers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningComponentContainerAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMachineLearningComponentContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/components/{name} + /// + /// + /// Operation Id + /// ComponentContainers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningComponentContainer(string name, CancellationToken cancellationToken = default) + { + return GetMachineLearningComponentContainers().Get(name, cancellationToken); + } + + /// Gets a collection of MachineLearningDataContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningDataContainerResources and their operations over a MachineLearningDataContainerResource. + public virtual MachineLearningDataContainerCollection GetMachineLearningDataContainers() + { + return GetCachedClient(client => new MachineLearningDataContainerCollection(client, Id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name} + /// + /// + /// Operation Id + /// DataContainers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningDataContainerAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMachineLearningDataContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/data/{name} + /// + /// + /// Operation Id + /// DataContainers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningDataContainer(string name, CancellationToken cancellationToken = default) + { + return GetMachineLearningDataContainers().Get(name, cancellationToken); + } + + /// Gets a collection of MachineLearningEnvironmentContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningEnvironmentContainerResources and their operations over a MachineLearningEnvironmentContainerResource. + public virtual MachineLearningEnvironmentContainerCollection GetMachineLearningEnvironmentContainers() + { + return GetCachedClient(client => new MachineLearningEnvironmentContainerCollection(client, Id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name} + /// + /// + /// Operation Id + /// EnvironmentContainers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningEnvironmentContainerAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMachineLearningEnvironmentContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/environments/{name} + /// + /// + /// Operation Id + /// EnvironmentContainers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningEnvironmentContainer(string name, CancellationToken cancellationToken = default) + { + return GetMachineLearningEnvironmentContainers().Get(name, cancellationToken); + } + + /// Gets a collection of MachineLearningModelContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningModelContainerResources and their operations over a MachineLearningModelContainerResource. + public virtual MachineLearningModelContainerCollection GetMachineLearningModelContainers() + { + return GetCachedClient(client => new MachineLearningModelContainerCollection(client, Id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name} + /// + /// + /// Operation Id + /// ModelContainers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningModelContainerAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMachineLearningModelContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/models/{name} + /// + /// + /// Operation Id + /// ModelContainers_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningModelContainer(string name, CancellationToken cancellationToken = default) + { + return GetMachineLearningModelContainers().Get(name, cancellationToken); + } + + /// Gets a collection of MachineLearningBatchEndpointResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningBatchEndpointResources and their operations over a MachineLearningBatchEndpointResource. + public virtual MachineLearningBatchEndpointCollection GetMachineLearningBatchEndpoints() + { + return GetCachedClient(client => new MachineLearningBatchEndpointCollection(client, Id)); + } + + /// + /// Gets a batch inference endpoint by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName} + /// + /// + /// Operation Id + /// BatchEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name for the Batch Endpoint. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningBatchEndpointAsync(string endpointName, CancellationToken cancellationToken = default) + { + return await GetMachineLearningBatchEndpoints().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a batch inference endpoint by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/batchEndpoints/{endpointName} + /// + /// + /// Operation Id + /// BatchEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Name for the Batch Endpoint. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningBatchEndpoint(string endpointName, CancellationToken cancellationToken = default) + { + return GetMachineLearningBatchEndpoints().Get(endpointName, cancellationToken); + } + + /// Gets a collection of MachineLearningDatastoreResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningDatastoreResources and their operations over a MachineLearningDatastoreResource. + public virtual MachineLearningDatastoreCollection GetMachineLearningDatastores() + { + return GetCachedClient(client => new MachineLearningDatastoreCollection(client, Id)); + } + + /// + /// Get datastore. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name} + /// + /// + /// Operation Id + /// Datastores_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Datastore name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningDatastoreAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMachineLearningDatastores().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get datastore. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/datastores/{name} + /// + /// + /// Operation Id + /// Datastores_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Datastore name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningDatastore(string name, CancellationToken cancellationToken = default) + { + return GetMachineLearningDatastores().Get(name, cancellationToken); + } + + /// Gets a collection of MachineLearningFeatureSetContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningFeatureSetContainerResources and their operations over a MachineLearningFeatureSetContainerResource. + public virtual MachineLearningFeatureSetContainerCollection GetMachineLearningFeatureSetContainers() + { + return GetCachedClient(client => new MachineLearningFeatureSetContainerCollection(client, Id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name} + /// + /// + /// Operation Id + /// FeaturesetContainers_GetEntity + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningFeatureSetContainerAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMachineLearningFeatureSetContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featuresets/{name} + /// + /// + /// Operation Id + /// FeaturesetContainers_GetEntity + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningFeatureSetContainer(string name, CancellationToken cancellationToken = default) + { + return GetMachineLearningFeatureSetContainers().Get(name, cancellationToken); + } + + /// Gets a collection of MachineLearningFeatureStoreEntityContainerResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningFeatureStoreEntityContainerResources and their operations over a MachineLearningFeatureStoreEntityContainerResource. + public virtual MachineLearningFeatureStoreEntityContainerCollection GetMachineLearningFeatureStoreEntityContainers() + { + return GetCachedClient(client => new MachineLearningFeatureStoreEntityContainerCollection(client, Id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name} + /// + /// + /// Operation Id + /// FeaturestoreEntityContainers_GetEntity + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningFeatureStoreEntityContainerAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMachineLearningFeatureStoreEntityContainers().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/featurestoreEntities/{name} + /// + /// + /// Operation Id + /// FeaturestoreEntityContainers_GetEntity + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningFeatureStoreEntityContainer(string name, CancellationToken cancellationToken = default) + { + return GetMachineLearningFeatureStoreEntityContainers().Get(name, cancellationToken); + } + + /// Gets a collection of MachineLearningJobResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningJobResources and their operations over a MachineLearningJobResource. + public virtual MachineLearningJobCollection GetMachineLearningJobs() + { + return GetCachedClient(client => new MachineLearningJobCollection(client, Id)); + } + + /// + /// Gets a Job by name/id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id} + /// + /// + /// Operation Id + /// Jobs_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name and identifier for the Job. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningJobAsync(string id, CancellationToken cancellationToken = default) + { + return await GetMachineLearningJobs().GetAsync(id, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Job by name/id. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/jobs/{id} + /// + /// + /// Operation Id + /// Jobs_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name and identifier for the Job. This is case-sensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningJob(string id, CancellationToken cancellationToken = default) + { + return GetMachineLearningJobs().Get(id, cancellationToken); + } + + /// Gets a collection of MarketplaceSubscriptionResources in the MachineLearningWorkspace. + /// An object representing collection of MarketplaceSubscriptionResources and their operations over a MarketplaceSubscriptionResource. + public virtual MarketplaceSubscriptionCollection GetMarketplaceSubscriptions() + { + return GetCachedClient(client => new MarketplaceSubscriptionCollection(client, Id)); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMarketplaceSubscriptionAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMarketplaceSubscriptions().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get container. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/marketplaceSubscriptions/{name} + /// + /// + /// Operation Id + /// MarketplaceSubscriptions_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Container name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMarketplaceSubscription(string name, CancellationToken cancellationToken = default) + { + return GetMarketplaceSubscriptions().Get(name, cancellationToken); + } + + /// Gets a collection of MachineLearningOnlineEndpointResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningOnlineEndpointResources and their operations over a MachineLearningOnlineEndpointResource. + public virtual MachineLearningOnlineEndpointCollection GetMachineLearningOnlineEndpoints() + { + return GetCachedClient(client => new MachineLearningOnlineEndpointCollection(client, Id)); + } + + /// + /// Get Online Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName} + /// + /// + /// Operation Id + /// OnlineEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Online Endpoint name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningOnlineEndpointAsync(string endpointName, CancellationToken cancellationToken = default) + { + return await GetMachineLearningOnlineEndpoints().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Online Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/onlineEndpoints/{endpointName} + /// + /// + /// Operation Id + /// OnlineEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Online Endpoint name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningOnlineEndpoint(string endpointName, CancellationToken cancellationToken = default) + { + return GetMachineLearningOnlineEndpoints().Get(endpointName, cancellationToken); + } + + /// Gets a collection of MachineLearningScheduleResources in the MachineLearningWorkspace. + /// An object representing collection of MachineLearningScheduleResources and their operations over a MachineLearningScheduleResource. + public virtual MachineLearningScheduleCollection GetMachineLearningSchedules() + { + return GetCachedClient(client => new MachineLearningScheduleCollection(client, Id)); + } + + /// + /// Get schedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name} + /// + /// + /// Operation Id + /// Schedules_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Schedule name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetMachineLearningScheduleAsync(string name, CancellationToken cancellationToken = default) + { + return await GetMachineLearningSchedules().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get schedule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/schedules/{name} + /// + /// + /// Operation Id + /// Schedules_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Schedule name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetMachineLearningSchedule(string name, CancellationToken cancellationToken = default) + { + return GetMachineLearningSchedules().Get(name, cancellationToken); + } + + /// Gets a collection of ServerlessEndpointResources in the MachineLearningWorkspace. + /// An object representing collection of ServerlessEndpointResources and their operations over a ServerlessEndpointResource. + public virtual ServerlessEndpointCollection GetServerlessEndpoints() + { + return GetCachedClient(client => new ServerlessEndpointCollection(client, Id)); + } + + /// + /// Get Serverless Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetServerlessEndpointAsync(string name, CancellationToken cancellationToken = default) + { + return await GetServerlessEndpoints().GetAsync(name, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get Serverless Endpoint. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/serverlessEndpoints/{name} + /// + /// + /// Operation Id + /// ServerlessEndpoints_Get + /// + /// + /// Default Api Version + /// 2024-04-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Serverless Endpoint name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetServerlessEndpoint(string name, CancellationToken cancellationToken = default) + { + return GetServerlessEndpoints().Get(name, cancellationToken); + } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Get"); + scope.Start(); + try + { + var response = await _machineLearningWorkspaceWorkspacesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineLearningWorkspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the properties of the specified machine learning workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Get + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Get"); + scope.Start(); + try + { + var response = _machineLearningWorkspaceWorkspacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MachineLearningWorkspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Delete + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Flag to indicate delete is a purge request. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? forceToPurge = null, CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Delete"); + scope.Start(); + try + { + var response = await _machineLearningWorkspaceWorkspacesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, forceToPurge, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, forceToPurge).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a machine learning workspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Delete + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Flag to indicate delete is a purge request. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceToPurge = null, CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Delete"); + scope.Start(); + try + { + var response = _machineLearningWorkspaceWorkspacesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, forceToPurge, cancellationToken); + var operation = new MachineLearningArmOperation(_machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, forceToPurge).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a machine learning workspace with the specified parameters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// + /// + /// Operation Id + /// Workspaces_Update + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for updating a machine learning workspace. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MachineLearningWorkspacePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Update"); + scope.Start(); + try + { + var response = await _machineLearningWorkspaceWorkspacesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new MachineLearningWorkspaceOperationSource(Client), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a machine learning workspace with the specified parameters. /// /// /// Request Path @@ -1392,11 +2614,120 @@ public virtual async Task> GetAsync(C /// /// /// Operation Id - /// Workspaces_Get + /// Workspaces_Update + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for updating a machine learning workspace. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MachineLearningWorkspacePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Update"); + scope.Start(); + try + { + var response = _machineLearningWorkspaceWorkspacesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new MachineLearningArmOperation(new MachineLearningWorkspaceOperationSource(Client), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// +<<<<<<< HEAD +======= + /// Lists all enabled features for a workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features + /// + /// + /// Operation Id + /// WorkspaceFeatures_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetWorkspaceFeaturesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceFeaturesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceFeaturesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => MachineLearningUserFeature.DeserializeMachineLearningUserFeature(e), _workspaceFeaturesClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetWorkspaceFeatures", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all enabled features for a workspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features + /// + /// + /// Operation Id + /// WorkspaceFeatures_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetWorkspaceFeatures(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceFeaturesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceFeaturesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => MachineLearningUserFeature.DeserializeMachineLearningUserFeature(e), _workspaceFeaturesClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetWorkspaceFeatures", "value", "nextLink", cancellationToken); + } + + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// Diagnose workspace setup issue. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose + /// + /// + /// Operation Id + /// Workspaces_Diagnose /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -1404,17 +2735,230 @@ public virtual async Task> GetAsync(C /// /// /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameter of diagnosing workspace health. /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual async Task> DiagnoseAsync(WaitUntil waitUntil, MachineLearningWorkspaceDiagnoseContent content = null, CancellationToken cancellationToken = default) { - using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Get"); + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Diagnose"); + scope.Start(); + try + { + var response = await _machineLearningWorkspaceWorkspacesRestClient.DiagnoseAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new MachineLearningWorkspaceDiagnoseResultOperationSource(), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateDiagnoseRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Diagnose workspace setup issue. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose + /// + /// + /// Operation Id + /// Workspaces_Diagnose + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameter of diagnosing workspace health. + /// The cancellation token to use. + public virtual ArmOperation Diagnose(WaitUntil waitUntil, MachineLearningWorkspaceDiagnoseContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Diagnose"); + scope.Start(); + try + { + var response = _machineLearningWorkspaceWorkspacesRestClient.Diagnose(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new MachineLearningArmOperation(new MachineLearningWorkspaceDiagnoseResultOperationSource(), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateDiagnoseRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys + /// + /// + /// Operation Id + /// Workspaces_ListKeys + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetKeysAsync(CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetKeys"); + scope.Start(); + try + { + var response = await _machineLearningWorkspaceWorkspacesRestClient.ListKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys + /// + /// + /// Operation Id + /// Workspaces_ListKeys + /// + /// + /// Default Api Version +<<<<<<< HEAD + /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetKeys(CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetKeys"); + scope.Start(); + try + { + var response = _machineLearningWorkspaceWorkspacesRestClient.ListKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// +<<<<<<< HEAD + /// Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry +======= + /// Get Azure Machine Learning Workspace notebook access token + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken + /// + /// + /// Operation Id + /// Workspaces_ListNotebookAccessToken + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetNotebookAccessTokenAsync(CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetNotebookAccessToken"); + scope.Start(); + try + { + var response = await _machineLearningWorkspaceWorkspacesRestClient.ListNotebookAccessTokenAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get Azure Machine Learning Workspace notebook access token + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookAccessToken + /// + /// + /// Operation Id + /// Workspaces_ListNotebookAccessToken + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetNotebookAccessToken(CancellationToken cancellationToken = default) + { + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetNotebookAccessToken"); scope.Start(); try { - var response = _machineLearningWorkspaceWorkspacesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineLearningWorkspaceResource(Client, response.Value), response.GetRawResponse()); + var response = _machineLearningWorkspaceWorkspacesRestClient.ListNotebookAccessToken(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; } catch (Exception e) { @@ -1424,19 +2968,19 @@ public virtual Response Get(CancellationToken } /// - /// Deletes a machine learning workspace. + /// Lists keys of Azure Machine Learning Workspaces notebook. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys /// /// /// Operation Id - /// Workspaces_Delete + /// Workspaces_ListNotebookKeys /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1444,20 +2988,15 @@ public virtual Response Get(CancellationToken /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Flag to indicate delete is a purge request. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? forceToPurge = null, CancellationToken cancellationToken = default) + public virtual async Task> GetNotebookKeysAsync(CancellationToken cancellationToken = default) { - using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Delete"); + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetNotebookKeys"); scope.Start(); try { - var response = await _machineLearningWorkspaceWorkspacesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, forceToPurge, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(_machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, forceToPurge).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; + var response = await _machineLearningWorkspaceWorkspacesRestClient.ListNotebookKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; } catch (Exception e) { @@ -1467,19 +3006,19 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f } /// - /// Deletes a machine learning workspace. + /// Lists keys of Azure Machine Learning Workspaces notebook. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listNotebookKeys /// /// /// Operation Id - /// Workspaces_Delete + /// Workspaces_ListNotebookKeys /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1487,20 +3026,15 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? f /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Flag to indicate delete is a purge request. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceToPurge = null, CancellationToken cancellationToken = default) + public virtual Response GetNotebookKeys(CancellationToken cancellationToken = default) { - using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Delete"); + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetNotebookKeys"); scope.Start(); try { - var response = _machineLearningWorkspaceWorkspacesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, forceToPurge, cancellationToken); - var operation = new MachineLearningArmOperation(_machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, forceToPurge).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; + var response = _machineLearningWorkspaceWorkspacesRestClient.ListNotebookKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; } catch (Exception e) { @@ -1510,19 +3044,19 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceToPurge = nul } /// - /// Updates a machine learning workspace with the specified parameters. + /// Lists keys of Azure Machine Learning Workspace's storage account. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys /// /// /// Operation Id - /// Workspaces_Update + /// Workspaces_ListStorageAccountKeys /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1530,23 +3064,15 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceToPurge = nul /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for updating a machine learning workspace. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, MachineLearningWorkspacePatch patch, CancellationToken cancellationToken = default) + public virtual async Task> GetStorageAccountKeysAsync(CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Update"); + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetStorageAccountKeys"); scope.Start(); try { - var response = await _machineLearningWorkspaceWorkspacesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new MachineLearningWorkspaceOperationSource(Client), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; + var response = await _machineLearningWorkspaceWorkspacesRestClient.ListStorageAccountKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; } catch (Exception e) { @@ -1556,19 +3082,19 @@ public virtual async Task> Update } /// - /// Updates a machine learning workspace with the specified parameters. + /// Lists keys of Azure Machine Learning Workspace's storage account. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listStorageAccountKeys /// /// /// Operation Id - /// Workspaces_Update + /// Workspaces_ListStorageAccountKeys /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1576,23 +3102,15 @@ public virtual async Task> Update /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for updating a machine learning workspace. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, MachineLearningWorkspacePatch patch, CancellationToken cancellationToken = default) + public virtual Response GetStorageAccountKeys(CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Update"); + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetStorageAccountKeys"); scope.Start(); try { - var response = _machineLearningWorkspaceWorkspacesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new MachineLearningArmOperation(new MachineLearningWorkspaceOperationSource(Client), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; + var response = _machineLearningWorkspaceWorkspacesRestClient.ListStorageAccountKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; } catch (Exception e) { @@ -1602,19 +3120,19 @@ public virtual ArmOperation Update(WaitUntil w } /// - /// Diagnose workspace setup issue. + /// Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints /// /// /// Operation Id - /// Workspaces_Diagnose + /// Workspaces_ListOutboundNetworkDependenciesEndpoints /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1622,42 +3140,28 @@ public virtual ArmOperation Update(WaitUntil w /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameter of diagnosing workspace health. /// The cancellation token to use. - public virtual async Task> DiagnoseAsync(WaitUntil waitUntil, MachineLearningWorkspaceDiagnoseContent content = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetOutboundNetworkDependenciesEndpointsAsync(CancellationToken cancellationToken = default) { - using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Diagnose"); - scope.Start(); - try - { - var response = await _machineLearningWorkspaceWorkspacesRestClient.DiagnoseAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new MachineLearningArmOperation(new MachineLearningWorkspaceDiagnoseResultOperationSource(), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateDiagnoseRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => MachineLearningFqdnEndpoints.DeserializeMachineLearningFqdnEndpoints(e), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetOutboundNetworkDependenciesEndpoints", "value", null, cancellationToken); } /// - /// Diagnose workspace setup issue. + /// Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/diagnose + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/outboundNetworkDependenciesEndpoints /// /// /// Operation Id - /// Workspaces_Diagnose + /// Workspaces_ListOutboundNetworkDependenciesEndpoints /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1665,42 +3169,28 @@ public virtual async Task> /// /// /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameter of diagnosing workspace health. /// The cancellation token to use. - public virtual ArmOperation Diagnose(WaitUntil waitUntil, MachineLearningWorkspaceDiagnoseContent content = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetOutboundNetworkDependenciesEndpoints(CancellationToken cancellationToken = default) { - using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.Diagnose"); - scope.Start(); - try - { - var response = _machineLearningWorkspaceWorkspacesRestClient.Diagnose(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new MachineLearningArmOperation(new MachineLearningWorkspaceDiagnoseResultOperationSource(), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreateDiagnoseRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => _machineLearningWorkspaceWorkspacesRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => MachineLearningFqdnEndpoints.DeserializeMachineLearningFqdnEndpoints(e), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetOutboundNetworkDependenciesEndpoints", "value", null, cancellationToken); } /// - /// Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry + /// Prepare Azure Machine Learning Workspace's notebook resource /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook /// /// /// Operation Id - /// Workspaces_ListKeys + /// Workspaces_PrepareNotebook /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1708,15 +3198,19 @@ public virtual ArmOperation Diagnose(Wai /// /// /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual async Task> GetKeysAsync(CancellationToken cancellationToken = default) + public virtual async Task> PrepareNotebookAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetKeys"); + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.PrepareNotebook"); scope.Start(); try { - var response = await _machineLearningWorkspaceWorkspacesRestClient.ListKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return response; + var response = await _machineLearningWorkspaceWorkspacesRestClient.PrepareNotebookAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new MachineLearningNotebookResourceInfoOperationSource(), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreatePrepareNotebookRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; } catch (Exception e) { @@ -1726,19 +3220,19 @@ public virtual async Task> GetKe } /// - /// Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry + /// Prepare Azure Machine Learning Workspace's notebook resource /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listKeys + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook /// /// /// Operation Id - /// Workspaces_ListKeys + /// Workspaces_PrepareNotebook /// /// /// Default Api Version - /// 2024-04-01 + /// 2024-07-01-preview /// /// /// Resource @@ -1746,15 +3240,19 @@ public virtual async Task> GetKe /// /// /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. /// The cancellation token to use. - public virtual Response GetKeys(CancellationToken cancellationToken = default) + public virtual ArmOperation PrepareNotebook(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetKeys"); + using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.PrepareNotebook"); scope.Start(); try { - var response = _machineLearningWorkspaceWorkspacesRestClient.ListKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return response; + var response = _machineLearningWorkspaceWorkspacesRestClient.PrepareNotebook(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(new MachineLearningNotebookResourceInfoOperationSource(), _machineLearningWorkspaceWorkspacesClientDiagnostics, Pipeline, _machineLearningWorkspaceWorkspacesRestClient.CreatePrepareNotebookRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; } catch (Exception e) { @@ -1764,7 +3262,8 @@ public virtual Response GetKeys(Cancellat } /// - /// Resync all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry + /// Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and password for container registry +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Request Path @@ -1776,7 +3275,11 @@ public virtual Response GetKeys(Cancellat /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -1818,7 +3321,11 @@ public virtual async Task ResyncKeysAsync(WaitUntil waitUntil, Can /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -1848,6 +3355,7 @@ public virtual ArmOperation ResyncKeys(WaitUntil waitUntil, CancellationToken ca } /// +<<<<<<< HEAD /// return notebook access token and refresh token /// /// @@ -1865,10 +3373,30 @@ public virtual ArmOperation ResyncKeys(WaitUntil waitUntil, CancellationToken ca /// /// Resource /// +======= + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels + /// + /// + /// Operation Id + /// Connection_ListModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// /// The cancellation token to use. +<<<<<<< HEAD public virtual async Task> GetNotebookAccessTokenAsync(CancellationToken cancellationToken = default) { using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetNotebookAccessToken"); @@ -1903,10 +3431,38 @@ public virtual async Task /// Resource /// +======= + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetModelsConnectionsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetModelsConnections", "value", null, cancellationToken); + } + + /// + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/listConnectionModels + /// + /// + /// Operation Id + /// Connection_ListModels + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// /// The cancellation token to use. +<<<<<<< HEAD public virtual Response GetNotebookAccessToken(CancellationToken cancellationToken = default) { using var scope = _machineLearningWorkspaceWorkspacesClientDiagnostics.CreateScope("MachineLearningWorkspaceResource.GetNotebookAccessToken"); @@ -2219,6 +3775,85 @@ public virtual Pageable GetOutboundNetworkDependen /// /// Gets the private link resources that need to be created for a workspace. +======= + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetModelsConnections(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListModelsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => EndpointModelProperties.DeserializeEndpointModelProperties(e), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetModelsConnections", "value", null, cancellationToken); + } + + /// + /// Get all the deployments under the workspace scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_GetInWorkspace + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetInWorkspaceEndpointDeploymentsAsync(EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetInWorkspaceEndpointDeployments", "value", "nextLink", cancellationToken); + } + + /// + /// Get all the deployments under the workspace scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_GetInWorkspace + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetInWorkspaceEndpointDeployments(EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateGetInWorkspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, endpointType, skip); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "MachineLearningWorkspaceResource.GetInWorkspaceEndpointDeployments", "value", "nextLink", cancellationToken); + } + + /// + /// Called by Client (Portal, CLI, etc) to get available "private link resources" for the workspace. + /// Each "private link resource" is a connection endpoint (IP address) to the resource. + /// Pre single connection endpoint per workspace: the Data Plane IP address, returned by DNS resolution. + /// Other RPs, such as Azure Storage, have multiple - one for Blobs, other for Queues, etc. + /// Defined in the "[NRP] Private Endpoint Design" doc, topic "GET API for GroupIds". +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Request Path @@ -2230,7 +3865,11 @@ public virtual Pageable GetOutboundNetworkDependen /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -2255,7 +3894,11 @@ public virtual AsyncPageable GetPrivateLinkR /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -2280,7 +3923,11 @@ public virtual Pageable GetPrivateLinkResour /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -2319,7 +3966,11 @@ public virtual async Task> Provision /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// @@ -2410,7 +4061,11 @@ public virtual Pageable GetWorkspaceFeatures(Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -2472,7 +4127,11 @@ public virtual async Task> AddTagAsyn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -2534,7 +4193,11 @@ public virtual Response AddTag(string key, str /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -2591,7 +4254,11 @@ public virtual async Task> SetTagsAsy /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -2648,7 +4315,11 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -2708,7 +4379,11 @@ public virtual async Task> RemoveTagA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs index b9cc47d59ba6..51b00f977010 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task> CreateO /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation CreateOrUpdate(Wait /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task> GetAsync(st /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(string name, Cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -283,7 +303,11 @@ public virtual AsyncPageable GetAllAsync(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -314,7 +338,11 @@ public virtual Pageable GetAll(string skip = nu /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -357,7 +385,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -400,7 +432,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -445,7 +481,11 @@ public virtual async Task> Get /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs index 130cf9b54330..ed858c930323 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/MarketplaceSubscriptionResource.cs @@ -101,7 +101,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -141,7 +145,11 @@ public virtual async Task> GetAsync(Ca /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -181,7 +189,11 @@ public virtual Response Get(CancellationToken c /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -223,7 +235,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -265,7 +281,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -311,7 +331,11 @@ public virtual async Task> UpdateA /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs index 73d9a9dcc9a3..26cf55fea7db 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -38,6 +38,14 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); @@ -53,11 +61,14 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); } +<<<<<<< HEAD if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -69,6 +80,19 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteEndObject(); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(SharedUserList)) { writer.WritePropertyName("sharedUserList"u8); @@ -79,6 +103,7 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteEndArray(); } +<<<<<<< HEAD if (Optional.IsDefined(Value)) { writer.WritePropertyName("value"u8); @@ -88,6 +113,17 @@ void IJsonModel.Write(Utf8JsonWriter w { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -130,6 +166,7 @@ internal static AadAuthTypeWorkspaceConnectionProperties DeserializeAadAuthTypeW MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -138,6 +175,18 @@ internal static AadAuthTypeWorkspaceConnectionProperties DeserializeAadAuthTypeW IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -165,6 +214,14 @@ internal static AadAuthTypeWorkspaceConnectionProperties DeserializeAadAuthTypeW createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -192,11 +249,14 @@ internal static AadAuthTypeWorkspaceConnectionProperties DeserializeAadAuthTypeW isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -211,6 +271,27 @@ internal static AadAuthTypeWorkspaceConnectionProperties DeserializeAadAuthTypeW metadata = dictionary; continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("sharedUserList"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -225,18 +306,31 @@ internal static AadAuthTypeWorkspaceConnectionProperties DeserializeAadAuthTypeW sharedUserList = array; continue; } +<<<<<<< HEAD if (property.NameEquals("value"u8)) { value = property.Value.GetString(); continue; } if (property.NameEquals("valueFormat"u8)) +======= + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } +<<<<<<< HEAD valueFormat = new MachineLearningValueFormat(property.Value.GetString()); +======= + useWorkspaceManagedIdentity = property.Value.GetBoolean(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (options.Format != "W") @@ -249,6 +343,7 @@ internal static AadAuthTypeWorkspaceConnectionProperties DeserializeAadAuthTypeW authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -257,6 +352,18 @@ internal static AadAuthTypeWorkspaceConnectionProperties DeserializeAadAuthTypeW sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs index 7be1d29bd2d5..a3f3237dae39 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AadAuthTypeWorkspaceConnectionProperties.cs @@ -24,6 +24,7 @@ public AadAuthTypeWorkspaceConnectionProperties() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -34,6 +35,20 @@ public AadAuthTypeWorkspaceConnectionProperties() /// format for the workspace connection value. /// Keeps track of any properties unknown to the library. internal AadAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal AadAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { AuthType = authType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs index f804cd30d408..3e15bbd8fae8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -43,12 +43,21 @@ void IJsonModel.Write(Utf8JsonWr writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -57,12 +66,54 @@ void IJsonModel.Write(Utf8JsonWr { writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); +======= + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -93,6 +144,12 @@ void IJsonModel.Write(Utf8JsonWr { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -136,6 +193,7 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -144,6 +202,18 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -180,6 +250,14 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,11 +285,14 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -224,6 +305,41 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess dictionary.Add(property0.Name, property0.Value.GetString()); } metadata = dictionary; +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("sharedUserList"u8)) @@ -254,6 +370,15 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess valueFormat = new MachineLearningValueFormat(property.Value.GetString()); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -264,6 +389,7 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -272,6 +398,18 @@ internal static AccessKeyAuthTypeWorkspaceConnectionProperties DeserializeAccess sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs index 4141cefa1657..58232daa476f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccessKeyAuthTypeWorkspaceConnectionProperties.cs @@ -24,6 +24,7 @@ public AccessKeyAuthTypeWorkspaceConnectionProperties() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -35,6 +36,21 @@ public AccessKeyAuthTypeWorkspaceConnectionProperties() /// Keeps track of any properties unknown to the library. /// internal AccessKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData, WorkspaceConnectionAccessKey credentials) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal AccessKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionAccessKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.Serialization.cs new file mode 100644 index 000000000000..bd95d002cfea --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AccountApiKeys : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Key1)) + { + writer.WritePropertyName("key1"u8); + writer.WriteStringValue(Key1); + } + if (Optional.IsDefined(Key2)) + { + writer.WritePropertyName("key2"u8); + writer.WriteStringValue(Key2); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AccountApiKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountApiKeys(document.RootElement, options); + } + + internal static AccountApiKeys DeserializeAccountApiKeys(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string key1 = default; + string key2 = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("key1"u8)) + { + key1 = property.Value.GetString(); + continue; + } + if (property.NameEquals("key2"u8)) + { + key2 = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountApiKeys(key1, key2, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support writing '{options.Format}' format."); + } + } + + AccountApiKeys IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccountApiKeys(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountApiKeys)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs new file mode 100644 index 000000000000..a5eba1ae4883 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs + /// Response payload for creating a backfill request for a given feature set version. + public partial class FeaturesetVersionBackfillResponse +======== + /// The AccountApiKeys. + public partial class AccountApiKeys +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs + /// Initializes a new instance of . + internal FeaturesetVersionBackfillResponse() +======== + /// Initializes a new instance of . + internal AccountApiKeys() +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs + { + JobIds = new ChangeTrackingList(); + } + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs + /// Initializes a new instance of . + /// List of jobs submitted as part of the backfill request. + /// Keeps track of any properties unknown to the library. + internal FeaturesetVersionBackfillResponse(IReadOnlyList jobIds, IDictionary serializedAdditionalRawData) + { + JobIds = jobIds; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of jobs submitted as part of the backfill request. + public IReadOnlyList JobIds { get; } +======== + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal AccountApiKeys(string key1, string key2, IDictionary serializedAdditionalRawData) + { + Key1 = key1; + Key2 = key2; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the key 1. + public string Key1 { get; } + /// Gets the key 2. + public string Key2 { get; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs index 80f7be11fa89..89ea55343c4f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -43,6 +43,14 @@ void IJsonModel.Write(Utf8JsonW writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); @@ -58,11 +66,14 @@ void IJsonModel.Write(Utf8JsonW writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); } +<<<<<<< HEAD if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -74,6 +85,19 @@ void IJsonModel.Write(Utf8JsonW } writer.WriteEndObject(); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(SharedUserList)) { writer.WritePropertyName("sharedUserList"u8); @@ -84,6 +108,7 @@ void IJsonModel.Write(Utf8JsonW } writer.WriteEndArray(); } +<<<<<<< HEAD if (Optional.IsDefined(Value)) { writer.WritePropertyName("value"u8); @@ -93,6 +118,17 @@ void IJsonModel.Write(Utf8JsonW { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -136,6 +172,7 @@ internal static AccountKeyAuthTypeWorkspaceConnectionProperties DeserializeAccou MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -144,6 +181,18 @@ internal static AccountKeyAuthTypeWorkspaceConnectionProperties DeserializeAccou IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -180,6 +229,14 @@ internal static AccountKeyAuthTypeWorkspaceConnectionProperties DeserializeAccou createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,11 +264,14 @@ internal static AccountKeyAuthTypeWorkspaceConnectionProperties DeserializeAccou isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -226,6 +286,27 @@ internal static AccountKeyAuthTypeWorkspaceConnectionProperties DeserializeAccou metadata = dictionary; continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("sharedUserList"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -240,18 +321,31 @@ internal static AccountKeyAuthTypeWorkspaceConnectionProperties DeserializeAccou sharedUserList = array; continue; } +<<<<<<< HEAD if (property.NameEquals("value"u8)) { value = property.Value.GetString(); continue; } if (property.NameEquals("valueFormat"u8)) +======= + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } +<<<<<<< HEAD valueFormat = new MachineLearningValueFormat(property.Value.GetString()); +======= + useWorkspaceManagedIdentity = property.Value.GetBoolean(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (options.Format != "W") @@ -264,6 +358,7 @@ internal static AccountKeyAuthTypeWorkspaceConnectionProperties DeserializeAccou authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -272,6 +367,18 @@ internal static AccountKeyAuthTypeWorkspaceConnectionProperties DeserializeAccou sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs index ee043bd7bf8e..5fe56a078ed2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountKeyAuthTypeWorkspaceConnectionProperties.cs @@ -24,6 +24,7 @@ public AccountKeyAuthTypeWorkspaceConnectionProperties() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -35,12 +36,31 @@ public AccountKeyAuthTypeWorkspaceConnectionProperties() /// Keeps track of any properties unknown to the library. /// internal AccountKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData, WorkspaceConnectionAccountKey credentials) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// Account key object for workspace connection credential. + internal AccountKeyAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionAccountKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Credentials = credentials; AuthType = authType; } +<<<<<<< HEAD /// Gets or sets the credentials. +======= + /// Account key object for workspace connection credential. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 internal WorkspaceConnectionAccountKey Credentials { get; set; } /// Gets or sets the credentials key. public string CredentialsKey diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AllowedContentLevel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AllowedContentLevel.cs new file mode 100644 index 000000000000..198e01da20db --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AllowedContentLevel.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Level at which content is filtered. + public readonly partial struct AllowedContentLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AllowedContentLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LowValue = "Low"; + private const string MediumValue = "Medium"; + private const string HighValue = "High"; + + /// Low. + public static AllowedContentLevel Low { get; } = new AllowedContentLevel(LowValue); + /// Medium. + public static AllowedContentLevel Medium { get; } = new AllowedContentLevel(MediumValue); + /// High. + public static AllowedContentLevel High { get; } = new AllowedContentLevel(HighValue); + /// Determines if two values are the same. + public static bool operator ==(AllowedContentLevel left, AllowedContentLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AllowedContentLevel left, AllowedContentLevel right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AllowedContentLevel(string value) => new AllowedContentLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AllowedContentLevel other && Equals(other); + /// + public bool Equals(AllowedContentLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs index 9350d73c2fe3..6d08b81219d7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs @@ -13,6 +13,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs public partial class AnonymousAccessCredential : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -28,6 +29,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteStartObject(); writer.WritePropertyName("credentialType"u8); writer.WriteStringValue(CredentialType.ToString()); +======== + public partial class EndpointKeys : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointKeys)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Keys)) + { + writer.WritePropertyName("keys"u8); + writer.WriteObjectValue(Keys, options); + } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -46,6 +67,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs AnonymousAccessCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -59,6 +81,21 @@ AnonymousAccessCredential IJsonModel.Create(ref Utf8J } internal static AnonymousAccessCredential DeserializeAnonymousAccessCredential(JsonElement element, ModelReaderWriterOptions options = null) +======== + EndpointKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointKeys)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointKeys(document.RootElement, options); + } + + internal static EndpointKeys DeserializeEndpointKeys(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs { options ??= ModelSerializationExtensions.WireOptions; @@ -66,14 +103,28 @@ internal static AnonymousAccessCredential DeserializeAnonymousAccessCredential(J { return null; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs DataReferenceCredentialType credentialType = default; +======== + AccountApiKeys keys = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs if (property.NameEquals("credentialType"u8)) { credentialType = new DataReferenceCredentialType(property.Value.GetString()); +======== + if (property.NameEquals("keys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keys = AccountApiKeys.DeserializeAccountApiKeys(property.Value, options); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs continue; } if (options.Format != "W") @@ -82,18 +133,28 @@ internal static AnonymousAccessCredential DeserializeAnonymousAccessCredential(J } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs return new AnonymousAccessCredential(credentialType, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new EndpointKeys(keys, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support writing '{options.Format}' format."); } } @@ -101,12 +162,22 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO AnonymousAccessCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(EndpointKeys)} does not support writing '{options.Format}' format."); + } + } + + EndpointKeys IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs return DeserializeAnonymousAccessCredential(document.RootElement, options); } default: @@ -115,5 +186,15 @@ AnonymousAccessCredential IPersistableModel.Create(Bi } string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeEndpointKeys(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointKeys)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs index fa8a17b270b4..7ac1daae72a0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.Serialization.cs @@ -43,12 +43,21 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -57,12 +66,54 @@ void IJsonModel.Write(Utf8JsonWriter wr { writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); +======= + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -93,6 +144,12 @@ void IJsonModel.Write(Utf8JsonWriter wr { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -136,6 +193,7 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -144,6 +202,18 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -180,6 +250,14 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,11 +285,14 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -224,6 +305,41 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor dictionary.Add(property0.Name, property0.Value.GetString()); } metadata = dictionary; +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("sharedUserList"u8)) @@ -254,6 +370,15 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor valueFormat = new MachineLearningValueFormat(property.Value.GetString()); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -264,6 +389,7 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -272,6 +398,18 @@ internal static ApiKeyAuthWorkspaceConnectionProperties DeserializeApiKeyAuthWor sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs index 91130dd5975d..a511e6e749a3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ApiKeyAuthWorkspaceConnectionProperties.cs @@ -45,6 +45,7 @@ public ApiKeyAuthWorkspaceConnectionProperties() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -56,6 +57,21 @@ public ApiKeyAuthWorkspaceConnectionProperties() /// Keeps track of any properties unknown to the library. /// Api key object for workspace connection credential. internal ApiKeyAuthWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData, WorkspaceConnectionApiKey credentials) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// Api key object for workspace connection credential. + internal ApiKeyAuthWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionApiKey credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs index 658fb31d642a..4dbdfcce3aff 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.Serialization.cs @@ -117,6 +117,40 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions writer.WritePropertyName("experimentName"u8); writer.WriteStringValue(ExperimentName); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Identity)) + { + if (Identity != null) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + else + { + writer.WriteNull("identity"); + } + } + if (Optional.IsDefined(IsArchived)) + { + writer.WritePropertyName("isArchived"u8); + writer.WriteBooleanValue(IsArchived.Value); + } + writer.WritePropertyName("jobType"u8); + writer.WriteStringValue(JobType.ToString()); + if (Optional.IsDefined(NotificationSetting)) + { + if (NotificationSetting != null) + { + writer.WritePropertyName("notificationSetting"u8); + writer.WriteObjectValue(NotificationSetting, options); + } + else + { + writer.WriteNull("notificationSetting"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -281,7 +315,12 @@ internal static AutoMLJob DeserializeAutoMLJob(JsonElement element, ModelReaderW IDictionary outputs = default; JobQueueSettings queueSettings = default; JobType jobType = default; +<<<<<<< HEAD string displayName = default; +======= + NotificationSetting notificationSetting = default; + IDictionary services = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningJobStatus? status = default; string experimentName = default; IDictionary services = default; @@ -390,6 +429,43 @@ internal static AutoMLJob DeserializeAutoMLJob(JsonElement element, ModelReaderW experimentName = property.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + identity = null; + continue; + } + identity = MachineLearningIdentityConfiguration.DeserializeMachineLearningIdentityConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("isArchived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isArchived = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new JobType(property.Value.GetString()); + continue; + } + if (property.NameEquals("notificationSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationSetting = null; + continue; + } + notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -506,7 +582,12 @@ internal static AutoMLJob DeserializeAutoMLJob(JsonElement element, ModelReaderW properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, jobType, +<<<<<<< HEAD displayName, +======= + notificationSetting, + services ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 status, experimentName, services ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs index 8a549838bfbc..92ab0c15cc1c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLJob.cs @@ -58,7 +58,15 @@ public AutoMLJob(AutoMLVertical taskDetails) /// /// ARM resource ID of the component resource. /// Notification setting for the job. +<<<<<<< HEAD /// Compute Resource configuration for the job. +======= + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// The ARM resource ID of the Environment specification for the job. /// This is optional value to provide, if not provided, AutoML will default this to Production AutoML curated environment version when running the job. @@ -75,7 +83,17 @@ public AutoMLJob(AutoMLVertical taskDetails) /// The available derived classes include , , , , and . /// /// Queue settings for the job. +<<<<<<< HEAD internal AutoMLJob(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, JobType jobType, string displayName, MachineLearningJobStatus? status, string experimentName, IDictionary services, ResourceIdentifier computeId, bool? isArchived, MachineLearningIdentityConfiguration identity, ResourceIdentifier componentId, NotificationSetting notificationSetting, MachineLearningJobResourceConfiguration resources, string environmentId, IDictionary environmentVariables, AutoMLVertical taskDetails, IDictionary outputs, JobQueueSettings queueSettings) : base(description, tags, properties, serializedAdditionalRawData, jobType, displayName, status, experimentName, services, computeId, isArchived, identity, componentId, notificationSetting) +======= + /// Compute Resource configuration for the job. + /// + /// [Required] This represents scenario which can be one of Tables/NLP/Image + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , and . + /// + internal AutoMLJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, string environmentId, IDictionary environmentVariables, IDictionary outputs, JobQueueSettings queueSettings, MachineLearningJobResourceConfiguration resources, AutoMLVertical taskDetails) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Resources = resources; EnvironmentId = environmentId; @@ -125,5 +143,17 @@ public JobTier? QueueJobTier QueueSettings.JobTier = value; } } +<<<<<<< HEAD +======= + + /// Compute Resource configuration for the job. + public MachineLearningJobResourceConfiguration Resources { get; set; } + /// + /// [Required] This represents scenario which can be one of Tables/NLP/Image + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , and . + /// + public AutoMLVertical TaskDetails { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs index d432e6c0b647..26c612042506 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.Serialization.cs @@ -43,6 +43,38 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteNull("trainingSettings"); } } +<<<<<<< HEAD +======= + if (Optional.IsCollectionDefined(CvSplitColumnNames)) + { + if (CvSplitColumnNames != null) + { + writer.WritePropertyName("cvSplitColumnNames"u8); + writer.WriteStartArray(); + foreach (var item in CvSplitColumnNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("cvSplitColumnNames"); + } + } + if (Optional.IsDefined(FeaturizationSettings)) + { + if (FeaturizationSettings != null) + { + writer.WritePropertyName("featurizationSettings"u8); + writer.WriteObjectValue(FeaturizationSettings, options); + } + else + { + writer.WriteNull("featurizationSettings"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -67,6 +99,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteNull("nCrossValidations"); } } +<<<<<<< HEAD if (Optional.IsCollectionDefined(CvSplitColumnNames)) { if (CvSplitColumnNames != null) @@ -82,6 +115,54 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead else { writer.WriteNull("cvSplitColumnNames"); +======= + if (Optional.IsDefined(TestData)) + { + if (TestData != null) + { + writer.WritePropertyName("testData"u8); + writer.WriteObjectValue(TestData, options); + } + else + { + writer.WriteNull("testData"); + } + } + if (Optional.IsDefined(TestDataSize)) + { + if (TestDataSize != null) + { + writer.WritePropertyName("testDataSize"u8); + writer.WriteNumberValue(TestDataSize.Value); + } + else + { + writer.WriteNull("testDataSize"); + } + } + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + if (Optional.IsDefined(ValidationDataSize)) + { + if (ValidationDataSize != null) + { + writer.WritePropertyName("validationDataSize"u8); + writer.WriteNumberValue(ValidationDataSize.Value); + } + else + { + writer.WriteNull("validationDataSize"); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } if (Optional.IsDefined(WeightColumnName)) @@ -217,9 +298,20 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso } AutoMLVerticalRegressionPrimaryMetric? primaryMetric = default; RegressionTrainingSettings trainingSettings = default; +<<<<<<< HEAD TableVerticalLimitSettings limitSettings = default; NCrossValidations nCrossValidations = default; IList cvSplitColumnNames = default; +======= + IList cvSplitColumnNames = default; + TableVerticalFeaturizationSettings featurizationSettings = default; + TableVerticalLimitSettings limitSettings = default; + NCrossValidations nCrossValidations = default; + MachineLearningTableJobInput testData = default; + double? testDataSize = default; + MachineLearningTableJobInput validationData = default; + double? validationDataSize = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 string weightColumnName = default; MachineLearningTableJobInput validationData = default; MachineLearningTableJobInput testData = default; @@ -253,6 +345,34 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso trainingSettings = RegressionTrainingSettings.DeserializeRegressionTrainingSettings(property.Value, options); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("cvSplitColumnNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + cvSplitColumnNames = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + cvSplitColumnNames = array; + continue; + } + if (property.NameEquals("featurizationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featurizationSettings = null; + continue; + } + featurizationSettings = TableVerticalFeaturizationSettings.DeserializeTableVerticalFeaturizationSettings(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -273,6 +393,7 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso nCrossValidations = NCrossValidations.DeserializeNCrossValidations(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("cvSplitColumnNames"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -286,6 +407,46 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso array.Add(item.GetString()); } cvSplitColumnNames = array; +======= + if (property.NameEquals("testData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + testData = null; + continue; + } + testData = MachineLearningTableJobInput.DeserializeMachineLearningTableJobInput(property.Value, options); + continue; + } + if (property.NameEquals("testDataSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + testDataSize = null; + continue; + } + testDataSize = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningTableJobInput.DeserializeMachineLearningTableJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationDataSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationDataSize = null; + continue; + } + validationDataSize = property.Value.GetDouble(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("weightColumnName"u8)) @@ -391,10 +552,19 @@ internal static AutoMLVerticalRegression DeserializeAutoMLVerticalRegression(Jso serializedAdditionalRawData, primaryMetric, trainingSettings, +<<<<<<< HEAD limitSettings, nCrossValidations, cvSplitColumnNames ?? new ChangeTrackingList(), weightColumnName, +======= + cvSplitColumnNames ?? new ChangeTrackingList(), + featurizationSettings, + limitSettings, + nCrossValidations, + testData, + testDataSize, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 validationData, testData, validationDataSize, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs index d9f035029b96..4a05f520e0b9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AutoMLVerticalRegression.cs @@ -35,6 +35,11 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas /// Keeps track of any properties unknown to the library. /// Primary metric for regression task. /// Inputs for training phase for an AutoML Job. +<<<<<<< HEAD +======= + /// Columns to use for CVSplit data. + /// Featurization inputs needed for AutoML job. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Execution constraints for AutoMLJob. /// /// Number of cross validation folds to be applied on training dataset @@ -42,8 +47,17 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// +<<<<<<< HEAD /// Columns to use for CVSplit data. /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. +======= + /// Test data input. + /// + /// The fraction of test dataset that needs to be set aside for validation purpose. + /// Values between (0.0 , 1.0) + /// Applied when validation dataset is not provided. + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Validation data inputs. /// Test data input. /// @@ -51,6 +65,7 @@ public AutoMLVerticalRegression(MachineLearningTableJobInput trainingData) : bas /// Values between (0.0 , 1.0) /// Applied when validation dataset is not provided. /// +<<<<<<< HEAD /// /// The fraction of test dataset that needs to be set aside for validation purpose. /// Values between (0.0 , 1.0) @@ -64,6 +79,21 @@ internal AutoMLVerticalRegression(TaskType taskType, MachineLearningLogVerbosity LimitSettings = limitSettings; NCrossValidations = nCrossValidations; CvSplitColumnNames = cvSplitColumnNames; +======= + /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. + internal AutoMLVerticalRegression(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, AutoMLVerticalRegressionPrimaryMetric? primaryMetric, RegressionTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + { + PrimaryMetric = primaryMetric; + TrainingSettings = trainingSettings; + CvSplitColumnNames = cvSplitColumnNames; + FeaturizationSettings = featurizationSettings; + LimitSettings = limitSettings; + NCrossValidations = nCrossValidations; + TestData = testData; + TestDataSize = testDataSize; + ValidationData = validationData; + ValidationDataSize = validationDataSize; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 WeightColumnName = weightColumnName; ValidationData = validationData; TestData = testData; @@ -82,6 +112,13 @@ internal AutoMLVerticalRegression() public AutoMLVerticalRegressionPrimaryMetric? PrimaryMetric { get; set; } /// Inputs for training phase for an AutoML Job. public RegressionTrainingSettings TrainingSettings { get; set; } +<<<<<<< HEAD +======= + /// Columns to use for CVSplit data. + public IList CvSplitColumnNames { get; set; } + /// Featurization inputs needed for AutoML job. + public TableVerticalFeaturizationSettings FeaturizationSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Execution constraints for AutoMLJob. public TableVerticalLimitSettings LimitSettings { get; set; } /// @@ -91,10 +128,21 @@ internal AutoMLVerticalRegression() /// The available derived classes include and . /// public NCrossValidations NCrossValidations { get; set; } +<<<<<<< HEAD /// Columns to use for CVSplit data. public IList CvSplitColumnNames { get; set; } /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. public string WeightColumnName { get; set; } +======= + /// Test data input. + public MachineLearningTableJobInput TestData { get; set; } + /// + /// The fraction of test dataset that needs to be set aside for validation purpose. + /// Values between (0.0 , 1.0) + /// Applied when validation dataset is not provided. + /// + public double? TestDataSize { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } /// Test data input. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.Serialization.cs new file mode 100644 index 000000000000..bba503c1bbb1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AzureOpenAiFineTuning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(HyperParameters)) + { + if (HyperParameters != null) + { + writer.WritePropertyName("hyperParameters"u8); + writer.WriteObjectValue(HyperParameters, options); + } + else + { + writer.WriteNull("hyperParameters"); + } + } + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureOpenAiFineTuning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOpenAiFineTuning(document.RootElement, options); + } + + internal static AzureOpenAiFineTuning DeserializeAzureOpenAiFineTuning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureOpenAiHyperParameters hyperParameters = default; + ModelProvider modelProvider = default; + FineTuningTaskType taskType = default; + MachineLearningJobInput trainingData = default; + MachineLearningJobInput validationData = default; + MachineLearningFlowModelJobInput model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + hyperParameters = null; + continue; + } + hyperParameters = AzureOpenAiHyperParameters.DeserializeAzureOpenAiHyperParameters(property.Value, options); + continue; + } + if (property.NameEquals("modelProvider"u8)) + { + modelProvider = new ModelProvider(property.Value.GetString()); + continue; + } + if (property.NameEquals("taskType"u8)) + { + taskType = new FineTuningTaskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingData"u8)) + { + trainingData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = MachineLearningFlowModelJobInput.DeserializeMachineLearningFlowModelJobInput(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAiFineTuning( + modelProvider, + taskType, + trainingData, + validationData, + model, + serializedAdditionalRawData, + hyperParameters); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support writing '{options.Format}' format."); + } + } + + AzureOpenAiFineTuning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureOpenAiFineTuning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOpenAiFineTuning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.cs new file mode 100644 index 000000000000..010bba8b688a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiFineTuning.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The AzureOpenAiFineTuning. + public partial class AzureOpenAiFineTuning : FineTuningVertical + { + /// Initializes a new instance of . + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// or is null. + public AzureOpenAiFineTuning(FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningFlowModelJobInput model) : base(taskType, trainingData, model) + { + Argument.AssertNotNull(trainingData, nameof(trainingData)); + Argument.AssertNotNull(model, nameof(model)); + + ModelProvider = ModelProvider.AzureOpenAI; + } + + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// + /// Validation data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + /// HyperParameters for fine tuning Azure Open AI model. + internal AzureOpenAiFineTuning(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData, AzureOpenAiHyperParameters hyperParameters) : base(modelProvider, taskType, trainingData, validationData, model, serializedAdditionalRawData) + { + HyperParameters = hyperParameters; + ModelProvider = modelProvider; + } + + /// Initializes a new instance of for deserialization. + internal AzureOpenAiFineTuning() + { + } + + /// HyperParameters for fine tuning Azure Open AI model. + public AzureOpenAiHyperParameters HyperParameters { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.Serialization.cs new file mode 100644 index 000000000000..17269dbe9ec4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class AzureOpenAiHyperParameters : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(LearningRateMultiplier)) + { + if (LearningRateMultiplier != null) + { + writer.WritePropertyName("learningRateMultiplier"u8); + writer.WriteNumberValue(LearningRateMultiplier.Value); + } + else + { + writer.WriteNull("learningRateMultiplier"); + } + } + if (Optional.IsDefined(BatchSize)) + { + if (BatchSize != null) + { + writer.WritePropertyName("batchSize"u8); + writer.WriteNumberValue(BatchSize.Value); + } + else + { + writer.WriteNull("batchSize"); + } + } + if (Optional.IsDefined(NEpochs)) + { + if (NEpochs != null) + { + writer.WritePropertyName("nEpochs"u8); + writer.WriteNumberValue(NEpochs.Value); + } + else + { + writer.WriteNull("nEpochs"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AzureOpenAiHyperParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzureOpenAiHyperParameters(document.RootElement, options); + } + + internal static AzureOpenAiHyperParameters DeserializeAzureOpenAiHyperParameters(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double? learningRateMultiplier = default; + int? batchSize = default; + int? nEpochs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("learningRateMultiplier"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + learningRateMultiplier = null; + continue; + } + learningRateMultiplier = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("batchSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + batchSize = null; + continue; + } + batchSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("nEpochs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + nEpochs = null; + continue; + } + nEpochs = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzureOpenAiHyperParameters(learningRateMultiplier, batchSize, nEpochs, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support writing '{options.Format}' format."); + } + } + + AzureOpenAiHyperParameters IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAzureOpenAiHyperParameters(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzureOpenAiHyperParameters)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.cs new file mode 100644 index 000000000000..e86aa76fc6be --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AzureOpenAiHyperParameters.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure Open AI hyperparameters for fine tuning. + public partial class AzureOpenAiHyperParameters + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public AzureOpenAiHyperParameters() + { + } + + /// Initializes a new instance of . + /// Scaling factor for the learning rate. A smaller learning rate may be useful to avoid over fitting. + /// Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + /// The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + /// Keeps track of any properties unknown to the library. + internal AzureOpenAiHyperParameters(double? learningRateMultiplier, int? batchSize, int? nEpochs, IDictionary serializedAdditionalRawData) + { + LearningRateMultiplier = learningRateMultiplier; + BatchSize = batchSize; + NEpochs = nEpochs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Scaling factor for the learning rate. A smaller learning rate may be useful to avoid over fitting. + public double? LearningRateMultiplier { get; set; } + /// Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + public int? BatchSize { get; set; } + /// The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + public int? NEpochs { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs index 9a784dc0db2d..03e6721fe1dd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.Serialization.cs @@ -52,7 +52,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit } else { +<<<<<<< HEAD writer.WriteNull("positiveLabel"); +======= + writer.WriteNull("cvSplitColumnNames"); + } + } + if (Optional.IsDefined(FeaturizationSettings)) + { + if (FeaturizationSettings != null) + { + writer.WritePropertyName("featurizationSettings"u8); + writer.WriteObjectValue(FeaturizationSettings, options); + } + else + { + writer.WriteNull("featurizationSettings"); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } if (Optional.IsDefined(LimitSettings)) @@ -79,6 +95,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("nCrossValidations"); } } +<<<<<<< HEAD if (Optional.IsCollectionDefined(CvSplitColumnNames)) { if (CvSplitColumnNames != null) @@ -94,6 +111,54 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit else { writer.WriteNull("cvSplitColumnNames"); +======= + if (Optional.IsDefined(TestData)) + { + if (TestData != null) + { + writer.WritePropertyName("testData"u8); + writer.WriteObjectValue(TestData, options); + } + else + { + writer.WriteNull("testData"); + } + } + if (Optional.IsDefined(TestDataSize)) + { + if (TestDataSize != null) + { + writer.WritePropertyName("testDataSize"u8); + writer.WriteNumberValue(TestDataSize.Value); + } + else + { + writer.WriteNull("testDataSize"); + } + } + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + if (Optional.IsDefined(ValidationDataSize)) + { + if (ValidationDataSize != null) + { + writer.WritePropertyName("validationDataSize"u8); + writer.WriteNumberValue(ValidationDataSize.Value); + } + else + { + writer.WriteNull("validationDataSize"); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } if (Optional.IsDefined(WeightColumnName)) @@ -229,10 +294,21 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele } ClassificationPrimaryMetric? primaryMetric = default; ClassificationTrainingSettings trainingSettings = default; +<<<<<<< HEAD string positiveLabel = default; TableVerticalLimitSettings limitSettings = default; NCrossValidations nCrossValidations = default; IList cvSplitColumnNames = default; +======= + IList cvSplitColumnNames = default; + TableVerticalFeaturizationSettings featurizationSettings = default; + TableVerticalLimitSettings limitSettings = default; + NCrossValidations nCrossValidations = default; + MachineLearningTableJobInput testData = default; + double? testDataSize = default; + MachineLearningTableJobInput validationData = default; + double? validationDataSize = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 string weightColumnName = default; MachineLearningTableJobInput validationData = default; MachineLearningTableJobInput testData = default; @@ -273,7 +349,26 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele positiveLabel = null; continue; } +<<<<<<< HEAD positiveLabel = property.Value.GetString(); +======= + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + cvSplitColumnNames = array; + continue; + } + if (property.NameEquals("featurizationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featurizationSettings = null; + continue; + } + featurizationSettings = TableVerticalFeaturizationSettings.DeserializeTableVerticalFeaturizationSettings(property.Value, options); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("limitSettings"u8)) @@ -296,6 +391,7 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele nCrossValidations = NCrossValidations.DeserializeNCrossValidations(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("cvSplitColumnNames"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -309,6 +405,46 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele array.Add(item.GetString()); } cvSplitColumnNames = array; +======= + if (property.NameEquals("testData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + testData = null; + continue; + } + testData = MachineLearningTableJobInput.DeserializeMachineLearningTableJobInput(property.Value, options); + continue; + } + if (property.NameEquals("testDataSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + testDataSize = null; + continue; + } + testDataSize = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningTableJobInput.DeserializeMachineLearningTableJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationDataSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationDataSize = null; + continue; + } + validationDataSize = property.Value.GetDouble(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("weightColumnName"u8)) @@ -414,11 +550,20 @@ internal static ClassificationTask DeserializeClassificationTask(JsonElement ele serializedAdditionalRawData, primaryMetric, trainingSettings, +<<<<<<< HEAD positiveLabel, limitSettings, nCrossValidations, cvSplitColumnNames ?? new ChangeTrackingList(), weightColumnName, +======= + cvSplitColumnNames ?? new ChangeTrackingList(), + featurizationSettings, + limitSettings, + nCrossValidations, + testData, + testDataSize, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 validationData, testData, validationDataSize, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs index 38ff46e4b69d..d8a5e81848d8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTask.cs @@ -35,7 +35,12 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai /// Keeps track of any properties unknown to the library. /// Primary metric for the task. /// Inputs for training phase for an AutoML Job. +<<<<<<< HEAD /// Positive label for binary metrics calculation. +======= + /// Columns to use for CVSplit data. + /// Featurization inputs needed for AutoML job. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Execution constraints for AutoMLJob. /// /// Number of cross validation folds to be applied on training dataset @@ -43,8 +48,17 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// +<<<<<<< HEAD /// Columns to use for CVSplit data. /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. +======= + /// Test data input. + /// + /// The fraction of test dataset that needs to be set aside for validation purpose. + /// Values between (0.0 , 1.0) + /// Applied when validation dataset is not provided. + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Validation data inputs. /// Test data input. /// @@ -52,6 +66,7 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai /// Values between (0.0 , 1.0) /// Applied when validation dataset is not provided. /// +<<<<<<< HEAD /// /// The fraction of test dataset that needs to be set aside for validation purpose. /// Values between (0.0 , 1.0) @@ -59,13 +74,28 @@ public ClassificationTask(MachineLearningTableJobInput trainingData) : base(trai /// /// Featurization inputs needed for AutoML job. internal ClassificationTask(TaskType taskType, MachineLearningLogVerbosity? logVerbosity, MachineLearningTableJobInput trainingData, string targetColumnName, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, ClassificationTrainingSettings trainingSettings, string positiveLabel, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, IList cvSplitColumnNames, string weightColumnName, MachineLearningTableJobInput validationData, MachineLearningTableJobInput testData, double? validationDataSize, double? testDataSize, TableVerticalFeaturizationSettings featurizationSettings) : base(taskType, logVerbosity, trainingData, targetColumnName, serializedAdditionalRawData) +======= + /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. + internal ClassificationTask(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, string positiveLabel, ClassificationPrimaryMetric? primaryMetric, ClassificationTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { PrimaryMetric = primaryMetric; TrainingSettings = trainingSettings; +<<<<<<< HEAD PositiveLabel = positiveLabel; LimitSettings = limitSettings; NCrossValidations = nCrossValidations; CvSplitColumnNames = cvSplitColumnNames; +======= + CvSplitColumnNames = cvSplitColumnNames; + FeaturizationSettings = featurizationSettings; + LimitSettings = limitSettings; + NCrossValidations = nCrossValidations; + TestData = testData; + TestDataSize = testDataSize; + ValidationData = validationData; + ValidationDataSize = validationDataSize; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 WeightColumnName = weightColumnName; ValidationData = validationData; TestData = testData; @@ -84,8 +114,15 @@ internal ClassificationTask() public ClassificationPrimaryMetric? PrimaryMetric { get; set; } /// Inputs for training phase for an AutoML Job. public ClassificationTrainingSettings TrainingSettings { get; set; } +<<<<<<< HEAD /// Positive label for binary metrics calculation. public string PositiveLabel { get; set; } +======= + /// Columns to use for CVSplit data. + public IList CvSplitColumnNames { get; set; } + /// Featurization inputs needed for AutoML job. + public TableVerticalFeaturizationSettings FeaturizationSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Execution constraints for AutoMLJob. public TableVerticalLimitSettings LimitSettings { get; set; } /// @@ -95,10 +132,21 @@ internal ClassificationTask() /// The available derived classes include and . /// public NCrossValidations NCrossValidations { get; set; } +<<<<<<< HEAD /// Columns to use for CVSplit data. public IList CvSplitColumnNames { get; set; } /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. public string WeightColumnName { get; set; } +======= + /// Test data input. + public MachineLearningTableJobInput TestData { get; set; } + /// + /// The fraction of test dataset that needs to be set aside for validation purpose. + /// Values between (0.0 , 1.0) + /// Applied when validation dataset is not provided. + /// + public double? TestDataSize { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } /// Test data input. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs index b646942ae0d6..593408ac1add 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.Serialization.cs @@ -97,11 +97,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WritePropertyName("enableModelExplainability"u8); writer.WriteBooleanValue(IsModelExplainabilityEnabled.Value); } +<<<<<<< HEAD if (Optional.IsDefined(IsDnnTrainingEnabled)) { writer.WritePropertyName("enableDnnTraining"u8); writer.WriteBooleanValue(IsDnnTrainingEnabled.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -147,8 +150,12 @@ internal static ClassificationTrainingSettings DeserializeClassificationTraining bool? enableStackEnsemble = default; bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; +<<<<<<< HEAD bool? enableModelExplainability = default; bool? enableDnnTraining = default; +======= + MachineLearningStackEnsembleSettings stackEnsembleSettings = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -238,6 +245,7 @@ internal static ClassificationTrainingSettings DeserializeClassificationTraining enableModelExplainability = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("enableDnnTraining"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -247,6 +255,8 @@ internal static ClassificationTrainingSettings DeserializeClassificationTraining enableDnnTraining = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -259,8 +269,12 @@ internal static ClassificationTrainingSettings DeserializeClassificationTraining enableStackEnsemble, enableVoteEnsemble, ensembleModelDownloadTimeout, +<<<<<<< HEAD enableModelExplainability, enableDnnTraining, +======= + stackEnsembleSettings, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, allowedTrainingAlgorithms ?? new ChangeTrackingList(), blockedTrainingAlgorithms ?? new ChangeTrackingList()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs index 04b581cf463e..537656cf3289 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ClassificationTrainingSettings.cs @@ -29,12 +29,20 @@ public ClassificationTrainingSettings() /// During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs are downloaded. /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// +<<<<<<< HEAD /// Flag to turn on explainability on best model. /// Enable recommendation of DNN models. /// Keeps track of any properties unknown to the library. /// Allowed models for classification task. /// Blocked models for classification task. internal ClassificationTrainingSettings(bool? isOnnxCompatibleModelsEnabled, MachineLearningStackEnsembleSettings stackEnsembleSettings, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, bool? isModelExplainabilityEnabled, bool? isDnnTrainingEnabled, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isOnnxCompatibleModelsEnabled, stackEnsembleSettings, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, isModelExplainabilityEnabled, isDnnTrainingEnabled, serializedAdditionalRawData) +======= + /// Stack ensemble settings for stack ensemble run. + /// Keeps track of any properties unknown to the library. + /// Allowed models for classification task. + /// Blocked models for classification task. + internal ClassificationTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { AllowedTrainingAlgorithms = allowedTrainingAlgorithms; BlockedTrainingAlgorithms = blockedTrainingAlgorithms; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 000000000000..1f9a6b636ae5 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ContentSafetyEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (Optional.IsDefined(RaiPolicyName)) + { + writer.WritePropertyName("raiPolicyName"u8); + writer.WriteStringValue(RaiPolicyName); + } + if (Optional.IsDefined(VersionUpgradeOption)) + { + writer.WritePropertyName("versionUpgradeOption"u8); + writer.WriteStringValue(VersionUpgradeOption.Value.ToString()); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ContentSafetyEndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentSafetyEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static ContentSafetyEndpointDeploymentResourceProperties DeserializeContentSafetyEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentModel model = default; + string raiPolicyName = default; + DeploymentModelVersionUpgradeOption? versionUpgradeOption = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model"u8)) + { + model = EndpointDeploymentModel.DeserializeEndpointDeploymentModel(property.Value, options); + continue; + } + if (property.NameEquals("raiPolicyName"u8)) + { + raiPolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("versionUpgradeOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + versionUpgradeOption = new DeploymentModelVersionUpgradeOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentSafetyEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + model, + raiPolicyName, + versionUpgradeOption); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ContentSafetyEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentSafetyEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.cs new file mode 100644 index 000000000000..46d2ac213c27 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointDeploymentResourceProperties.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ContentSafetyEndpointDeploymentResourceProperties. + public partial class ContentSafetyEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// Model used for the endpoint deployment. + /// is null. + public ContentSafetyEndpointDeploymentResourceProperties(EndpointDeploymentModel model) + { + Argument.AssertNotNull(model, nameof(model)); + + Model = model; + EndpointDeploymentResourcePropertiesType = "Azure.ContentSafety"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + internal ContentSafetyEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, EndpointDeploymentModel model, string raiPolicyName, DeploymentModelVersionUpgradeOption? versionUpgradeOption) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + Model = model; + RaiPolicyName = raiPolicyName; + VersionUpgradeOption = versionUpgradeOption; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Azure.ContentSafety"; + } + + /// Initializes a new instance of for deserialization. + internal ContentSafetyEndpointDeploymentResourceProperties() + { + } + + /// Model used for the endpoint deployment. + public EndpointDeploymentModel Model { get; set; } + /// The name of RAI policy. + public string RaiPolicyName { get; set; } + /// Deployment model version upgrade option. + public DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.Serialization.cs new file mode 100644 index 000000000000..ff216c2c4849 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ContentSafetyEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ContentSafetyEndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContentSafetyEndpointResourceProperties(document.RootElement, options); + } + + internal static ContentSafetyEndpointResourceProperties DeserializeContentSafetyEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContentSafetyEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ContentSafetyEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContentSafetyEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContentSafetyEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.cs new file mode 100644 index 000000000000..cd968320a766 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ContentSafetyEndpointResourceProperties.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ContentSafetyEndpointResourceProperties. + public partial class ContentSafetyEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public ContentSafetyEndpointResourceProperties() + { + EndpointType = EndpointType.AzureContentSafety; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal ContentSafetyEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.Serialization.cs index 6b86c3721c15..15ab6535fdc3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.Serialization.cs @@ -102,6 +102,10 @@ internal static CronTrigger DeserializeCronTrigger(JsonElement element, ModelRea string endTime = default; string startTime = default; string timeZone = default; +<<<<<<< HEAD +======= + TriggerType triggerType = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -141,6 +145,14 @@ internal static CronTrigger DeserializeCronTrigger(JsonElement element, ModelRea timeZone = property.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("triggerType"u8)) + { + triggerType = new TriggerType(property.Value.GetString()); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.cs index e47288f05186..e30fe04dcc1e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CronTrigger.cs @@ -44,7 +44,11 @@ public CronTrigger(string expression) /// [Required] Specifies cron expression of schedule. /// The expression should follow NCronTab format. /// +<<<<<<< HEAD internal CronTrigger(TriggerType triggerType, string endTime, string startTime, string timeZone, IDictionary serializedAdditionalRawData, string expression) : base(triggerType, endTime, startTime, timeZone, serializedAdditionalRawData) +======= + internal CronTrigger(string endTime, string startTime, string timeZone, TriggerType triggerType, IDictionary serializedAdditionalRawData, string expression) : base(endTime, startTime, timeZone, triggerType, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Expression = expression; TriggerType = triggerType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs index f6206bf715fc..a00b244949a5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.Serialization.cs @@ -43,12 +43,21 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -57,12 +66,54 @@ void IJsonModel.Write(Utf8JsonWriter wr { writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); +======= + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -93,6 +144,12 @@ void IJsonModel.Write(Utf8JsonWriter wr { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -136,6 +193,7 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -144,6 +202,18 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -180,6 +250,14 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,11 +285,14 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -224,6 +305,41 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor dictionary.Add(property0.Name, property0.Value.GetString()); } metadata = dictionary; +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("sharedUserList"u8)) @@ -254,6 +370,15 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor valueFormat = new MachineLearningValueFormat(property.Value.GetString()); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -264,6 +389,7 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -272,6 +398,18 @@ internal static CustomKeysWorkspaceConnectionProperties DeserializeCustomKeysWor sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs index 7b7b442aca53..e711005c9c33 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomKeysWorkspaceConnectionProperties.cs @@ -30,6 +30,7 @@ public CustomKeysWorkspaceConnectionProperties() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -41,6 +42,21 @@ public CustomKeysWorkspaceConnectionProperties() /// Keeps track of any properties unknown to the library. /// Custom Keys credential object. internal CustomKeysWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData, CustomKeys credentials) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// Custom Keys credential object. + internal CustomKeysWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, CustomKeys credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.Serialization.cs new file mode 100644 index 000000000000..f5ce08ae51bb --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class CustomModelFineTuning : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(HyperParameters)) + { + if (HyperParameters != null) + { + writer.WritePropertyName("hyperParameters"u8); + writer.WriteStartObject(); + foreach (var item in HyperParameters) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("hyperParameters"); + } + } + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + CustomModelFineTuning IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomModelFineTuning(document.RootElement, options); + } + + internal static CustomModelFineTuning DeserializeCustomModelFineTuning(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary hyperParameters = default; + ModelProvider modelProvider = default; + FineTuningTaskType taskType = default; + MachineLearningJobInput trainingData = default; + MachineLearningJobInput validationData = default; + MachineLearningFlowModelJobInput model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + hyperParameters = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + hyperParameters = dictionary; + continue; + } + if (property.NameEquals("modelProvider"u8)) + { + modelProvider = new ModelProvider(property.Value.GetString()); + continue; + } + if (property.NameEquals("taskType"u8)) + { + taskType = new FineTuningTaskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingData"u8)) + { + trainingData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = MachineLearningFlowModelJobInput.DeserializeMachineLearningFlowModelJobInput(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomModelFineTuning( + modelProvider, + taskType, + trainingData, + validationData, + model, + serializedAdditionalRawData, + hyperParameters ?? new ChangeTrackingDictionary()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support writing '{options.Format}' format."); + } + } + + CustomModelFineTuning IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomModelFineTuning(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomModelFineTuning)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.cs new file mode 100644 index 000000000000..2431930ea9bc --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomModelFineTuning.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The CustomModelFineTuning. + public partial class CustomModelFineTuning : FineTuningVertical + { + /// Initializes a new instance of . + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// or is null. + public CustomModelFineTuning(FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningFlowModelJobInput model) : base(taskType, trainingData, model) + { + Argument.AssertNotNull(trainingData, nameof(trainingData)); + Argument.AssertNotNull(model, nameof(model)); + + HyperParameters = new ChangeTrackingDictionary(); + ModelProvider = ModelProvider.Custom; + } + + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// + /// Validation data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + /// HyperParameters for fine tuning custom model. + internal CustomModelFineTuning(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData, IDictionary hyperParameters) : base(modelProvider, taskType, trainingData, validationData, model, serializedAdditionalRawData) + { + HyperParameters = hyperParameters; + ModelProvider = modelProvider; + } + + /// Initializes a new instance of for deserialization. + internal CustomModelFineTuning() + { + } + + /// HyperParameters for fine tuning custom model. + public IDictionary HyperParameters { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs index 2358311d2645..c8e17ccf9e40 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.Serialization.cs @@ -71,8 +71,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteObjectValue(item, options); } writer.WriteEndArray(); +<<<<<<< HEAD writer.WritePropertyName("signalType"u8); writer.WriteStringValue(SignalType.ToString()); +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(NotificationTypes)) { if (NotificationTypes != null) @@ -150,6 +153,11 @@ internal static CustomMonitoringSignal DeserializeCustomMonitoringSignal(JsonEle IDictionary inputs = default; string componentId = default; IList metricThresholds = default; +<<<<<<< HEAD +======= + IList notificationTypes = default; + IDictionary properties = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MonitoringSignalType signalType = default; IList notificationTypes = default; IDictionary properties = default; @@ -202,11 +210,14 @@ internal static CustomMonitoringSignal DeserializeCustomMonitoringSignal(JsonEle metricThresholds = array; continue; } +<<<<<<< HEAD if (property.NameEquals("signalType"u8)) { signalType = new MonitoringSignalType(property.Value.GetString()); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -244,13 +255,21 @@ internal static CustomMonitoringSignal DeserializeCustomMonitoringSignal(JsonEle } serializedAdditionalRawData = rawDataDictionary; return new CustomMonitoringSignal( +<<<<<<< HEAD +======= + notificationTypes ?? new ChangeTrackingList(), + properties ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 signalType, notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, inputAssets ?? new ChangeTrackingDictionary(), inputs ?? new ChangeTrackingDictionary(), +<<<<<<< HEAD componentId, +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 metricThresholds); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs index 6da45b42ebcf..70787844ed88 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomMonitoringSignal.cs @@ -31,10 +31,19 @@ public CustomMonitoringSignal(string componentId, IEnumerable Initializes a new instance of . +<<<<<<< HEAD +======= + /// The current notification mode for this signal. + /// Property dictionary. Properties can be added, but not removed or altered. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Specifies the type of signal to monitor. /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD +======= + /// [Required] Reference to the component asset used to calculate the custom metrics. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Monitoring assets to take as input. Key is the component input port name, value is the data asset. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -47,7 +56,11 @@ public CustomMonitoringSignal(string componentId, IEnumerable /// [Required] Reference to the component asset used to calculate the custom metrics. /// [Required] A list of metrics to calculate and their associated thresholds. +<<<<<<< HEAD internal CustomMonitoringSignal(MonitoringSignalType signalType, IList notificationTypes, IDictionary properties, IDictionary serializedAdditionalRawData, IDictionary inputAssets, IDictionary inputs, string componentId, IList metricThresholds) : base(signalType, notificationTypes, properties, serializedAdditionalRawData) +======= + internal CustomMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, string componentId, IDictionary inputAssets, IDictionary inputs, IList metricThresholds) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { InputAssets = inputAssets; Inputs = inputs; @@ -61,6 +74,11 @@ internal CustomMonitoringSignal() { } +<<<<<<< HEAD +======= + /// [Required] Reference to the component asset used to calculate the custom metrics. + public string ComponentId { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Monitoring assets to take as input. Key is the component input port name, value is the data asset. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs index b77ca56561b5..fff95ca8fb82 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.Serialization.cs @@ -79,6 +79,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt } writer.WriteEndArray(); } + if (Optional.IsDefined(Kernel)) + { + writer.WritePropertyName("kernel"u8); + writer.WriteObjectValue(Kernel, options); + } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -120,6 +125,7 @@ internal static CustomService DeserializeCustomService(JsonElement element, Mode DockerSetting docker = default; IList endpoints = default; IList volumes = default; + JupyterKernelConfig kernel = default; IDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -190,6 +196,15 @@ internal static CustomService DeserializeCustomService(JsonElement element, Mode volumes = array; continue; } + if (property.NameEquals("kernel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kernel = JupyterKernelConfig.DeserializeJupyterKernelConfig(property.Value, options); + continue; + } additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; @@ -200,6 +215,7 @@ internal static CustomService DeserializeCustomService(JsonElement element, Mode docker, endpoints ?? new ChangeTrackingList(), volumes ?? new ChangeTrackingList(), + kernel, additionalProperties); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs index f0396ea418bd..79b4d1781936 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/CustomService.cs @@ -29,8 +29,9 @@ public CustomService() /// Describes the docker settings for the image. /// Configuring the endpoints for the container. /// Configuring the volumes for the container. + /// Describes the jupyter kernel settings for the image if its a custom environment. /// Additional Properties. - internal CustomService(string name, ImageSetting image, IDictionary environmentVariables, DockerSetting docker, IList endpoints, IList volumes, IDictionary additionalProperties) + internal CustomService(string name, ImageSetting image, IDictionary environmentVariables, DockerSetting docker, IList endpoints, IList volumes, JupyterKernelConfig kernel, IDictionary additionalProperties) { Name = name; Image = image; @@ -38,6 +39,7 @@ internal CustomService(string name, ImageSetting image, IDictionary Endpoints { get; } /// Configuring the volumes for the container. public IList Volumes { get; } + /// Describes the jupyter kernel settings for the image if its a custom environment. + public JupyterKernelConfig Kernel { get; set; } /// /// Additional Properties /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs index e2e1ec0da54a..5d45e2ac6ef5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.Serialization.cs @@ -26,6 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } writer.WriteStartObject(); +<<<<<<< HEAD if (Optional.IsDefined(Features)) { if (Features != null) @@ -61,6 +62,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteObjectValue(ProductionData, options); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) { if (FeatureDataTypeOverride != null) @@ -79,9 +82,55 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteNull("featureDataTypeOverride"); } } +<<<<<<< HEAD writer.WritePropertyName("signalType"u8); writer.WriteStringValue(SignalType.ToString()); if (Optional.IsCollectionDefined(NotificationTypes)) +======= + if (Optional.IsDefined(FeatureImportanceSettings)) + { + if (FeatureImportanceSettings != null) + { + writer.WritePropertyName("featureImportanceSettings"u8); + writer.WriteObjectValue(FeatureImportanceSettings, options); + } + else + { + writer.WriteNull("featureImportanceSettings"); + } + } + if (Optional.IsDefined(Features)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + { + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } + } +<<<<<<< HEAD +======= + writer.WritePropertyName("metricThresholds"u8); + writer.WriteStartArray(); + foreach (var item in MetricThresholds) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("productionData"u8); + writer.WriteObjectValue(ProductionData, options); + writer.WritePropertyName("referenceData"u8); + writer.WriteObjectValue(ReferenceData, options); + if (Optional.IsCollectionDefined(NotificationTypes)) { if (NotificationTypes != null) { @@ -98,6 +147,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteNull("notificationTypes"); } } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Properties)) { if (Properties != null) @@ -154,12 +204,22 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J { return null; } +<<<<<<< HEAD +======= + IDictionary featureDataTypeOverride = default; + FeatureImportanceSettings featureImportanceSettings = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MonitoringFeatureFilterBase features = default; FeatureImportanceSettings featureImportanceSettings = default; IList metricThresholds = default; MonitoringInputDataBase productionData = default; MonitoringInputDataBase referenceData = default; +<<<<<<< HEAD IDictionary featureDataTypeOverride = default; +======= + IList notificationTypes = default; + IDictionary properties = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MonitoringSignalType signalType = default; IList notificationTypes = default; IDictionary properties = default; @@ -167,6 +227,34 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD +======= + if (property.NameEquals("featureDataTypeOverride"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureDataTypeOverride = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, new MonitoringFeatureDataType(property0.Value.GetString())); + } + featureDataTypeOverride = dictionary; + continue; + } + if (property.NameEquals("featureImportanceSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureImportanceSettings = null; + continue; + } + featureImportanceSettings = FeatureImportanceSettings.DeserializeFeatureImportanceSettings(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("features"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,6 +295,7 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("featureDataTypeOverride"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -234,6 +323,15 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J notificationTypes = null; continue; } +======= + if (property.NameEquals("notificationTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationTypes = null; + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -264,10 +362,20 @@ internal static DataDriftMonitoringSignal DeserializeDataDriftMonitoringSignal(J } serializedAdditionalRawData = rawDataDictionary; return new DataDriftMonitoringSignal( +<<<<<<< HEAD +======= + notificationTypes ?? new ChangeTrackingList(), + properties ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 signalType, notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + featureDataTypeOverride ?? new ChangeTrackingDictionary(), + featureImportanceSettings, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 features, featureImportanceSettings, metricThresholds, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs index 2700f186cf01..69cc09c920a8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataDriftMonitoringSignal.cs @@ -45,10 +45,20 @@ public DataDriftMonitoringSignal(IEnumerable metri } /// Initializes a new instance of . +<<<<<<< HEAD +======= + /// The current notification mode for this signal. + /// Property dictionary. Properties can be added, but not removed or altered. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Specifies the type of signal to monitor. /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD +======= + /// A dictionary that maps feature names to their respective data types. + /// The settings for computing feature importance. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// The feature filter which identifies which feature to calculate drift over. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -70,9 +80,16 @@ public DataDriftMonitoringSignal(IEnumerable metri /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , and . /// +<<<<<<< HEAD /// A dictionary that maps feature names to their respective data types. internal DataDriftMonitoringSignal(MonitoringSignalType signalType, IList notificationTypes, IDictionary properties, IDictionary serializedAdditionalRawData, MonitoringFeatureFilterBase features, FeatureImportanceSettings featureImportanceSettings, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData, IDictionary featureDataTypeOverride) : base(signalType, notificationTypes, properties, serializedAdditionalRawData) { +======= + internal DataDriftMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, FeatureImportanceSettings featureImportanceSettings, MonitoringFeatureFilterBase features, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) + { + FeatureDataTypeOverride = featureDataTypeOverride; + FeatureImportanceSettings = featureImportanceSettings; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Features = features; FeatureImportanceSettings = featureImportanceSettings; MetricThresholds = metricThresholds; @@ -87,6 +104,13 @@ internal DataDriftMonitoringSignal() { } +<<<<<<< HEAD +======= + /// A dictionary that maps feature names to their respective data types. + public IDictionary FeatureDataTypeOverride { get; set; } + /// The settings for computing feature importance. + public FeatureImportanceSettings FeatureImportanceSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// The feature filter which identifies which feature to calculate drift over. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs index 57c583c946f6..e18f8f596c70 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.Serialization.cs @@ -79,9 +79,55 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("featureDataTypeOverride"); } } +<<<<<<< HEAD writer.WritePropertyName("signalType"u8); writer.WriteStringValue(SignalType.ToString()); if (Optional.IsCollectionDefined(NotificationTypes)) +======= + if (Optional.IsDefined(FeatureImportanceSettings)) + { + if (FeatureImportanceSettings != null) + { + writer.WritePropertyName("featureImportanceSettings"u8); + writer.WriteObjectValue(FeatureImportanceSettings, options); + } + else + { + writer.WriteNull("featureImportanceSettings"); + } + } + if (Optional.IsDefined(Features)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + { + if (NotificationTypes != null) + { + writer.WritePropertyName("notificationTypes"u8); + writer.WriteStartArray(); + foreach (var item in NotificationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("notificationTypes"); + } + } +<<<<<<< HEAD +======= + writer.WritePropertyName("metricThresholds"u8); + writer.WriteStartArray(); + foreach (var item in MetricThresholds) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("productionData"u8); + writer.WriteObjectValue(ProductionData, options); + writer.WritePropertyName("referenceData"u8); + writer.WriteObjectValue(ReferenceData, options); + if (Optional.IsCollectionDefined(NotificationTypes)) { if (NotificationTypes != null) { @@ -98,6 +144,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteNull("notificationTypes"); } } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Properties)) { if (Properties != null) @@ -154,12 +201,22 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign { return null; } +<<<<<<< HEAD +======= + IDictionary featureDataTypeOverride = default; + FeatureImportanceSettings featureImportanceSettings = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MonitoringFeatureFilterBase features = default; FeatureImportanceSettings featureImportanceSettings = default; IList metricThresholds = default; MonitoringInputDataBase productionData = default; MonitoringInputDataBase referenceData = default; +<<<<<<< HEAD IDictionary featureDataTypeOverride = default; +======= + IList notificationTypes = default; + IDictionary properties = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MonitoringSignalType signalType = default; IList notificationTypes = default; IDictionary properties = default; @@ -167,6 +224,34 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD +======= + if (property.NameEquals("featureDataTypeOverride"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureDataTypeOverride = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, new MonitoringFeatureDataType(property0.Value.GetString())); + } + featureDataTypeOverride = dictionary; + continue; + } + if (property.NameEquals("featureImportanceSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureImportanceSettings = null; + continue; + } + featureImportanceSettings = FeatureImportanceSettings.DeserializeFeatureImportanceSettings(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("features"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,6 +292,7 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("featureDataTypeOverride"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -234,6 +320,15 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign notificationTypes = null; continue; } +======= + if (property.NameEquals("notificationTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationTypes = null; + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -264,10 +359,20 @@ internal static DataQualityMonitoringSignal DeserializeDataQualityMonitoringSign } serializedAdditionalRawData = rawDataDictionary; return new DataQualityMonitoringSignal( +<<<<<<< HEAD +======= + notificationTypes ?? new ChangeTrackingList(), + properties ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 signalType, notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + featureDataTypeOverride ?? new ChangeTrackingDictionary(), + featureImportanceSettings, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 features, featureImportanceSettings, metricThresholds, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs index 17ce3cd36cb4..bb964fec21cd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DataQualityMonitoringSignal.cs @@ -45,10 +45,20 @@ public DataQualityMonitoringSignal(IEnumerable m } /// Initializes a new instance of . +<<<<<<< HEAD +======= + /// The current notification mode for this signal. + /// Property dictionary. Properties can be added, but not removed or altered. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Specifies the type of signal to monitor. /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD +======= + /// A dictionary that maps feature names to their respective data types. + /// The settings for computing feature importance. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// The features to calculate drift over. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -70,9 +80,16 @@ public DataQualityMonitoringSignal(IEnumerable m /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , and . /// +<<<<<<< HEAD /// A dictionary that maps feature names to their respective data types. internal DataQualityMonitoringSignal(MonitoringSignalType signalType, IList notificationTypes, IDictionary properties, IDictionary serializedAdditionalRawData, MonitoringFeatureFilterBase features, FeatureImportanceSettings featureImportanceSettings, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData, IDictionary featureDataTypeOverride) : base(signalType, notificationTypes, properties, serializedAdditionalRawData) { +======= + internal DataQualityMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, FeatureImportanceSettings featureImportanceSettings, MonitoringFeatureFilterBase features, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) + { + FeatureDataTypeOverride = featureDataTypeOverride; + FeatureImportanceSettings = featureImportanceSettings; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Features = features; FeatureImportanceSettings = featureImportanceSettings; MetricThresholds = metricThresholds; @@ -87,6 +104,13 @@ internal DataQualityMonitoringSignal() { } +<<<<<<< HEAD +======= + /// A dictionary that maps feature names to their respective data types. + public IDictionary FeatureDataTypeOverride { get; set; } + /// The settings for computing feature importance. + public FeatureImportanceSettings FeatureImportanceSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// The features to calculate drift over. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DefaultResourceProvisioningState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DefaultResourceProvisioningState.cs new file mode 100644 index 000000000000..86281efb3fc5 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DefaultResourceProvisioningState.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The DefaultResourceProvisioningState. + public readonly partial struct DefaultResourceProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DefaultResourceProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotStartedValue = "NotStarted"; + private const string FailedValue = "Failed"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string SucceededValue = "Succeeded"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + private const string CanceledValue = "Canceled"; + private const string ScalingValue = "Scaling"; + private const string DisabledValue = "Disabled"; + + /// NotStarted. + public static DefaultResourceProvisioningState NotStarted { get; } = new DefaultResourceProvisioningState(NotStartedValue); + /// Failed. + public static DefaultResourceProvisioningState Failed { get; } = new DefaultResourceProvisioningState(FailedValue); + /// Creating. + public static DefaultResourceProvisioningState Creating { get; } = new DefaultResourceProvisioningState(CreatingValue); + /// Updating. + public static DefaultResourceProvisioningState Updating { get; } = new DefaultResourceProvisioningState(UpdatingValue); + /// Succeeded. + public static DefaultResourceProvisioningState Succeeded { get; } = new DefaultResourceProvisioningState(SucceededValue); + /// Deleting. + public static DefaultResourceProvisioningState Deleting { get; } = new DefaultResourceProvisioningState(DeletingValue); + /// Accepted. + public static DefaultResourceProvisioningState Accepted { get; } = new DefaultResourceProvisioningState(AcceptedValue); + /// Canceled. + public static DefaultResourceProvisioningState Canceled { get; } = new DefaultResourceProvisioningState(CanceledValue); + /// Scaling. + public static DefaultResourceProvisioningState Scaling { get; } = new DefaultResourceProvisioningState(ScalingValue); + /// Disabled. + public static DefaultResourceProvisioningState Disabled { get; } = new DefaultResourceProvisioningState(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(DefaultResourceProvisioningState left, DefaultResourceProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DefaultResourceProvisioningState left, DefaultResourceProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DefaultResourceProvisioningState(string value) => new DefaultResourceProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DefaultResourceProvisioningState other && Equals(other); + /// + public bool Equals(DefaultResourceProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DeploymentModelVersionUpgradeOption.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DeploymentModelVersionUpgradeOption.cs new file mode 100644 index 000000000000..71e8365741da --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DeploymentModelVersionUpgradeOption.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Deployment model version upgrade option. + public readonly partial struct DeploymentModelVersionUpgradeOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DeploymentModelVersionUpgradeOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string OnceNewDefaultVersionAvailableValue = "OnceNewDefaultVersionAvailable"; + private const string OnceCurrentVersionExpiredValue = "OnceCurrentVersionExpired"; + private const string NoAutoUpgradeValue = "NoAutoUpgrade"; + + /// OnceNewDefaultVersionAvailable. + public static DeploymentModelVersionUpgradeOption OnceNewDefaultVersionAvailable { get; } = new DeploymentModelVersionUpgradeOption(OnceNewDefaultVersionAvailableValue); + /// OnceCurrentVersionExpired. + public static DeploymentModelVersionUpgradeOption OnceCurrentVersionExpired { get; } = new DeploymentModelVersionUpgradeOption(OnceCurrentVersionExpiredValue); + /// NoAutoUpgrade. + public static DeploymentModelVersionUpgradeOption NoAutoUpgrade { get; } = new DeploymentModelVersionUpgradeOption(NoAutoUpgradeValue); + /// Determines if two values are the same. + public static bool operator ==(DeploymentModelVersionUpgradeOption left, DeploymentModelVersionUpgradeOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DeploymentModelVersionUpgradeOption left, DeploymentModelVersionUpgradeOption right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DeploymentModelVersionUpgradeOption(string value) => new DeploymentModelVersionUpgradeOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DeploymentModelVersionUpgradeOption other && Equals(other); + /// + public bool Equals(DeploymentModelVersionUpgradeOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.Serialization.cs index ffd7cb8aa44f..907ea9b198c4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.Serialization.cs @@ -26,6 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter } writer.WriteStartObject(); +<<<<<<< HEAD if (Optional.IsDefined(RegistryName)) { if (RegistryName != null) @@ -60,6 +61,42 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter else { writer.WriteNull("destinationVersion"); +======= + if (Optional.IsDefined(DestinationName)) + { + if (DestinationName != null) + { + writer.WritePropertyName("destinationName"u8); + writer.WriteStringValue(DestinationName); + } + else + { + writer.WriteNull("destinationName"); + } + } + if (Optional.IsDefined(DestinationVersion)) + { + if (DestinationVersion != null) + { + writer.WritePropertyName("destinationVersion"u8); + writer.WriteStringValue(DestinationVersion); + } + else + { + writer.WriteNull("destinationVersion"); + } + } + if (Optional.IsDefined(RegistryName)) + { + if (RegistryName != null) + { + writer.WritePropertyName("registryName"u8); + writer.WriteStringValue(RegistryName); + } + else + { + writer.WriteNull("registryName"); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -100,13 +137,20 @@ internal static DestinationAsset DeserializeDestinationAsset(JsonElement element { return null; } +<<<<<<< HEAD string registryName = default; string destinationName = default; string destinationVersion = default; +======= + string destinationName = default; + string destinationVersion = default; + string registryName = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("registryName"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -135,6 +179,36 @@ internal static DestinationAsset DeserializeDestinationAsset(JsonElement element continue; } destinationVersion = property.Value.GetString(); +======= + if (property.NameEquals("destinationName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + destinationName = null; + continue; + } + destinationName = property.Value.GetString(); + continue; + } + if (property.NameEquals("destinationVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + destinationVersion = null; + continue; + } + destinationVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("registryName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + registryName = null; + continue; + } + registryName = property.Value.GetString(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (options.Format != "W") @@ -143,7 +217,11 @@ internal static DestinationAsset DeserializeDestinationAsset(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new DestinationAsset(registryName, destinationName, destinationVersion, serializedAdditionalRawData); +======= + return new DestinationAsset(destinationName, destinationVersion, registryName, serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs index 08b02d3d81d5..cc552301fe1b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs @@ -10,8 +10,18 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs /// Publishing destination registry asset information. public partial class DestinationAsset +======== + /// The ServerlessEndpointModelSettings. + internal partial class ServerlessEndpointModelSettings +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs +======= + /// Publishing destination registry asset information. + public partial class DestinationAsset +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +55,23 @@ public partial class DestinationAsset /// private IDictionary _serializedAdditionalRawData; +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs /// Initializes a new instance of . public DestinationAsset() +======== + /// Initializes a new instance of . + /// + /// is null. + public ServerlessEndpointModelSettings(string modelId) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs { + Argument.AssertNotNull(modelId, nameof(modelId)); + + ModelId = modelId; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs /// Initializes a new instance of . /// Destination registry name. /// Destination asset name. @@ -65,9 +87,52 @@ internal DestinationAsset(string registryName, string destinationName, string de /// Destination registry name. public string RegistryName { get; set; } +======= + /// Initializes a new instance of . + public DestinationAsset() + { + } + + /// Initializes a new instance of . + /// Destination asset name. + /// Destination asset version. + /// Destination registry name. + /// Keeps track of any properties unknown to the library. + internal DestinationAsset(string destinationName, string destinationVersion, string registryName, IDictionary serializedAdditionalRawData) + { + DestinationName = destinationName; + DestinationVersion = destinationVersion; + RegistryName = registryName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Destination asset name. public string DestinationName { get; set; } /// Destination asset version. public string DestinationVersion { get; set; } +<<<<<<< HEAD +======== + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointModelSettings(string modelId, IDictionary serializedAdditionalRawData) + { + ModelId = modelId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointModelSettings() + { + } + + /// Gets or sets the model id. + public string ModelId { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs +======= + /// Destination registry name. + public string RegistryName { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.Serialization.cs index 5551abe71d22..ed2ad206b97b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.Serialization.cs @@ -26,6 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter } writer.WriteStartObject(); +<<<<<<< HEAD if (Optional.IsDefined(UserName)) { if (UserName != null) @@ -48,6 +49,30 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter else { writer.WriteNull("password"); +======= + if (Optional.IsDefined(Password)) + { + if (Password != null) + { + writer.WritePropertyName("password"u8); + writer.WriteStringValue(Password); + } + else + { + writer.WriteNull("password"); + } + } + if (Optional.IsDefined(UserName)) + { + if (UserName != null) + { + writer.WritePropertyName("userName"u8); + writer.WriteStringValue(UserName); + } + else + { + writer.WriteNull("userName"); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } writer.WritePropertyName("credentialType"u8); @@ -90,13 +115,19 @@ internal static DockerCredential DeserializeDockerCredential(JsonElement element { return null; } +<<<<<<< HEAD string userName = default; string password = default; +======= + string password = default; + string userName = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 DataReferenceCredentialType credentialType = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("userName"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -115,6 +146,26 @@ internal static DockerCredential DeserializeDockerCredential(JsonElement element continue; } password = property.Value.GetString(); +======= + if (property.NameEquals("password"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + password = null; + continue; + } + password = property.Value.GetString(); + continue; + } + if (property.NameEquals("userName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userName = null; + continue; + } + userName = property.Value.GetString(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("credentialType"u8)) @@ -128,7 +179,11 @@ internal static DockerCredential DeserializeDockerCredential(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new DockerCredential(credentialType, serializedAdditionalRawData, userName, password); +======= + return new DockerCredential(credentialType, serializedAdditionalRawData, password, userName); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs index a846adb22691..76d0c7098f32 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DockerCredential.cs @@ -22,6 +22,7 @@ internal DockerCredential() /// Initializes a new instance of . /// [Required] Credential type used to authentication with storage. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// DockerCredential user name. /// DockerCredential user password. internal DockerCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData, string userName, string password) : base(credentialType, serializedAdditionalRawData) @@ -35,5 +36,20 @@ internal DockerCredential(DataReferenceCredentialType credentialType, IDictionar public string UserName { get; } /// DockerCredential user password. public string Password { get; } +======= + /// DockerCredential user password. + /// DockerCredential user name. + internal DockerCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData, string password, string userName) : base(credentialType, serializedAdditionalRawData) + { + Password = password; + UserName = userName; + CredentialType = credentialType; + } + + /// DockerCredential user password. + public string Password { get; } + /// DockerCredential user name. + public string UserName { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.Serialization.cs new file mode 100644 index 000000000000..292c2d1cbcdf --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointDeploymentModel : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Format)) + { + writer.WritePropertyName("format"u8); + writer.WriteStringValue(Format); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentModel(document.RootElement, options); + } + + internal static EndpointDeploymentModel DeserializeEndpointDeploymentModel(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string format = default; + string name = default; + string source = default; + string version = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("format"u8)) + { + format = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointDeploymentModel(format, name, source, version, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentModel(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentModel)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.cs new file mode 100644 index 000000000000..4e1d3dc918e3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentModel.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointDeploymentModel. + public partial class EndpointDeploymentModel + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public EndpointDeploymentModel() + { + } + + /// Initializes a new instance of . + /// Model format. + /// Model name. + /// Optional. Deployment model source ARM resource ID. + /// Model version. + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentModel(string format, string name, string source, string version, IDictionary serializedAdditionalRawData) + { + Format = format; + Name = name; + Source = source; + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Model format. + public string Format { get; set; } + /// Model name. + public string Name { get; set; } + /// Optional. Deployment model source ARM resource ID. + public string Source { get; set; } + /// Model version. + public string Version { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 000000000000..e18d89d0b939 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownEndpointDeploymentResourceProperties))] + public partial class EndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static EndpointDeploymentResourceProperties DeserializeEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("type", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Azure.ContentSafety": return ContentSafetyEndpointDeploymentResourceProperties.DeserializeContentSafetyEndpointDeploymentResourceProperties(element, options); + case "Azure.OpenAI": return OpenAIEndpointDeploymentResourceProperties.DeserializeOpenAIEndpointDeploymentResourceProperties(element, options); + case "Azure.Speech": return SpeechEndpointDeploymentResourceProperties.DeserializeSpeechEndpointDeploymentResourceProperties(element, options); + case "managedOnlineEndpoint": return ManagedOnlineEndpointDeploymentResourceProperties.DeserializeManagedOnlineEndpointDeploymentResourceProperties(element, options); + } + } + return UnknownEndpointDeploymentResourceProperties.DeserializeUnknownEndpointDeploymentResourceProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.cs new file mode 100644 index 000000000000..15de34853098 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourceProperties.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , and . + /// + public abstract partial class EndpointDeploymentResourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected EndpointDeploymentResourceProperties() + { + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData) + { + FailureReason = failureReason; + ProvisioningState = provisioningState; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The failure reason if the creation failed. + public string FailureReason { get; set; } + /// Read-only provision state status property. + public DefaultResourceProvisioningState? ProvisioningState { get; } + /// Kind of the deployment. + internal string EndpointDeploymentResourcePropertiesType { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 000000000000..22be7b3575b8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 000000000000..6dc73af1f1d1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult. + internal partial class EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs new file mode 100644 index 000000000000..6d08b81219d7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs + public partial class AnonymousAccessCredential : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("credentialType"u8); + writer.WriteStringValue(CredentialType.ToString()); +======== + public partial class EndpointKeys : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointKeys)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Keys)) + { + writer.WritePropertyName("keys"u8); + writer.WriteObjectValue(Keys, options); + } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs + AnonymousAccessCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAnonymousAccessCredential(document.RootElement, options); + } + + internal static AnonymousAccessCredential DeserializeAnonymousAccessCredential(JsonElement element, ModelReaderWriterOptions options = null) +======== + EndpointKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointKeys)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointKeys(document.RootElement, options); + } + + internal static EndpointKeys DeserializeEndpointKeys(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs + DataReferenceCredentialType credentialType = default; +======== + AccountApiKeys keys = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs + if (property.NameEquals("credentialType"u8)) + { + credentialType = new DataReferenceCredentialType(property.Value.GetString()); +======== + if (property.NameEquals("keys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keys = AccountApiKeys.DeserializeAccountApiKeys(property.Value, options); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs + return new AnonymousAccessCredential(credentialType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new EndpointKeys(keys, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support writing '{options.Format}' format."); + } + } + + AnonymousAccessCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(EndpointKeys)} does not support writing '{options.Format}' format."); + } + } + + EndpointKeys IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AnonymousAccessCredential.Serialization.cs + return DeserializeAnonymousAccessCredential(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AnonymousAccessCredential)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeEndpointKeys(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointKeys)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.Serialization.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.cs new file mode 100644 index 000000000000..e4909d100d65 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointKeys.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointKeys. + public partial class EndpointKeys + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointKeys() + { + } + + /// Initializes a new instance of . + /// Dictionary of Keys for the endpoint. + /// Keeps track of any properties unknown to the library. + internal EndpointKeys(AccountApiKeys keys, IDictionary serializedAdditionalRawData) + { + Keys = keys; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Dictionary of Keys for the endpoint. + public AccountApiKeys Keys { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.Serialization.cs new file mode 100644 index 000000000000..237093c21ec1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelDeprecationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(FineTune)) + { + writer.WritePropertyName("fineTune"u8); + writer.WriteStringValue(FineTune.Value, "O"); + } + if (Optional.IsDefined(Inference)) + { + writer.WritePropertyName("inference"u8); + writer.WriteStringValue(Inference.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelDeprecationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelDeprecationProperties(document.RootElement, options); + } + + internal static EndpointModelDeprecationProperties DeserializeEndpointModelDeprecationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? fineTune = default; + DateTimeOffset? inference = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fineTune"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fineTune = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("inference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inference = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelDeprecationProperties(fineTune, inference, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelDeprecationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelDeprecationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelDeprecationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.cs new file mode 100644 index 000000000000..dd07142c21de --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelDeprecationProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelDeprecationProperties. + public partial class EndpointModelDeprecationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelDeprecationProperties() + { + } + + /// Initializes a new instance of . + /// The datetime of deprecation of the fineTune Model. + /// The datetime of deprecation of the inference Model. + /// Keeps track of any properties unknown to the library. + internal EndpointModelDeprecationProperties(DateTimeOffset? fineTune, DateTimeOffset? inference, IDictionary serializedAdditionalRawData) + { + FineTune = fineTune; + Inference = inference; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The datetime of deprecation of the fineTune Model. + public DateTimeOffset? FineTune { get; } + /// The datetime of deprecation of the inference Model. + public DateTimeOffset? Inference { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.Serialization.cs new file mode 100644 index 000000000000..6b63c91cf7e4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.Serialization.cs @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Capabilities)) + { + writer.WritePropertyName("capabilities"u8); + writer.WriteStartObject(); + foreach (var item in Capabilities) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Deprecation)) + { + writer.WritePropertyName("deprecation"u8); + writer.WriteObjectValue(Deprecation, options); + } + if (Optional.IsCollectionDefined(FinetuneCapabilities)) + { + writer.WritePropertyName("finetuneCapabilities"u8); + writer.WriteStartObject(); + foreach (var item in FinetuneCapabilities) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Format)) + { + writer.WritePropertyName("format"u8); + writer.WriteStringValue(Format); + } + if (Optional.IsDefined(IsDefaultVersion)) + { + writer.WritePropertyName("isDefaultVersion"u8); + writer.WriteBooleanValue(IsDefaultVersion.Value); + } + if (Optional.IsDefined(LifecycleStatus)) + { + writer.WritePropertyName("lifecycleStatus"u8); + writer.WriteStringValue(LifecycleStatus.Value.ToString()); + } + if (Optional.IsDefined(MaxCapacity)) + { + writer.WritePropertyName("maxCapacity"u8); + writer.WriteNumberValue(MaxCapacity.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(Skus)) + { + writer.WritePropertyName("skus"u8); + writer.WriteStartArray(); + foreach (var item in Skus) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelProperties(document.RootElement, options); + } + + internal static EndpointModelProperties DeserializeEndpointModelProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary capabilities = default; + EndpointModelDeprecationProperties deprecation = default; + IReadOnlyDictionary finetuneCapabilities = default; + string format = default; + bool? isDefaultVersion = default; + ModelLifecycleStatus? lifecycleStatus = default; + int? maxCapacity = default; + string name = default; + IReadOnlyList skus = default; + SystemData systemData = default; + string version = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + capabilities = dictionary; + continue; + } + if (property.NameEquals("deprecation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deprecation = EndpointModelDeprecationProperties.DeserializeEndpointModelDeprecationProperties(property.Value, options); + continue; + } + if (property.NameEquals("finetuneCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + finetuneCapabilities = dictionary; + continue; + } + if (property.NameEquals("format"u8)) + { + format = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDefaultVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDefaultVersion = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lifecycleStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lifecycleStatus = new ModelLifecycleStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("maxCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxCapacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("skus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuProperties.DeserializeEndpointModelSkuProperties(item, options)); + } + skus = array; + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelProperties( + capabilities ?? new ChangeTrackingDictionary(), + deprecation, + finetuneCapabilities ?? new ChangeTrackingDictionary(), + format, + isDefaultVersion, + lifecycleStatus, + maxCapacity, + name, + skus ?? new ChangeTrackingList(), + systemData, + version, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.cs new file mode 100644 index 000000000000..a3b90e45318d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelProperties.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Endpoint Model properties. + public partial class EndpointModelProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelProperties() + { + Capabilities = new ChangeTrackingDictionary(); + FinetuneCapabilities = new ChangeTrackingDictionary(); + Skus = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The capabilities. + /// + /// The capabilities for finetune models. + /// Deployment model format. + /// If the model is default version. + /// Model lifecycle status. + /// The max capacity. + /// Deployment model name. + /// The list of Model Sku. + /// Metadata pertaining to creation and last modification of the resource. + /// Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. + /// Keeps track of any properties unknown to the library. + internal EndpointModelProperties(IReadOnlyDictionary capabilities, EndpointModelDeprecationProperties deprecation, IReadOnlyDictionary finetuneCapabilities, string format, bool? isDefaultVersion, ModelLifecycleStatus? lifecycleStatus, int? maxCapacity, string name, IReadOnlyList skus, SystemData systemData, string version, IDictionary serializedAdditionalRawData) + { + Capabilities = capabilities; + Deprecation = deprecation; + FinetuneCapabilities = finetuneCapabilities; + Format = format; + IsDefaultVersion = isDefaultVersion; + LifecycleStatus = lifecycleStatus; + MaxCapacity = maxCapacity; + Name = name; + Skus = skus; + SystemData = systemData; + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The capabilities. + public IReadOnlyDictionary Capabilities { get; } + /// Gets the deprecation. + public EndpointModelDeprecationProperties Deprecation { get; } + /// The capabilities for finetune models. + public IReadOnlyDictionary FinetuneCapabilities { get; } + /// Deployment model format. + public string Format { get; } + /// If the model is default version. + public bool? IsDefaultVersion { get; } + /// Model lifecycle status. + public ModelLifecycleStatus? LifecycleStatus { get; } + /// The max capacity. + public int? MaxCapacity { get; } + /// Deployment model name. + public string Name { get; } + /// The list of Model Sku. + public IReadOnlyList Skus { get; } + /// Metadata pertaining to creation and last modification of the resource. + public SystemData SystemData { get; } + /// Optional. Deployment model version. If version is not specified, a default version will be assigned. The default version is different for different models and might change when there is new version available for a model. Default version for a model could be found from list models API. + public string Version { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.Serialization.cs new file mode 100644 index 000000000000..f3984d3369c3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuCapacityProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Default)) + { + writer.WritePropertyName("default"u8); + writer.WriteNumberValue(Default.Value); + } + if (Optional.IsDefined(Maximum)) + { + writer.WritePropertyName("maximum"u8); + writer.WriteNumberValue(Maximum.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuCapacityProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuCapacityProperties(document.RootElement, options); + } + + internal static EndpointModelSkuCapacityProperties DeserializeEndpointModelSkuCapacityProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? @default = default; + int? maximum = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("default"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + @default = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("maximum"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximum = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuCapacityProperties(@default, maximum, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuCapacityProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuCapacityProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuCapacityProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.cs new file mode 100644 index 000000000000..acdc267a87f2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuCapacityProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelSkuCapacityProperties. + public partial class EndpointModelSkuCapacityProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelSkuCapacityProperties() + { + } + + /// Initializes a new instance of . + /// The default capacity. + /// The maximum capacity. + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuCapacityProperties(int? @default, int? maximum, IDictionary serializedAdditionalRawData) + { + Default = @default; + Maximum = maximum; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The default capacity. + public int? Default { get; } + /// The maximum capacity. + public int? Maximum { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.Serialization.cs new file mode 100644 index 000000000000..64bd30a6de0e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.Serialization.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteObjectValue(Capacity, options); + } + if (Optional.IsCollectionDefined(ConnectionIds)) + { + writer.WritePropertyName("connectionIds"u8); + writer.WriteStartArray(); + foreach (var item in ConnectionIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DeprecationOn)) + { + writer.WritePropertyName("deprecationDate"u8); + writer.WriteStringValue(DeprecationOn.Value, "O"); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(RateLimits)) + { + writer.WritePropertyName("rateLimits"u8); + writer.WriteStartArray(); + foreach (var item in RateLimits) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(UsageName)) + { + writer.WritePropertyName("usageName"u8); + writer.WriteStringValue(UsageName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuProperties(document.RootElement, options); + } + + internal static EndpointModelSkuProperties DeserializeEndpointModelSkuProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointModelSkuCapacityProperties capacity = default; + IReadOnlyList connectionIds = default; + DateTimeOffset? deprecationDate = default; + string name = default; + IReadOnlyList rateLimits = default; + string usageName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = EndpointModelSkuCapacityProperties.DeserializeEndpointModelSkuCapacityProperties(property.Value, options); + continue; + } + if (property.NameEquals("connectionIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + connectionIds = array; + continue; + } + if (property.NameEquals("deprecationDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deprecationDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("rateLimits"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuRateLimitProperties.DeserializeEndpointModelSkuRateLimitProperties(item, options)); + } + rateLimits = array; + continue; + } + if (property.NameEquals("usageName"u8)) + { + usageName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuProperties( + capacity, + connectionIds ?? new ChangeTrackingList(), + deprecationDate, + name, + rateLimits ?? new ChangeTrackingList(), + usageName, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.cs new file mode 100644 index 000000000000..a66d13356c5e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelSkuProperties. + public partial class EndpointModelSkuProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelSkuProperties() + { + ConnectionIds = new ChangeTrackingList(); + RateLimits = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// The list of ARM id for the connection support this SKU. + /// The datetime of deprecation of the model SKU. + /// The name of the model SKU. + /// + /// The usage name of the model SKU. + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuProperties(EndpointModelSkuCapacityProperties capacity, IReadOnlyList connectionIds, DateTimeOffset? deprecationOn, string name, IReadOnlyList rateLimits, string usageName, IDictionary serializedAdditionalRawData) + { + Capacity = capacity; + ConnectionIds = connectionIds; + DeprecationOn = deprecationOn; + Name = name; + RateLimits = rateLimits; + UsageName = usageName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the capacity. + public EndpointModelSkuCapacityProperties Capacity { get; } + /// The list of ARM id for the connection support this SKU. + public IReadOnlyList ConnectionIds { get; } + /// The datetime of deprecation of the model SKU. + public DateTimeOffset? DeprecationOn { get; } + /// The name of the model SKU. + public string Name { get; } + /// Gets the rate limits. + public IReadOnlyList RateLimits { get; } + /// The usage name of the model SKU. + public string UsageName { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.Serialization.cs new file mode 100644 index 000000000000..c5881ffcc7cd --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuRateLimitProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(RenewalPeriod)) + { + writer.WritePropertyName("renewalPeriod"u8); + writer.WriteNumberValue(RenewalPeriod.Value); + } + if (Optional.IsCollectionDefined(Rules)) + { + writer.WritePropertyName("rules"u8); + writer.WriteStartArray(); + foreach (var item in Rules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuRateLimitProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuRateLimitProperties(document.RootElement, options); + } + + internal static EndpointModelSkuRateLimitProperties DeserializeEndpointModelSkuRateLimitProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? count = default; + float? renewalPeriod = default; + IReadOnlyList rules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("renewalPeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + renewalPeriod = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("rules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuRateLimitRuleProperties.DeserializeEndpointModelSkuRateLimitRuleProperties(item, options)); + } + rules = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuRateLimitProperties(count, renewalPeriod, rules ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuRateLimitProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuRateLimitProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.cs new file mode 100644 index 000000000000..2d3c8862689a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelSkuRateLimitProperties. + public partial class EndpointModelSkuRateLimitProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelSkuRateLimitProperties() + { + Rules = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The count value of Call Rate Limit. + /// The renewal period in seconds of Call Rate Limit. + /// The call rate limit for the model. + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuRateLimitProperties(float? count, float? renewalPeriod, IReadOnlyList rules, IDictionary serializedAdditionalRawData) + { + Count = count; + RenewalPeriod = renewalPeriod; + Rules = rules; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The count value of Call Rate Limit. + public float? Count { get; } + /// The renewal period in seconds of Call Rate Limit. + public float? RenewalPeriod { get; } + /// The call rate limit for the model. + public IReadOnlyList Rules { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.Serialization.cs new file mode 100644 index 000000000000..ee3fd37ac487 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuRateLimitRulePatternProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Method)) + { + writer.WritePropertyName("method"u8); + writer.WriteStringValue(Method); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuRateLimitRulePatternProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuRateLimitRulePatternProperties(document.RootElement, options); + } + + internal static EndpointModelSkuRateLimitRulePatternProperties DeserializeEndpointModelSkuRateLimitRulePatternProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string method = default; + string path = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("method"u8)) + { + method = property.Value.GetString(); + continue; + } + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuRateLimitRulePatternProperties(method, path, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuRateLimitRulePatternProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuRateLimitRulePatternProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRulePatternProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs new file mode 100644 index 000000000000..c85d51affaa4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs + /// BlobReferenceSASRequest for getBlobReferenceSAS API. + public partial class GetBlobReferenceSasRequestDto +======== + /// The EndpointModelSkuRateLimitRulePatternProperties. + public partial class EndpointModelSkuRateLimitRulePatternProperties +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs + /// Initializes a new instance of . + public GetBlobReferenceSasRequestDto() + { + } + + /// Initializes a new instance of . + /// Id of the asset to be accessed. + /// Blob uri of the asset to be accessed. + /// Keeps track of any properties unknown to the library. + internal GetBlobReferenceSasRequestDto(string assetId, Uri blobUri, IDictionary serializedAdditionalRawData) + { + AssetId = assetId; + BlobUri = blobUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Id of the asset to be accessed. + public string AssetId { get; set; } + /// Blob uri of the asset to be accessed. + public Uri BlobUri { get; set; } +======== + /// Initializes a new instance of . + internal EndpointModelSkuRateLimitRulePatternProperties() + { + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuRateLimitRulePatternProperties(string method, string path, IDictionary serializedAdditionalRawData) + { + Method = method; + Path = path; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the method. + public string Method { get; } + /// Gets the path. + public string Path { get; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.Serialization.cs new file mode 100644 index 000000000000..7c8109967e7e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class EndpointModelSkuRateLimitRuleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(DynamicThrottlingEnabled)) + { + writer.WritePropertyName("dynamicThrottlingEnabled"u8); + writer.WriteBooleanValue(DynamicThrottlingEnabled.Value); + } + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + if (Optional.IsCollectionDefined(MatchPatterns)) + { + writer.WritePropertyName("matchPatterns"u8); + writer.WriteStartArray(); + foreach (var item in MatchPatterns) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(MinCount)) + { + writer.WritePropertyName("minCount"u8); + writer.WriteNumberValue(MinCount.Value); + } + if (Optional.IsDefined(RenewalPeriod)) + { + writer.WritePropertyName("renewalPeriod"u8); + writer.WriteNumberValue(RenewalPeriod.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointModelSkuRateLimitRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModelSkuRateLimitRuleProperties(document.RootElement, options); + } + + internal static EndpointModelSkuRateLimitRuleProperties DeserializeEndpointModelSkuRateLimitRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? count = default; + bool? dynamicThrottlingEnabled = default; + string key = default; + IReadOnlyList matchPatterns = default; + float? minCount = default; + float? renewalPeriod = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("dynamicThrottlingEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicThrottlingEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("key"u8)) + { + key = property.Value.GetString(); + continue; + } + if (property.NameEquals("matchPatterns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelSkuRateLimitRulePatternProperties.DeserializeEndpointModelSkuRateLimitRulePatternProperties(item, options)); + } + matchPatterns = array; + continue; + } + if (property.NameEquals("minCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minCount = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("renewalPeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + renewalPeriod = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointModelSkuRateLimitRuleProperties( + count, + dynamicThrottlingEnabled, + key, + matchPatterns ?? new ChangeTrackingList(), + minCount, + renewalPeriod, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointModelSkuRateLimitRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointModelSkuRateLimitRuleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModelSkuRateLimitRuleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.cs new file mode 100644 index 000000000000..7e849da74a33 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRuleProperties.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModelSkuRateLimitRuleProperties. + public partial class EndpointModelSkuRateLimitRuleProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModelSkuRateLimitRuleProperties() + { + MatchPatterns = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// If the dynamic throttling is enabled. + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuRateLimitRuleProperties(float? count, bool? dynamicThrottlingEnabled, string key, IReadOnlyList matchPatterns, float? minCount, float? renewalPeriod, IDictionary serializedAdditionalRawData) + { + Count = count; + DynamicThrottlingEnabled = dynamicThrottlingEnabled; + Key = key; + MatchPatterns = matchPatterns; + MinCount = minCount; + RenewalPeriod = renewalPeriod; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the count. + public float? Count { get; } + /// If the dynamic throttling is enabled. + public bool? DynamicThrottlingEnabled { get; } + /// Gets the key. + public string Key { get; } + /// Gets the match patterns. + public IReadOnlyList MatchPatterns { get; } + /// Gets the min count. + public float? MinCount { get; } + /// Gets the renewal period. + public float? RenewalPeriod { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs new file mode 100644 index 000000000000..d84ea4f6ca74 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs + internal partial class ServerlessEndpointTrackedResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support writing '{format}' format."); +======== + internal partial class EndpointModels : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModels)} does not support writing '{format}' format."); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs + ServerlessEndpointTrackedResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement, options); + } + + internal static ServerlessEndpointTrackedResourceArmPaginatedResult DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) +======== + EndpointModels IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModels)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModels(document.RootElement, options); + } + + internal static EndpointModels DeserializeEndpointModels(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + string nextLink = default; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs +======== + IReadOnlyList value = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ServerlessEndpointData.DeserializeServerlessEndpointData(item, options)); +======== + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelProperties.DeserializeEndpointModelProperties(item, options)); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs + return new ServerlessEndpointTrackedResourceArmPaginatedResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new EndpointModels(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointTrackedResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(EndpointModels)} does not support writing '{options.Format}' format."); + } + } + + EndpointModels IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs + return DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeEndpointModels(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModels)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.cs new file mode 100644 index 000000000000..2cf98fe420c2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointModels. + internal partial class EndpointModels + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointModels() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The link to the next page constructed using the continuationToken. If null, there are no additional pages. + /// List of models. + /// Keeps track of any properties unknown to the library. + internal EndpointModels(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The link to the next page constructed using the continuationToken. If null, there are no additional pages. + public string NextLink { get; } + /// List of models. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.Serialization.cs new file mode 100644 index 000000000000..4ceab833aeba --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.Serialization.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownEndpointResourceProperties))] + public partial class EndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + + internal static EndpointResourceProperties DeserializeEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("endpointType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Azure.ContentSafety": return ContentSafetyEndpointResourceProperties.DeserializeContentSafetyEndpointResourceProperties(element, options); + case "Azure.OpenAI": return OpenAIEndpointResourceProperties.DeserializeOpenAIEndpointResourceProperties(element, options); + case "Azure.Speech": return SpeechEndpointResourceProperties.DeserializeSpeechEndpointResourceProperties(element, options); + case "managedOnlineEndpoint": return ManagedOnlineEndpointResourceProperties.DeserializeManagedOnlineEndpointResourceProperties(element, options); + case "serverlessEndpoint": return ServerlessEndpointResourceProperties.DeserializeServerlessEndpointResourceProperties(element, options); + } + } + return UnknownEndpointResourceProperties.DeserializeUnknownEndpointResourceProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.cs new file mode 100644 index 000000000000..3c637ddc48a0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourceProperties.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public abstract partial class EndpointResourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected EndpointResourceProperties() + { + Deployments = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal EndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) + { + AssociatedResourceId = associatedResourceId; + Deployments = deployments; + EndpointType = endpointType; + EndpointUri = endpointUri; + FailureReason = failureReason; + Location = location; + Name = name; + ProvisioningState = provisioningState; + ShouldCreateAiServicesEndpoint = shouldCreateAiServicesEndpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Byo resource id for creating the built-in model service endpoints. + public ResourceIdentifier AssociatedResourceId { get; set; } + /// Deployments info. + public IList Deployments { get; } + /// Type of the endpoint. + internal EndpointType EndpointType { get; set; } + /// Uri of the endpoint. + public Uri EndpointUri { get; set; } + /// The failure reason if the creation failed. + public string FailureReason { get; set; } + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + public AzureLocation? Location { get; set; } + /// Name of the endpoint. + public string Name { get; set; } + /// Read-only provision state status property. + public DefaultResourceProvisioningState? ProvisioningState { get; } + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + public bool? ShouldCreateAiServicesEndpoint { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 000000000000..243169e08d6d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class EndpointResourcePropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourcePropertiesBasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static EndpointResourcePropertiesBasicResourceArmPaginatedResult DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EndpointResourcePropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourcePropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourcePropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 000000000000..a5c86ae427ee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointResourcePropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The EndpointResourcePropertiesBasicResourceArmPaginatedResult. + internal partial class EndpointResourcePropertiesBasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal EndpointResourcePropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointResourcePropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointType.cs new file mode 100644 index 000000000000..d021f7f1d090 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Type of the endpoint. + public readonly partial struct EndpointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EndpointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureOpenAIValue = "Azure.OpenAI"; + private const string AzureSpeechValue = "Azure.Speech"; + private const string AzureContentSafetyValue = "Azure.ContentSafety"; + private const string AzureLlamaValue = "Azure.Llama"; + private const string ManagedOnlineEndpointValue = "managedOnlineEndpoint"; + private const string ServerlessEndpointValue = "serverlessEndpoint"; + + /// Azure.OpenAI. + public static EndpointType AzureOpenAI { get; } = new EndpointType(AzureOpenAIValue); + /// Azure.Speech. + public static EndpointType AzureSpeech { get; } = new EndpointType(AzureSpeechValue); + /// Azure.ContentSafety. + public static EndpointType AzureContentSafety { get; } = new EndpointType(AzureContentSafetyValue); + /// Azure.Llama. + public static EndpointType AzureLlama { get; } = new EndpointType(AzureLlamaValue); + /// managedOnlineEndpoint. + public static EndpointType ManagedOnlineEndpoint { get; } = new EndpointType(ManagedOnlineEndpointValue); + /// serverlessEndpoint. + public static EndpointType ServerlessEndpoint { get; } = new EndpointType(ServerlessEndpointValue); + /// Determines if two values are the same. + public static bool operator ==(EndpointType left, EndpointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EndpointType left, EndpointType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator EndpointType(string value) => new EndpointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EndpointType other && Equals(other); + /// + public bool Equals(EndpointType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs index 19579a775775..5091031a9d5c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.Serialization.cs @@ -26,6 +26,26 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); + if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) + { + if (FeatureDataTypeOverride != null) + { + writer.WritePropertyName("featureDataTypeOverride"u8); + writer.WriteStartObject(); + foreach (var item in FeatureDataTypeOverride) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value.ToString()); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("featureDataTypeOverride"); + } + } + writer.WritePropertyName("featureImportanceSettings"u8); + writer.WriteObjectValue(FeatureImportanceSettings, options); writer.WritePropertyName("metricThreshold"u8); writer.WriteObjectValue(MetricThreshold, options); writer.WritePropertyName("featureImportanceSettings"u8); @@ -39,6 +59,7 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteEndArray(); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); +<<<<<<< HEAD if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) { if (FeatureDataTypeOverride != null) @@ -61,6 +82,10 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteStringValue(SignalType.ToString()); if (Optional.IsCollectionDefined(NotificationTypes)) { +======= + if (Optional.IsCollectionDefined(NotificationTypes)) + { +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (NotificationTypes != null) { writer.WritePropertyName("notificationTypes"u8); @@ -132,11 +157,18 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib { return null; } + IDictionary featureDataTypeOverride = default; + FeatureImportanceSettings featureImportanceSettings = default; FeatureAttributionMetricThreshold metricThreshold = default; FeatureImportanceSettings featureImportanceSettings = default; IList productionData = default; MonitoringInputDataBase referenceData = default; +<<<<<<< HEAD IDictionary featureDataTypeOverride = default; +======= + IList notificationTypes = default; + IDictionary properties = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MonitoringSignalType signalType = default; IList notificationTypes = default; IDictionary properties = default; @@ -144,6 +176,26 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("featureDataTypeOverride"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureDataTypeOverride = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, new MonitoringFeatureDataType(property0.Value.GetString())); + } + featureDataTypeOverride = dictionary; + continue; + } + if (property.NameEquals("featureImportanceSettings"u8)) + { + featureImportanceSettings = FeatureImportanceSettings.DeserializeFeatureImportanceSettings(property.Value, options); + continue; + } if (property.NameEquals("metricThreshold"u8)) { metricThreshold = FeatureAttributionMetricThreshold.DeserializeFeatureAttributionMetricThreshold(property.Value, options); @@ -169,6 +221,7 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("featureDataTypeOverride"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -196,6 +249,15 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib notificationTypes = null; continue; } +======= + if (property.NameEquals("notificationTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationTypes = null; + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -226,10 +288,17 @@ internal static FeatureAttributionDriftMonitoringSignal DeserializeFeatureAttrib } serializedAdditionalRawData = rawDataDictionary; return new FeatureAttributionDriftMonitoringSignal( +<<<<<<< HEAD +======= + notificationTypes ?? new ChangeTrackingList(), + properties ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 signalType, notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, + featureDataTypeOverride ?? new ChangeTrackingDictionary(), + featureImportanceSettings, metricThreshold, featureImportanceSettings, productionData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs index 8d447ecd3838..5f3ccf5ebaaa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureAttributionDriftMonitoringSignal.cs @@ -15,6 +15,7 @@ namespace Azure.ResourceManager.MachineLearning.Models public partial class FeatureAttributionDriftMonitoringSignal : MonitoringSignalBase { /// Initializes a new instance of . + /// [Required] The settings for computing feature importance. /// [Required] A list of metrics to calculate and their associated thresholds. /// [Required] The settings for computing feature importance. /// @@ -27,14 +28,22 @@ public partial class FeatureAttributionDriftMonitoringSignal : MonitoringSignalB /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , and . /// +<<<<<<< HEAD /// , , or is null. public FeatureAttributionDriftMonitoringSignal(FeatureAttributionMetricThreshold metricThreshold, FeatureImportanceSettings featureImportanceSettings, IEnumerable productionData, MonitoringInputDataBase referenceData) +======= + /// , , or is null. + public FeatureAttributionDriftMonitoringSignal(FeatureImportanceSettings featureImportanceSettings, FeatureAttributionMetricThreshold metricThreshold, IEnumerable productionData, MonitoringInputDataBase referenceData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { + Argument.AssertNotNull(featureImportanceSettings, nameof(featureImportanceSettings)); Argument.AssertNotNull(metricThreshold, nameof(metricThreshold)); Argument.AssertNotNull(featureImportanceSettings, nameof(featureImportanceSettings)); Argument.AssertNotNull(productionData, nameof(productionData)); Argument.AssertNotNull(referenceData, nameof(referenceData)); + FeatureDataTypeOverride = new ChangeTrackingDictionary(); + FeatureImportanceSettings = featureImportanceSettings; MetricThreshold = metricThreshold; FeatureImportanceSettings = featureImportanceSettings; ProductionData = productionData.ToList(); @@ -44,10 +53,17 @@ public FeatureAttributionDriftMonitoringSignal(FeatureAttributionMetricThreshold } /// Initializes a new instance of . +<<<<<<< HEAD +======= + /// The current notification mode for this signal. + /// Property dictionary. Properties can be added, but not removed or altered. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Specifies the type of signal to monitor. /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. + /// A dictionary that maps feature names to their respective data types. + /// [Required] The settings for computing feature importance. /// [Required] A list of metrics to calculate and their associated thresholds. /// [Required] The settings for computing feature importance. /// @@ -60,9 +76,15 @@ public FeatureAttributionDriftMonitoringSignal(FeatureAttributionMetricThreshold /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , and . /// +<<<<<<< HEAD /// A dictionary that maps feature names to their respective data types. internal FeatureAttributionDriftMonitoringSignal(MonitoringSignalType signalType, IList notificationTypes, IDictionary properties, IDictionary serializedAdditionalRawData, FeatureAttributionMetricThreshold metricThreshold, FeatureImportanceSettings featureImportanceSettings, IList productionData, MonitoringInputDataBase referenceData, IDictionary featureDataTypeOverride) : base(signalType, notificationTypes, properties, serializedAdditionalRawData) +======= + internal FeatureAttributionDriftMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, FeatureImportanceSettings featureImportanceSettings, FeatureAttributionMetricThreshold metricThreshold, IList productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { + FeatureDataTypeOverride = featureDataTypeOverride; + FeatureImportanceSettings = featureImportanceSettings; MetricThreshold = metricThreshold; FeatureImportanceSettings = featureImportanceSettings; ProductionData = productionData; @@ -76,6 +98,10 @@ internal FeatureAttributionDriftMonitoringSignal() { } + /// A dictionary that maps feature names to their respective data types. + public IDictionary FeatureDataTypeOverride { get; set; } + /// [Required] The settings for computing feature importance. + public FeatureImportanceSettings FeatureImportanceSettings { get; set; } /// [Required] A list of metrics to calculate and their associated thresholds. public FeatureAttributionMetricThreshold MetricThreshold { get; set; } /// [Required] The settings for computing feature importance. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs index 90cd45361c93..96a3b4942dda 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.Serialization.cs @@ -26,6 +26,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteStartObject(); +<<<<<<< HEAD +======= + if (Optional.IsCollectionDefined(DataAvailabilityStatus)) + { + writer.WritePropertyName("dataAvailabilityStatus"u8); + writer.WriteStartArray(); + foreach (var item in DataAvailabilityStatus) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(DisplayName)) { writer.WritePropertyName("displayName"u8); @@ -48,6 +66,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteNull("featureWindow"); } } +<<<<<<< HEAD if (Optional.IsCollectionDefined(DataAvailabilityStatus)) { writer.WritePropertyName("dataAvailabilityStatus"u8); @@ -58,16 +77,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteEndArray(); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(JobId)) { writer.WritePropertyName("jobId"u8); writer.WriteStringValue(JobId); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); writer.WriteStartObject(); foreach (var item in Tags) +======= + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + foreach (var item in Properties) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { writer.WritePropertyName(item.Key); writer.WriteStringValue(item.Value); @@ -139,12 +168,22 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac { return null; } +<<<<<<< HEAD +======= + IList dataAvailabilityStatus = default; + string description = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 string displayName = default; string description = default; FeatureWindow featureWindow = default; +<<<<<<< HEAD IList dataAvailabilityStatus = default; string jobId = default; IDictionary tags = default; +======= + string jobId = default; + IDictionary properties = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MaterializationComputeResource resource = default; IDictionary sparkConfiguration = default; IDictionary properties = default; @@ -152,6 +191,28 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD +======= + if (property.NameEquals("dataAvailabilityStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new DataAvailabilityStatus(item.GetString())); + } + dataAvailabilityStatus = array; + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("displayName"u8)) { displayName = property.Value.GetString(); @@ -172,6 +233,7 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac featureWindow = FeatureWindow.DeserializeFeatureWindow(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("dataAvailabilityStatus"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -186,12 +248,18 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac dataAvailabilityStatus = array; continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("jobId"u8)) { jobId = property.Value.GetString(); continue; } +<<<<<<< HEAD if (property.NameEquals("tags"u8)) +======= + if (property.NameEquals("properties"u8)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { if (property.Value.ValueKind == JsonValueKind.Null) { @@ -202,7 +270,11 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac { dictionary.Add(property0.Name, property0.Value.GetString()); } +<<<<<<< HEAD tags = dictionary; +======= + properties = dictionary; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("resource"u8)) @@ -249,12 +321,22 @@ internal static FeatureSetVersionBackfillContent DeserializeFeatureSetVersionBac } serializedAdditionalRawData = rawDataDictionary; return new FeatureSetVersionBackfillContent( +<<<<<<< HEAD +======= + dataAvailabilityStatus ?? new ChangeTrackingList(), + description, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 displayName, description, featureWindow, +<<<<<<< HEAD dataAvailabilityStatus ?? new ChangeTrackingList(), jobId, tags ?? new ChangeTrackingDictionary(), +======= + jobId, + properties ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 resource, sparkConfiguration ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs index 2ca2a59b99a1..53bb410a8c99 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeatureSetVersionBackfillContent.cs @@ -49,48 +49,84 @@ public partial class FeatureSetVersionBackfillContent public FeatureSetVersionBackfillContent() { DataAvailabilityStatus = new ChangeTrackingList(); +<<<<<<< HEAD +======= + Properties = new ChangeTrackingDictionary(); + SparkConfiguration = new ChangeTrackingDictionary(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Tags = new ChangeTrackingDictionary(); SparkConfiguration = new ChangeTrackingDictionary(); Properties = new ChangeTrackingDictionary(); } /// Initializes a new instance of . +<<<<<<< HEAD +======= + /// Specified the data availability status that you want to backfill. + /// Specifies description. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Specifies description. /// Specifies description. /// Specifies the backfill feature window to be materialized. +<<<<<<< HEAD /// Specified the data availability status that you want to backfill. /// Specify the jobId to retry the failed materialization. /// Specifies the tags. +======= + /// Specify the jobId to retry the failed materialization. + /// Specifies the properties. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Specifies the compute resource settings. /// Specifies the spark compute settings. /// Specifies the properties. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal FeatureSetVersionBackfillContent(string displayName, string description, FeatureWindow featureWindow, IList dataAvailabilityStatus, string jobId, IDictionary tags, MaterializationComputeResource resource, IDictionary sparkConfiguration, IDictionary properties, IDictionary serializedAdditionalRawData) { +======= + internal FeatureSetVersionBackfillContent(IList dataAvailabilityStatus, string description, string displayName, FeatureWindow featureWindow, string jobId, IDictionary properties, MaterializationComputeResource resource, IDictionary sparkConfiguration, IDictionary tags, IDictionary serializedAdditionalRawData) + { + DataAvailabilityStatus = dataAvailabilityStatus; + Description = description; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 DisplayName = displayName; Description = description; FeatureWindow = featureWindow; +<<<<<<< HEAD DataAvailabilityStatus = dataAvailabilityStatus; JobId = jobId; Tags = tags; +======= + JobId = jobId; + Properties = properties; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Resource = resource; SparkConfiguration = sparkConfiguration; Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Specified the data availability status that you want to backfill. + public IList DataAvailabilityStatus { get; } /// Specifies description. public string DisplayName { get; set; } /// Specifies description. public string Description { get; set; } /// Specifies the backfill feature window to be materialized. public FeatureWindow FeatureWindow { get; set; } +<<<<<<< HEAD /// Specified the data availability status that you want to backfill. public IList DataAvailabilityStatus { get; } /// Specify the jobId to retry the failed materialization. public string JobId { get; set; } /// Specifies the tags. public IDictionary Tags { get; } +======= + /// Specify the jobId to retry the failed materialization. + public string JobId { get; set; } + /// Specifies the properties. + public IDictionary Properties { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Specifies the compute resource settings. internal MaterializationComputeResource Resource { get; set; } /// Specifies the instance type. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs index 43bf1bb0259d..130ffe282f76 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs @@ -11,8 +11,9 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.MachineLearning.Models +namespace Azure.ResourceManager.ComputeFleet.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs public partial class FeaturesetVersionBackfillResponse : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -42,6 +43,32 @@ void IJsonModel.Write(Utf8JsonWriter writer, { writer.WriteNull("jobIds"); } +======== + internal partial class FleetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -61,6 +88,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteEndObject(); } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs FeaturesetVersionBackfillResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -74,6 +102,21 @@ FeaturesetVersionBackfillResponse IJsonModel. } internal static FeaturesetVersionBackfillResponse DeserializeFeaturesetVersionBackfillResponse(JsonElement element, ModelReaderWriterOptions options = null) +======== + FleetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetListResult(document.RootElement, options); + } + + internal static FleetListResult DeserializeFleetListResult(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs { options ??= ModelSerializationExtensions.WireOptions; @@ -81,11 +124,17 @@ internal static FeaturesetVersionBackfillResponse DeserializeFeaturesetVersionBa { return null; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs IReadOnlyList jobIds = default; +======== + IReadOnlyList value = default; + Uri nextLink = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs if (property.NameEquals("jobIds"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -99,6 +148,25 @@ internal static FeaturesetVersionBackfillResponse DeserializeFeaturesetVersionBa array.Add(item.GetString()); } jobIds = array; +======== + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetData.DeserializeComputeFleetData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs continue; } if (options.Format != "W") @@ -107,18 +175,28 @@ internal static FeaturesetVersionBackfillResponse DeserializeFeaturesetVersionBa } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs return new FeaturesetVersionBackfillResponse(jobIds ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new FleetListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs throw new FormatException($"The model {nameof(FeaturesetVersionBackfillResponse)} does not support writing '{options.Format}' format."); } } @@ -126,12 +204,22 @@ BinaryData IPersistableModel.Write(ModelReade FeaturesetVersionBackfillResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(FleetListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.Serialization.cs return DeserializeFeaturesetVersionBackfillResponse(document.RootElement, options); } default: @@ -140,5 +228,15 @@ FeaturesetVersionBackfillResponse IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeFleetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/FleetListResult.Serialization.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs index 11e2aad38a10..a5eba1ae4883 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs @@ -10,8 +10,13 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs /// Response payload for creating a backfill request for a given feature set version. public partial class FeaturesetVersionBackfillResponse +======== + /// The AccountApiKeys. + public partial class AccountApiKeys +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +50,18 @@ public partial class FeaturesetVersionBackfillResponse /// private IDictionary _serializedAdditionalRawData; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs /// Initializes a new instance of . internal FeaturesetVersionBackfillResponse() +======== + /// Initializes a new instance of . + internal AccountApiKeys() +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs { JobIds = new ChangeTrackingList(); } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FeaturesetVersionBackfillResponse.cs /// Initializes a new instance of . /// List of jobs submitted as part of the backfill request. /// Keeps track of any properties unknown to the library. @@ -62,5 +73,22 @@ internal FeaturesetVersionBackfillResponse(IReadOnlyList jobIds, IDictio /// List of jobs submitted as part of the backfill request. public IReadOnlyList JobIds { get; } +======== + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal AccountApiKeys(string key1, string key2, IDictionary serializedAdditionalRawData) + { + Key1 = key1; + Key2 = key2; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the key 1. + public string Key1 { get; } + /// Gets the key 2. + public string Key2 { get; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/AccountApiKeys.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.Serialization.cs new file mode 100644 index 000000000000..82961ef25aba --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.Serialization.cs @@ -0,0 +1,483 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class FineTuningJob : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningJob)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("fineTuningDetails"u8); + writer.WriteObjectValue(FineTuningDetails, options); + if (Optional.IsDefined(Resources)) + { + writer.WritePropertyName("resources"u8); + writer.WriteObjectValue(Resources, options); + } + if (Optional.IsDefined(QueueSettings)) + { + if (QueueSettings != null) + { + writer.WritePropertyName("queueSettings"u8); + writer.WriteObjectValue(QueueSettings, options); + } + else + { + writer.WriteNull("queueSettings"); + } + } + writer.WritePropertyName("outputs"u8); + writer.WriteStartObject(); + foreach (var item in Outputs) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + if (Optional.IsDefined(ComponentId)) + { + if (ComponentId != null) + { + writer.WritePropertyName("componentId"u8); + writer.WriteStringValue(ComponentId); + } + else + { + writer.WriteNull("componentId"); + } + } + if (Optional.IsDefined(ComputeId)) + { + if (ComputeId != null) + { + writer.WritePropertyName("computeId"u8); + writer.WriteStringValue(ComputeId); + } + else + { + writer.WriteNull("computeId"); + } + } + if (Optional.IsDefined(DisplayName)) + { + if (DisplayName != null) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + else + { + writer.WriteNull("displayName"); + } + } + if (Optional.IsDefined(ExperimentName)) + { + writer.WritePropertyName("experimentName"u8); + writer.WriteStringValue(ExperimentName); + } + if (Optional.IsDefined(Identity)) + { + if (Identity != null) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + else + { + writer.WriteNull("identity"); + } + } + if (Optional.IsDefined(IsArchived)) + { + writer.WritePropertyName("isArchived"u8); + writer.WriteBooleanValue(IsArchived.Value); + } + writer.WritePropertyName("jobType"u8); + writer.WriteStringValue(JobType.ToString()); + if (Optional.IsDefined(NotificationSetting)) + { + if (NotificationSetting != null) + { + writer.WritePropertyName("notificationSetting"u8); + writer.WriteObjectValue(NotificationSetting, options); + } + else + { + writer.WriteNull("notificationSetting"); + } + } + if (Optional.IsCollectionDefined(Services)) + { + if (Services != null) + { + writer.WritePropertyName("services"u8); + writer.WriteStartObject(); + foreach (var item in Services) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("services"); + } + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + if (Description != null) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + else + { + writer.WriteNull("description"); + } + } + if (Optional.IsCollectionDefined(Properties)) + { + if (Properties != null) + { + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + foreach (var item in Properties) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("properties"); + } + } + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags != null) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("tags"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FineTuningJob IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningJob)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFineTuningJob(document.RootElement, options); + } + + internal static FineTuningJob DeserializeFineTuningJob(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FineTuningVertical fineTuningDetails = default; + JobResources resources = default; + JobQueueSettings queueSettings = default; + IDictionary outputs = default; + ResourceIdentifier componentId = default; + ResourceIdentifier computeId = default; + string displayName = default; + string experimentName = default; + MachineLearningIdentityConfiguration identity = default; + bool? isArchived = default; + JobType jobType = default; + NotificationSetting notificationSetting = default; + IDictionary services = default; + MachineLearningJobStatus? status = default; + string description = default; + IDictionary properties = default; + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fineTuningDetails"u8)) + { + fineTuningDetails = FineTuningVertical.DeserializeFineTuningVertical(property.Value, options); + continue; + } + if (property.NameEquals("resources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resources = JobResources.DeserializeJobResources(property.Value, options); + continue; + } + if (property.NameEquals("queueSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + queueSettings = null; + continue; + } + queueSettings = JobQueueSettings.DeserializeJobQueueSettings(property.Value, options); + continue; + } + if (property.NameEquals("outputs"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, MachineLearningJobOutput.DeserializeMachineLearningJobOutput(property0.Value, options)); + } + outputs = dictionary; + continue; + } + if (property.NameEquals("componentId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + componentId = null; + continue; + } + componentId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("computeId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + computeId = null; + continue; + } + computeId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("displayName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + displayName = null; + continue; + } + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("experimentName"u8)) + { + experimentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + identity = null; + continue; + } + identity = MachineLearningIdentityConfiguration.DeserializeMachineLearningIdentityConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("isArchived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isArchived = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new JobType(property.Value.GetString()); + continue; + } + if (property.NameEquals("notificationSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationSetting = null; + continue; + } + notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); + continue; + } + if (property.NameEquals("services"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + services = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, MachineLearningJobService.DeserializeMachineLearningJobService(property0.Value, options)); + } + services = dictionary; + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new MachineLearningJobStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + description = null; + continue; + } + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + properties = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + properties = dictionary; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + tags = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FineTuningJob( + description, + properties ?? new ChangeTrackingDictionary(), + tags ?? new ChangeTrackingDictionary(), + serializedAdditionalRawData, + componentId, + computeId, + displayName, + experimentName, + identity, + isArchived, + jobType, + notificationSetting, + services ?? new ChangeTrackingDictionary(), + status, + fineTuningDetails, + resources, + queueSettings, + outputs); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FineTuningJob)} does not support writing '{options.Format}' format."); + } + } + + FineTuningJob IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFineTuningJob(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FineTuningJob)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.cs new file mode 100644 index 000000000000..f18a5f65c768 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningJob.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// FineTuning Job definition. + public partial class FineTuningJob : MachineLearningJobProperties + { + /// Initializes a new instance of . + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + /// or is null. + public FineTuningJob(FineTuningVertical fineTuningDetails, IDictionary outputs) + { + Argument.AssertNotNull(fineTuningDetails, nameof(fineTuningDetails)); + Argument.AssertNotNull(outputs, nameof(outputs)); + + FineTuningDetails = fineTuningDetails; + Outputs = outputs; + JobType = JobType.FineTuning; + } + + /// Initializes a new instance of . + /// The asset description text. + /// The asset property dictionary. + /// Tag dictionary. Tags can be added, removed, and updated. + /// Keeps track of any properties unknown to the library. + /// ARM resource ID of the component resource. + /// ARM resource ID of the compute resource. + /// Display name of job. + /// The name of the experiment the job belongs to. If not set, the job is placed in the "Default" experiment. + /// + /// Identity configuration. If set, this should be one of AmlToken, ManagedIdentity, UserIdentity or null. + /// Defaults to AmlToken if null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Is the asset archived?. + /// [Required] Specifies the type of job. + /// Notification setting for the job. + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Instance types and other resources for the job. + /// Queue settings for the job. + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + internal FineTuningJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, FineTuningVertical fineTuningDetails, JobResources resources, JobQueueSettings queueSettings, IDictionary outputs) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) + { + FineTuningDetails = fineTuningDetails; + Resources = resources; + QueueSettings = queueSettings; + Outputs = outputs; + JobType = jobType; + } + + /// Initializes a new instance of for deserialization. + internal FineTuningJob() + { + } + + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public FineTuningVertical FineTuningDetails { get; set; } + /// Instance types and other resources for the job. + internal JobResources Resources { get; set; } + /// List of instance types to choose from. + public IList ResourcesInstanceTypes + { + get + { + if (Resources is null) + Resources = new JobResources(); + return Resources.InstanceTypes; + } + } + + /// Queue settings for the job. + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + + /// + /// [Required] + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + public IDictionary Outputs { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningTaskType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningTaskType.cs new file mode 100644 index 000000000000..d4dea3c5db18 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningTaskType.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The FineTuningTaskType. + public readonly partial struct FineTuningTaskType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FineTuningTaskType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ChatCompletionValue = "ChatCompletion"; + private const string TextCompletionValue = "TextCompletion"; + private const string TextClassificationValue = "TextClassification"; + private const string QuestionAnsweringValue = "QuestionAnswering"; + private const string TextSummarizationValue = "TextSummarization"; + private const string TokenClassificationValue = "TokenClassification"; + private const string TextTranslationValue = "TextTranslation"; + private const string ImageClassificationValue = "ImageClassification"; + private const string ImageInstanceSegmentationValue = "ImageInstanceSegmentation"; + private const string ImageObjectDetectionValue = "ImageObjectDetection"; + private const string VideoMultiObjectTrackingValue = "VideoMultiObjectTracking"; + + /// ChatCompletion. + public static FineTuningTaskType ChatCompletion { get; } = new FineTuningTaskType(ChatCompletionValue); + /// TextCompletion. + public static FineTuningTaskType TextCompletion { get; } = new FineTuningTaskType(TextCompletionValue); + /// TextClassification. + public static FineTuningTaskType TextClassification { get; } = new FineTuningTaskType(TextClassificationValue); + /// QuestionAnswering. + public static FineTuningTaskType QuestionAnswering { get; } = new FineTuningTaskType(QuestionAnsweringValue); + /// TextSummarization. + public static FineTuningTaskType TextSummarization { get; } = new FineTuningTaskType(TextSummarizationValue); + /// TokenClassification. + public static FineTuningTaskType TokenClassification { get; } = new FineTuningTaskType(TokenClassificationValue); + /// TextTranslation. + public static FineTuningTaskType TextTranslation { get; } = new FineTuningTaskType(TextTranslationValue); + /// ImageClassification. + public static FineTuningTaskType ImageClassification { get; } = new FineTuningTaskType(ImageClassificationValue); + /// ImageInstanceSegmentation. + public static FineTuningTaskType ImageInstanceSegmentation { get; } = new FineTuningTaskType(ImageInstanceSegmentationValue); + /// ImageObjectDetection. + public static FineTuningTaskType ImageObjectDetection { get; } = new FineTuningTaskType(ImageObjectDetectionValue); + /// VideoMultiObjectTracking. + public static FineTuningTaskType VideoMultiObjectTracking { get; } = new FineTuningTaskType(VideoMultiObjectTrackingValue); + /// Determines if two values are the same. + public static bool operator ==(FineTuningTaskType left, FineTuningTaskType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FineTuningTaskType left, FineTuningTaskType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FineTuningTaskType(string value) => new FineTuningTaskType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FineTuningTaskType other && Equals(other); + /// + public bool Equals(FineTuningTaskType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.Serialization.cs new file mode 100644 index 000000000000..eea74c37f607 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + [PersistableModelProxy(typeof(UnknownFineTuningVertical))] + public partial class FineTuningVertical : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FineTuningVertical IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFineTuningVertical(document.RootElement, options); + } + + internal static FineTuningVertical DeserializeFineTuningVertical(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("modelProvider", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "AzureOpenAI": return AzureOpenAiFineTuning.DeserializeAzureOpenAiFineTuning(element, options); + case "Custom": return CustomModelFineTuning.DeserializeCustomModelFineTuning(element, options); + } + } + return UnknownFineTuningVertical.DeserializeUnknownFineTuningVertical(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{options.Format}' format."); + } + } + + FineTuningVertical IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFineTuningVertical(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.cs new file mode 100644 index 000000000000..1e159dda8452 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FineTuningVertical.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class FineTuningVertical + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// or is null. + protected FineTuningVertical(FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningFlowModelJobInput model) + { + Argument.AssertNotNull(trainingData, nameof(trainingData)); + Argument.AssertNotNull(model, nameof(model)); + + TaskType = taskType; + TrainingData = trainingData; + Model = model; + } + + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// + /// Validation data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + internal FineTuningVertical(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData) + { + ModelProvider = modelProvider; + TaskType = taskType; + TrainingData = trainingData; + ValidationData = validationData; + Model = model; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FineTuningVertical() + { + } + + /// [Required] Enum to determine the type of fine tuning. + internal ModelProvider ModelProvider { get; set; } + /// [Required] Fine tuning task type. + public FineTuningTaskType TaskType { get; set; } + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + public MachineLearningJobInput TrainingData { get; set; } + /// + /// Validation data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + public MachineLearningJobInput ValidationData { get; set; } + /// [Required] Input model for fine tuning. + public MachineLearningFlowModelJobInput Model { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs index 1728fe0ad35d..ce200d5bf8a2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.Serialization.cs @@ -50,6 +50,46 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteNull("timeColumnName"); } } +<<<<<<< HEAD +======= + if (Optional.IsDefined(FeatureLags)) + { + writer.WritePropertyName("featureLags"u8); + writer.WriteStringValue(FeatureLags.Value.ToString()); + } + if (Optional.IsDefined(ForecastHorizon)) + { + writer.WritePropertyName("forecastHorizon"u8); + writer.WriteObjectValue(ForecastHorizon, options); + } + if (Optional.IsDefined(Frequency)) + { + if (Frequency != null) + { + writer.WritePropertyName("frequency"u8); + writer.WriteStringValue(Frequency); + } + else + { + writer.WriteNull("frequency"); + } + } + if (Optional.IsDefined(Seasonality)) + { + writer.WritePropertyName("seasonality"u8); + writer.WriteObjectValue(Seasonality, options); + } + if (Optional.IsDefined(ShortSeriesHandlingConfig)) + { + writer.WritePropertyName("shortSeriesHandlingConfig"u8); + writer.WriteStringValue(ShortSeriesHandlingConfig.Value.ToString()); + } + if (Optional.IsDefined(TargetAggregateFunction)) + { + writer.WritePropertyName("targetAggregateFunction"u8); + writer.WriteStringValue(TargetAggregateFunction.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(TargetLags)) { if (TargetLags != null) @@ -184,7 +224,17 @@ internal static ForecastingSettings DeserializeForecastingSettings(JsonElement e return null; } string countryOrRegionForHolidays = default; +<<<<<<< HEAD string timeColumnName = default; +======= + int? cvStepSize = default; + MachineLearningFeatureLag? featureLags = default; + ForecastHorizon forecastHorizon = default; + string frequency = default; + ForecastingSeasonality seasonality = default; + MachineLearningShortSeriesHandlingConfiguration? shortSeriesHandlingConfig = default; + TargetAggregationFunction? targetAggregateFunction = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 TargetLags targetLags = default; TargetRollingWindowSize targetRollingWindowSize = default; ForecastHorizon forecastHorizon = default; @@ -217,7 +267,66 @@ internal static ForecastingSettings DeserializeForecastingSettings(JsonElement e timeColumnName = null; continue; } +<<<<<<< HEAD timeColumnName = property.Value.GetString(); +======= + cvStepSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("featureLags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + featureLags = new MachineLearningFeatureLag(property.Value.GetString()); + continue; + } + if (property.NameEquals("forecastHorizon"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + forecastHorizon = ForecastHorizon.DeserializeForecastHorizon(property.Value, options); + continue; + } + if (property.NameEquals("frequency"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + frequency = null; + continue; + } + frequency = property.Value.GetString(); + continue; + } + if (property.NameEquals("seasonality"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + seasonality = ForecastingSeasonality.DeserializeForecastingSeasonality(property.Value, options); + continue; + } + if (property.NameEquals("shortSeriesHandlingConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shortSeriesHandlingConfig = new MachineLearningShortSeriesHandlingConfiguration(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetAggregateFunction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetAggregateFunction = new TargetAggregationFunction(property.Value.GetString()); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("targetLags"u8)) @@ -337,7 +446,17 @@ internal static ForecastingSettings DeserializeForecastingSettings(JsonElement e serializedAdditionalRawData = rawDataDictionary; return new ForecastingSettings( countryOrRegionForHolidays, +<<<<<<< HEAD timeColumnName, +======= + cvStepSize, + featureLags, + forecastHorizon, + frequency, + seasonality, + shortSeriesHandlingConfig, + targetAggregateFunction, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 targetLags, targetRollingWindowSize, forecastHorizon, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs index 0163af4fc46d..4fdd05c6c790 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingSettings.cs @@ -56,7 +56,33 @@ public ForecastingSettings() /// Country or region for holidays for forecasting tasks. /// These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. /// +<<<<<<< HEAD /// The name of the time column. This parameter is required when forecasting to specify the datetime column in the input data used for building the time series and inferring its frequency. +======= + /// + /// Number of periods between the origin time of one CV fold and the next fold. For + /// example, if `CVStepSize` = 3 for daily data, the origin time for each fold will be + /// three days apart. + /// + /// Flag for generating lags for the numeric features with 'auto' or null. + /// + /// The desired maximum forecast horizon in units of time-series frequency. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// When forecasting, this parameter represents the period with which the forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency by default. + /// + /// Set time series seasonality as an integer multiple of the series frequency. + /// If seasonality is set to 'auto', it will be inferred. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// The parameter defining how if AutoML should handle short time series. + /// + /// The function to be used to aggregate the time series target column to conform to a user specified frequency. + /// If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// The number of past periods to lag from the target column. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -96,10 +122,23 @@ public ForecastingSettings() /// three days apart. /// /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal ForecastingSettings(string countryOrRegionForHolidays, string timeColumnName, TargetLags targetLags, TargetRollingWindowSize targetRollingWindowSize, ForecastHorizon forecastHorizon, IList timeSeriesIdColumnNames, string frequency, MachineLearningFeatureLag? featureLags, ForecastingSeasonality seasonality, MachineLearningShortSeriesHandlingConfiguration? shortSeriesHandlingConfig, MachineLearningUseStl? useStl, TargetAggregationFunction? targetAggregateFunction, int? cvStepSize, IDictionary serializedAdditionalRawData) { CountryOrRegionForHolidays = countryOrRegionForHolidays; TimeColumnName = timeColumnName; +======= + internal ForecastingSettings(string countryOrRegionForHolidays, int? cvStepSize, MachineLearningFeatureLag? featureLags, ForecastHorizon forecastHorizon, string frequency, ForecastingSeasonality seasonality, MachineLearningShortSeriesHandlingConfiguration? shortSeriesHandlingConfig, TargetAggregationFunction? targetAggregateFunction, TargetLags targetLags, TargetRollingWindowSize targetRollingWindowSize, string timeColumnName, IList timeSeriesIdColumnNames, MachineLearningUseStl? useStl, IDictionary serializedAdditionalRawData) + { + CountryOrRegionForHolidays = countryOrRegionForHolidays; + CvStepSize = cvStepSize; + FeatureLags = featureLags; + ForecastHorizon = forecastHorizon; + Frequency = frequency; + Seasonality = seasonality; + ShortSeriesHandlingConfig = shortSeriesHandlingConfig; + TargetAggregateFunction = targetAggregateFunction; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 TargetLags = targetLags; TargetRollingWindowSize = targetRollingWindowSize; ForecastHorizon = forecastHorizon; @@ -119,8 +158,41 @@ internal ForecastingSettings(string countryOrRegionForHolidays, string timeColum /// These should be ISO 3166 two-letter country/region codes, for example 'US' or 'GB'. /// public string CountryOrRegionForHolidays { get; set; } +<<<<<<< HEAD /// The name of the time column. This parameter is required when forecasting to specify the datetime column in the input data used for building the time series and inferring its frequency. public string TimeColumnName { get; set; } +======= + /// + /// Number of periods between the origin time of one CV fold and the next fold. For + /// example, if `CVStepSize` = 3 for daily data, the origin time for each fold will be + /// three days apart. + /// + public int? CvStepSize { get; set; } + /// Flag for generating lags for the numeric features with 'auto' or null. + public MachineLearningFeatureLag? FeatureLags { get; set; } + /// + /// The desired maximum forecast horizon in units of time-series frequency. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public ForecastHorizon ForecastHorizon { get; set; } + /// When forecasting, this parameter represents the period with which the forecast is desired, for example daily, weekly, yearly, etc. The forecast frequency is dataset frequency by default. + public string Frequency { get; set; } + /// + /// Set time series seasonality as an integer multiple of the series frequency. + /// If seasonality is set to 'auto', it will be inferred. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public ForecastingSeasonality Seasonality { get; set; } + /// The parameter defining how if AutoML should handle short time series. + public MachineLearningShortSeriesHandlingConfiguration? ShortSeriesHandlingConfig { get; set; } + /// + /// The function to be used to aggregate the time series target column to conform to a user specified frequency. + /// If the TargetAggregateFunction is set i.e. not 'None', but the freq parameter is not set, the error is raised. The possible target aggregation functions are: "sum", "max", "min" and "mean". + /// + public TargetAggregationFunction? TargetAggregateFunction { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// The number of past periods to lag from the target column. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs index fb17c101af64..a2a795088807 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.Serialization.cs @@ -97,11 +97,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("enableModelExplainability"u8); writer.WriteBooleanValue(IsModelExplainabilityEnabled.Value); } +<<<<<<< HEAD if (Optional.IsDefined(IsDnnTrainingEnabled)) { writer.WritePropertyName("enableDnnTraining"u8); writer.WriteBooleanValue(IsDnnTrainingEnabled.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -147,8 +150,12 @@ internal static ForecastingTrainingSettings DeserializeForecastingTrainingSettin bool? enableStackEnsemble = default; bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; +<<<<<<< HEAD bool? enableModelExplainability = default; bool? enableDnnTraining = default; +======= + MachineLearningStackEnsembleSettings stackEnsembleSettings = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -238,6 +245,7 @@ internal static ForecastingTrainingSettings DeserializeForecastingTrainingSettin enableModelExplainability = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("enableDnnTraining"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -247,6 +255,8 @@ internal static ForecastingTrainingSettings DeserializeForecastingTrainingSettin enableDnnTraining = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -259,8 +269,12 @@ internal static ForecastingTrainingSettings DeserializeForecastingTrainingSettin enableStackEnsemble, enableVoteEnsemble, ensembleModelDownloadTimeout, +<<<<<<< HEAD enableModelExplainability, enableDnnTraining, +======= + stackEnsembleSettings, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, allowedTrainingAlgorithms ?? new ChangeTrackingList(), blockedTrainingAlgorithms ?? new ChangeTrackingList()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs index 1b651e22fb92..100ee3aa538b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ForecastingTrainingSettings.cs @@ -29,12 +29,20 @@ public ForecastingTrainingSettings() /// During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs are downloaded. /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// +<<<<<<< HEAD /// Flag to turn on explainability on best model. /// Enable recommendation of DNN models. /// Keeps track of any properties unknown to the library. /// Allowed models for forecasting task. /// Blocked models for forecasting task. internal ForecastingTrainingSettings(bool? isOnnxCompatibleModelsEnabled, MachineLearningStackEnsembleSettings stackEnsembleSettings, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, bool? isModelExplainabilityEnabled, bool? isDnnTrainingEnabled, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isOnnxCompatibleModelsEnabled, stackEnsembleSettings, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, isModelExplainabilityEnabled, isDnnTrainingEnabled, serializedAdditionalRawData) +======= + /// Stack ensemble settings for stack ensemble run. + /// Keeps track of any properties unknown to the library. + /// Allowed models for forecasting task. + /// Blocked models for forecasting task. + internal ForecastingTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { AllowedTrainingAlgorithms = allowedTrainingAlgorithms; BlockedTrainingAlgorithms = blockedTrainingAlgorithms; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs index 140c0f591f36..092782e3911c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.Serialization.cs @@ -36,6 +36,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -83,6 +93,7 @@ internal static FqdnOutboundRule DeserializeFqdnOutboundRule(JsonElement element } string destination = default; OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = default; IDictionary serializedAdditionalRawData = default; @@ -103,6 +114,20 @@ internal static FqdnOutboundRule DeserializeFqdnOutboundRule(JsonElement element category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -123,7 +148,13 @@ internal static FqdnOutboundRule DeserializeFqdnOutboundRule(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new FqdnOutboundRule(category, status, type, serializedAdditionalRawData, destination); + return new FqdnOutboundRule( + category, + parentRuleNames ?? new ChangeTrackingList(), + status, + type, + serializedAdditionalRawData, + destination); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs index 77d3b297e501..2e894cb2e3b4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/FqdnOutboundRule.cs @@ -21,11 +21,12 @@ public FqdnOutboundRule() /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. /// - internal FqdnOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, string destination) : base(category, status, outboundRuleType, serializedAdditionalRawData) + internal FqdnOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, string destination) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { Destination = destination; OutboundRuleType = outboundRuleType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs index 2217a09f9bcd..a6ff097cf207 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.Serialization.cs @@ -38,6 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("blobUri"); } } +<<<<<<< HEAD if (Optional.IsDefined(StorageAccountArmId)) { if (StorageAccountArmId != null) @@ -50,6 +51,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("storageAccountArmId"); } } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Credential)) { if (Credential != null) @@ -62,6 +65,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("credential"); } } +<<<<<<< HEAD +======= + if (Optional.IsDefined(StorageAccountArmId)) + { + if (StorageAccountArmId != null) + { + writer.WritePropertyName("storageAccountArmId"u8); + writer.WriteStringValue(StorageAccountArmId); + } + else + { + writer.WriteNull("storageAccountArmId"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,8 +119,13 @@ internal static GetBlobReferenceForConsumptionDto DeserializeGetBlobReferenceFor return null; } Uri blobUri = default; +<<<<<<< HEAD string storageAccountArmId = default; DataReferenceCredential credential = default; +======= + DataReferenceCredential credential = default; + string storageAccountArmId = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -117,6 +140,7 @@ internal static GetBlobReferenceForConsumptionDto DeserializeGetBlobReferenceFor blobUri = new Uri(property.Value.GetString()); continue; } +<<<<<<< HEAD if (property.NameEquals("storageAccountArmId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -127,6 +151,8 @@ internal static GetBlobReferenceForConsumptionDto DeserializeGetBlobReferenceFor storageAccountArmId = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("credential"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -137,13 +163,30 @@ internal static GetBlobReferenceForConsumptionDto DeserializeGetBlobReferenceFor credential = DataReferenceCredential.DeserializeDataReferenceCredential(property.Value, options); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("storageAccountArmId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + storageAccountArmId = null; + continue; + } + storageAccountArmId = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new GetBlobReferenceForConsumptionDto(blobUri, storageAccountArmId, credential, serializedAdditionalRawData); +======= + return new GetBlobReferenceForConsumptionDto(blobUri, credential, storageAccountArmId, serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.cs index b198e425aad7..b9c8fbc91eb1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceForConsumptionDto.cs @@ -52,30 +52,51 @@ internal GetBlobReferenceForConsumptionDto() /// Initializes a new instance of . /// Blob uri, example: https://blob.windows.core.net/Container/Path. +<<<<<<< HEAD /// The ARM id of the storage account. +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Credential info to access storage account /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , and . /// +<<<<<<< HEAD /// Keeps track of any properties unknown to the library. internal GetBlobReferenceForConsumptionDto(Uri blobUri, string storageAccountArmId, DataReferenceCredential credential, IDictionary serializedAdditionalRawData) { BlobUri = blobUri; StorageAccountArmId = storageAccountArmId; Credential = credential; +======= + /// The ARM id of the storage account. + /// Keeps track of any properties unknown to the library. + internal GetBlobReferenceForConsumptionDto(Uri blobUri, DataReferenceCredential credential, string storageAccountArmId, IDictionary serializedAdditionalRawData) + { + BlobUri = blobUri; + Credential = credential; + StorageAccountArmId = storageAccountArmId; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _serializedAdditionalRawData = serializedAdditionalRawData; } /// Blob uri, example: https://blob.windows.core.net/Container/Path. public Uri BlobUri { get; } +<<<<<<< HEAD /// The ARM id of the storage account. public string StorageAccountArmId { get; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Credential info to access storage account /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , and . /// public DataReferenceCredential Credential { get; } +<<<<<<< HEAD +======= + /// The ARM id of the storage account. + public string StorageAccountArmId { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs index c860522e59fa..c85d51affaa4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs @@ -10,8 +10,13 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs /// BlobReferenceSASRequest for getBlobReferenceSAS API. public partial class GetBlobReferenceSasRequestDto +======== + /// The EndpointModelSkuRateLimitRulePatternProperties. + public partial class EndpointModelSkuRateLimitRulePatternProperties +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs { /// /// Keeps track of any properties unknown to the library. @@ -45,6 +50,7 @@ public partial class GetBlobReferenceSasRequestDto /// private IDictionary _serializedAdditionalRawData; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/GetBlobReferenceSasRequestDto.cs /// Initializes a new instance of . public GetBlobReferenceSasRequestDto() { @@ -65,5 +71,27 @@ internal GetBlobReferenceSasRequestDto(string assetId, Uri blobUri, IDictionary< public string AssetId { get; set; } /// Blob uri of the asset to be accessed. public Uri BlobUri { get; set; } +======== + /// Initializes a new instance of . + internal EndpointModelSkuRateLimitRulePatternProperties() + { + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal EndpointModelSkuRateLimitRulePatternProperties(string method, string path, IDictionary serializedAdditionalRawData) + { + Method = method; + Path = path; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the method. + public string Method { get; } + /// Gets the path. + public string Path { get; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModelSkuRateLimitRulePatternProperties.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs index b92f504003c2..be7313606948 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.Serialization.cs @@ -41,6 +41,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt writer.WritePropertyName("isLatestOsImageVersion"u8); writer.WriteBooleanValue(IsLatestOSImageVersion.Value); } + if (options.Format != "W" && Optional.IsDefined(OSPatchingStatus)) + { + writer.WritePropertyName("osPatchingStatus"u8); + writer.WriteObjectValue(OSPatchingStatus, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -82,6 +87,7 @@ internal static ImageMetadata DeserializeImageMetadata(JsonElement element, Mode string currentImageVersion = default; string latestImageVersion = default; bool? isLatestOSImageVersion = default; + OSPatchingStatus osPatchingStatus = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -105,13 +111,22 @@ internal static ImageMetadata DeserializeImageMetadata(JsonElement element, Mode isLatestOSImageVersion = property.Value.GetBoolean(); continue; } + if (property.NameEquals("osPatchingStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osPatchingStatus = OSPatchingStatus.DeserializeOSPatchingStatus(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, serializedAdditionalRawData); + return new ImageMetadata(currentImageVersion, latestImageVersion, isLatestOSImageVersion, osPatchingStatus, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs index 8ce59c408065..b469c7188eff 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageMetadata.cs @@ -54,12 +54,14 @@ internal ImageMetadata() /// Specifies the current operating system image version this compute instance is running on. /// Specifies the latest available operating system image version. /// Specifies whether this compute instance is running on the latest operating system image. + /// Metadata about the os patching. /// Keeps track of any properties unknown to the library. - internal ImageMetadata(string currentImageVersion, string latestImageVersion, bool? isLatestOSImageVersion, IDictionary serializedAdditionalRawData) + internal ImageMetadata(string currentImageVersion, string latestImageVersion, bool? isLatestOSImageVersion, OSPatchingStatus osPatchingStatus, IDictionary serializedAdditionalRawData) { CurrentImageVersion = currentImageVersion; LatestImageVersion = latestImageVersion; IsLatestOSImageVersion = isLatestOSImageVersion; + OSPatchingStatus = osPatchingStatus; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -69,5 +71,7 @@ internal ImageMetadata(string currentImageVersion, string latestImageVersion, bo public string LatestImageVersion { get; } /// Specifies whether this compute instance is running on the latest operating system image. public bool? IsLatestOSImageVersion { get; } + /// Metadata about the os patching. + public OSPatchingStatus OSPatchingStatus { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs index 3cdd3ca6e007..fa8f65e27a60 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageModelSettingsObjectDetection.cs @@ -125,7 +125,11 @@ public ImageModelSettingsObjectDetection() /// /// IOU threshold to use when computing validation metric. Must be float in the range [0, 1]. /// Metric computation method to use for validation metrics. +<<<<<<< HEAD internal ImageModelSettingsObjectDetection(bool? amsGradient, string advancedSettings, string augmentations, float? beta1, float? beta2, int? checkpointFrequency, string checkpointRunId, MachineLearningFlowModelJobInput checkpointModel, bool? distributed, bool? earlyStopping, int? earlyStoppingDelay, int? earlyStoppingPatience, int? evaluationFrequency, bool? enableOnnxNormalization, int? gradientAccumulationStep, int? layersToFreeze, float? learningRate, LearningRateScheduler? learningRateScheduler, string modelName, float? momentum, bool? nesterov, int? numberOfEpochs, int? numberOfWorkers, StochasticOptimizer? optimizer, int? randomSeed, float? stepLRGamma, int? stepLRStepSize, int? trainingBatchSize, int? validationBatchSize, float? warmupCosineLRCycles, int? warmupCosineLRWarmupEpochs, float? weightDecay, IDictionary serializedAdditionalRawData, int? boxDetectionsPerImage, float? boxScoreThreshold, int? imageSize, int? maxSize, int? minSize, MachineLearningModelSize? modelSize, bool? multiScale, float? nmsIouThreshold, string tileGridSize, float? tileOverlapRatio, float? tilePredictionsNmsThreshold, float? validationIouThreshold, ValidationMetricType? validationMetricType) : base(amsGradient, advancedSettings, augmentations, beta1, beta2, checkpointFrequency, checkpointRunId, checkpointModel, distributed, earlyStopping, earlyStoppingDelay, earlyStoppingPatience, evaluationFrequency, enableOnnxNormalization, gradientAccumulationStep, layersToFreeze, learningRate, learningRateScheduler, modelName, momentum, nesterov, numberOfEpochs, numberOfWorkers, optimizer, randomSeed, stepLRGamma, stepLRStepSize, trainingBatchSize, validationBatchSize, warmupCosineLRCycles, warmupCosineLRWarmupEpochs, weightDecay, serializedAdditionalRawData) +======= + internal ImageModelSettingsObjectDetection(string advancedSettings, bool? amsGradient, string augmentations, float? beta1, float? beta2, int? checkpointFrequency, MachineLearningFlowModelJobInput checkpointModel, string checkpointRunId, bool? distributed, bool? earlyStopping, int? earlyStoppingDelay, int? earlyStoppingPatience, bool? enableOnnxNormalization, int? evaluationFrequency, int? gradientAccumulationStep, int? layersToFreeze, float? learningRate, LearningRateScheduler? learningRateScheduler, string modelName, float? momentum, bool? nesterov, int? numberOfEpochs, int? numberOfWorkers, StochasticOptimizer? optimizer, int? randomSeed, float? stepLRGamma, int? stepLRStepSize, int? trainingBatchSize, int? validationBatchSize, float? warmupCosineLRCycles, int? warmupCosineLRWarmupEpochs, float? weightDecay, IDictionary serializedAdditionalRawData, int? boxDetectionsPerImage, float? boxScoreThreshold, int? imageSize, int? maxSize, int? minSize, MachineLearningModelSize? modelSize, bool? multiScale, float? nmsIouThreshold, string tileGridSize, float? tileOverlapRatio, float? tilePredictionsNmsThreshold, float? validationIouThreshold, ValidationMetricType? validationMetricType) : base(advancedSettings, amsGradient, augmentations, beta1, beta2, checkpointFrequency, checkpointModel, checkpointRunId, distributed, earlyStopping, earlyStoppingDelay, earlyStoppingPatience, enableOnnxNormalization, evaluationFrequency, gradientAccumulationStep, layersToFreeze, learningRate, learningRateScheduler, modelName, momentum, nesterov, numberOfEpochs, numberOfWorkers, optimizer, randomSeed, stepLRGamma, stepLRStepSize, trainingBatchSize, validationBatchSize, warmupCosineLRCycles, warmupCosineLRWarmupEpochs, weightDecay, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { BoxDetectionsPerImage = boxDetectionsPerImage; BoxScoreThreshold = boxScoreThreshold; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs index 8b0b6b9dfe69..b3d8dbe0babe 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.Serialization.cs @@ -36,6 +36,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti writer.WritePropertyName("reference"u8); writer.WriteStringValue(Reference); } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -73,6 +78,7 @@ internal static ImageSetting DeserializeImageSetting(JsonElement element, ModelR } ImageType? type = default; string reference = default; + string version = default; IDictionary additionalProperties = default; Dictionary additionalPropertiesDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -91,10 +97,15 @@ internal static ImageSetting DeserializeImageSetting(JsonElement element, ModelR reference = property.Value.GetString(); continue; } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } additionalProperties = additionalPropertiesDictionary; - return new ImageSetting(type, reference, additionalProperties); + return new ImageSetting(type, reference, version, additionalProperties); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs index 2bf9c49c9d82..3c2a8d3b7d66 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageSetting.cs @@ -20,20 +20,33 @@ public ImageSetting() } /// Initializes a new instance of . +<<<<<<< HEAD /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. /// Image reference. +======= + /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images (custom and curated). + /// Image reference URL if type is docker. Environment name if type is azureml. + /// Version of image being used. If latest then skip this field. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Additional Properties. - internal ImageSetting(ImageType? imageType, string reference, IDictionary additionalProperties) + internal ImageSetting(ImageType? imageType, string reference, string version, IDictionary additionalProperties) { ImageType = imageType; Reference = reference; + Version = version; AdditionalProperties = additionalProperties; } - /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. + /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images (custom and curated). public ImageType? ImageType { get; set; } +<<<<<<< HEAD /// Image reference. +======= + /// Image reference URL if type is docker. Environment name if type is azureml. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public string Reference { get; set; } + /// Version of image being used. If latest then skip this field. + public string Version { get; set; } /// /// Additional Properties /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs index 921a3729b3b0..55108f7d762d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ImageType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.MachineLearning.Models { - /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images. + /// Type of the image. Possible values are: docker - For docker images. azureml - For AzureML Environment images (custom and curated). public readonly partial struct ImageType : IEquatable { private readonly string _value; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.Serialization.cs new file mode 100644 index 000000000000..de945e485cd9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.Serialization.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class JobResources : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobResources)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(InstanceTypes)) + { + writer.WritePropertyName("instanceTypes"u8); + writer.WriteStartArray(); + foreach (var item in InstanceTypes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + JobResources IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobResources)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobResources(document.RootElement, options); + } + + internal static JobResources DeserializeJobResources(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList instanceTypes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + instanceTypes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new JobResources(instanceTypes ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(JobResources)} does not support writing '{options.Format}' format."); + } + } + + JobResources IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeJobResources(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobResources)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.cs new file mode 100644 index 000000000000..679716f254b4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobResources.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The JobResources. + internal partial class JobResources + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public JobResources() + { + InstanceTypes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of instance types to choose from. + /// Keeps track of any properties unknown to the library. + internal JobResources(IList instanceTypes, IDictionary serializedAdditionalRawData) + { + InstanceTypes = instanceTypes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of instance types to choose from. + public IList InstanceTypes { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs index 71af724534e9..8c54c4277960 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JobType.cs @@ -27,6 +27,7 @@ public JobType(string value) private const string SweepValue = "Sweep"; private const string PipelineValue = "Pipeline"; private const string SparkValue = "Spark"; + private const string FineTuningValue = "FineTuning"; /// AutoML. public static JobType AutoML { get; } = new JobType(AutoMLValue); @@ -38,6 +39,8 @@ public JobType(string value) public static JobType Pipeline { get; } = new JobType(PipelineValue); /// Spark. public static JobType Spark { get; } = new JobType(SparkValue); + /// FineTuning. + public static JobType FineTuning { get; } = new JobType(FineTuningValue); /// Determines if two values are the same. public static bool operator ==(JobType left, JobType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs new file mode 100644 index 000000000000..92a5db3c26be --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs + public partial class ServerlessInferenceEndpoint : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + if (options.Format != "W" && Optional.IsCollectionDefined(Headers)) + { + if (Headers != null) + { + writer.WritePropertyName("headers"u8); + writer.WriteStartObject(); + foreach (var item in Headers) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("headers"); + } +======== + public partial class JupyterKernelConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Argv)) + { + writer.WritePropertyName("argv"u8); + writer.WriteStartArray(); + foreach (var item in Argv) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs + ServerlessInferenceEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessInferenceEndpoint(document.RootElement, options); + } + + internal static ServerlessInferenceEndpoint DeserializeServerlessInferenceEndpoint(JsonElement element, ModelReaderWriterOptions options = null) +======== + JupyterKernelConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJupyterKernelConfig(document.RootElement, options); + } + + internal static JupyterKernelConfig DeserializeJupyterKernelConfig(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs + Uri uri = default; + IReadOnlyDictionary headers = default; +======== + IList argv = default; + string displayName = default; + string language = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("argv"u8)) + { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs + uri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("headers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + headers = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + headers = dictionary; +======== + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + argv = array; + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs + return new ServerlessInferenceEndpoint(uri, headers ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new JupyterKernelConfig(argv ?? new ChangeTrackingList(), displayName, language, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support writing '{options.Format}' format."); + } + } + + ServerlessInferenceEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support writing '{options.Format}' format."); + } + } + + JupyterKernelConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs + return DeserializeServerlessInferenceEndpoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeJupyterKernelConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.cs new file mode 100644 index 000000000000..5c65ae7b9990 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Jupyter kernel configuration. + public partial class JupyterKernelConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public JupyterKernelConfig() + { + Argv = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Argument to the the runtime. + /// Display name of the kernel. + /// Language of the kernel [Example value: python]. + /// Keeps track of any properties unknown to the library. + internal JupyterKernelConfig(IList argv, string displayName, string language, IDictionary serializedAdditionalRawData) + { + Argv = argv; + DisplayName = displayName; + Language = language; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Argument to the the runtime. + public IList Argv { get; } + /// Display name of the kernel. + public string DisplayName { get; set; } + /// Language of the kernel [Example value: python]. + public string Language { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs index f364b9fc2bc1..6a05f8879d44 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.Serialization.cs @@ -26,11 +26,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } writer.WriteStartObject(); +<<<<<<< HEAD if (Optional.IsDefined(IsArchived)) { writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -122,6 +125,10 @@ internal static MachineLearningAssetBase DeserializeMachineLearningAssetBase(Jso { return null; } +<<<<<<< HEAD +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -131,6 +138,7 @@ internal static MachineLearningAssetBase DeserializeMachineLearningAssetBase(Jso Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("isArchived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -140,6 +148,8 @@ internal static MachineLearningAssetBase DeserializeMachineLearningAssetBase(Jso isArchived = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -200,8 +210,13 @@ internal static MachineLearningAssetBase DeserializeMachineLearningAssetBase(Jso tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD isArchived, isAnonymous); +======= + isAnonymous, + isArchived); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs index 7ee0e946397f..bd5fa9a551b7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAssetBase.cs @@ -23,14 +23,27 @@ public MachineLearningAssetBase() /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). internal MachineLearningAssetBase(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous) : base(description, tags, properties, serializedAdditionalRawData) { +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + internal MachineLearningAssetBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived) : base(description, properties, tags, serializedAdditionalRawData) + { + IsAnonymous = isAnonymous; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IsArchived = isArchived; IsAnonymous = isAnonymous; } +<<<<<<< HEAD +======= + /// If the name version are system generated (anonymous registration). + public bool? IsAnonymous { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Is the asset archived?. public bool? IsArchived { get; set; } /// If the name version are system generated (anonymous registration). diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs index 5a4cfdd1caf3..fee5074a0503 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.Serialization.cs @@ -91,6 +91,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("subscriptionId"); } } +<<<<<<< HEAD if (Optional.IsDefined(ResourceGroup)) { if (ResourceGroup != null) @@ -103,6 +104,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("resourceGroup"); } } +======= + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); if (options.Format != "W" && Optional.IsDefined(IsDefault)) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs index d431de5045ac..de4ea94760bf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureBlobDatastore.cs @@ -39,14 +39,23 @@ public MachineLearningAzureBlobDatastore(MachineLearningDatastoreCredentials cre /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// +<<<<<<< HEAD +======= + /// [Required] Storage type backing the datastore. + /// Readonly property to indicate if datastore is the workspace default datastore. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Storage account name. /// Storage account container name. /// Azure cloud endpoint for the storage account. /// Protocol used to communicate with the storage account. /// Indicates which identity to use to authenticate service data access to customer's storage. /// Azure Subscription Id. +<<<<<<< HEAD /// Azure Resource Group name. internal MachineLearningAzureBlobDatastore(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, DatastoreType datastoreType, bool? isDefault, MachineLearningDatastoreCredentials credentials, string accountName, string containerName, string endpoint, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string subscriptionId, string resourceGroup) : base(description, tags, properties, serializedAdditionalRawData, datastoreType, isDefault, credentials) +======= + internal MachineLearningAzureBlobDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, string accountName, string containerName, string endpoint, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { AccountName = accountName; ContainerName = containerName; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs index 3501d4182cfd..8dd61c19e33d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.Serialization.cs @@ -45,6 +45,7 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteNull("subscriptionId"); } } +<<<<<<< HEAD if (Optional.IsDefined(ResourceGroup)) { if (ResourceGroup != null) @@ -57,6 +58,10 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteNull("resourceGroup"); } } +======= + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); if (options.Format != "W" && Optional.IsDefined(IsDefault)) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs index f0d61e1f7e27..d6135e7727e8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen1Datastore.cs @@ -42,11 +42,21 @@ public MachineLearningAzureDataLakeGen1Datastore(MachineLearningDatastoreCredent /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// +<<<<<<< HEAD +======= + /// [Required] Storage type backing the datastore. + /// Readonly property to indicate if datastore is the workspace default datastore. + /// Indicates which identity to use to authenticate service data access to customer's storage. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Azure Data Lake store name. /// Indicates which identity to use to authenticate service data access to customer's storage. /// Azure Subscription Id. +<<<<<<< HEAD /// Azure Resource Group name. internal MachineLearningAzureDataLakeGen1Datastore(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, DatastoreType datastoreType, bool? isDefault, MachineLearningDatastoreCredentials credentials, string storeName, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string subscriptionId, string resourceGroup) : base(description, tags, properties, serializedAdditionalRawData, datastoreType, isDefault, credentials) +======= + internal MachineLearningAzureDataLakeGen1Datastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string storeName, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { StoreName = storeName; ServiceDataAccessAuthIdentity = serviceDataAccessAuthIdentity; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs index 8d684e4e4ef4..d25e1e355c93 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.Serialization.cs @@ -71,6 +71,7 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteNull("subscriptionId"); } } +<<<<<<< HEAD if (Optional.IsDefined(ResourceGroup)) { if (ResourceGroup != null) @@ -83,6 +84,10 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteNull("resourceGroup"); } } +======= + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); if (options.Format != "W" && Optional.IsDefined(IsDefault)) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs index d122db394e69..b87193476f2d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureDataLakeGen2Datastore.cs @@ -45,14 +45,23 @@ public MachineLearningAzureDataLakeGen2Datastore(MachineLearningDatastoreCredent /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// +<<<<<<< HEAD /// [Required] The name of the Data Lake Gen2 filesystem. +======= + /// [Required] Storage type backing the datastore. + /// Readonly property to indicate if datastore is the workspace default datastore. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Storage account name. /// Azure cloud endpoint for the storage account. /// Protocol used to communicate with the storage account. /// Indicates which identity to use to authenticate service data access to customer's storage. /// Azure Subscription Id. +<<<<<<< HEAD /// Azure Resource Group name. internal MachineLearningAzureDataLakeGen2Datastore(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, DatastoreType datastoreType, bool? isDefault, MachineLearningDatastoreCredentials credentials, string filesystem, string accountName, string endpoint, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string subscriptionId, string resourceGroup) : base(description, tags, properties, serializedAdditionalRawData, datastoreType, isDefault, credentials) +======= + internal MachineLearningAzureDataLakeGen2Datastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, string accountName, string endpoint, string filesystem, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Filesystem = filesystem; AccountName = accountName; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs index 359f8ec27f93..cf36caa2bf00 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.Serialization.cs @@ -71,6 +71,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("subscriptionId"); } } +<<<<<<< HEAD if (Optional.IsDefined(ResourceGroup)) { if (ResourceGroup != null) @@ -83,6 +84,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteNull("resourceGroup"); } } +======= + writer.WritePropertyName("credentials"u8); + writer.WriteObjectValue(Credentials, options); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 writer.WritePropertyName("datastoreType"u8); writer.WriteStringValue(DatastoreType.ToString()); if (options.Format != "W" && Optional.IsDefined(IsDefault)) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs index 86d6021c5c96..67924359ba61 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningAzureFileDatastore.cs @@ -45,14 +45,23 @@ public MachineLearningAzureFileDatastore(MachineLearningDatastoreCredentials cre /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// +<<<<<<< HEAD +======= + /// [Required] Storage type backing the datastore. + /// Readonly property to indicate if datastore is the workspace default datastore. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Storage account name. /// [Required] The name of the Azure file share that the datastore points to. /// Azure cloud endpoint for the storage account. /// Protocol used to communicate with the storage account. /// Indicates which identity to use to authenticate service data access to customer's storage. /// Azure Subscription Id. +<<<<<<< HEAD /// Azure Resource Group name. internal MachineLearningAzureFileDatastore(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, DatastoreType datastoreType, bool? isDefault, MachineLearningDatastoreCredentials credentials, string accountName, string fileShareName, string endpoint, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string subscriptionId, string resourceGroup) : base(description, tags, properties, serializedAdditionalRawData, datastoreType, isDefault, credentials) +======= + internal MachineLearningAzureFileDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, string accountName, string endpoint, string fileShareName, string protocol, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity, string resourceGroup, string subscriptionId) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { AccountName = accountName; FileShareName = fileShareName; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs index b3d790f15be8..898e7406270d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningBatchDeploymentProperties.cs @@ -20,6 +20,11 @@ public MachineLearningBatchDeploymentProperties() /// Initializes a new instance of . /// Description of the endpoint deployment. +<<<<<<< HEAD +======= + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. + /// Environment variables configuration for the deployment. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Property dictionary. Properties can be added, but not removed or altered. /// Code configuration for the endpoint deployment. /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs index 016c141e7975..40c3f8bcafd7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.Serialization.cs @@ -43,11 +43,14 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } +<<<<<<< HEAD if (Optional.IsDefined(IsArchived)) { writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -141,6 +144,10 @@ internal static MachineLearningCodeVersionProperties DeserializeMachineLearningC } Uri codeUri = default; RegistryAssetProvisioningState? provisioningState = default; +<<<<<<< HEAD +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -169,6 +176,7 @@ internal static MachineLearningCodeVersionProperties DeserializeMachineLearningC provisioningState = new RegistryAssetProvisioningState(property.Value.GetString()); continue; } +<<<<<<< HEAD if (property.NameEquals("isArchived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -178,6 +186,8 @@ internal static MachineLearningCodeVersionProperties DeserializeMachineLearningC isArchived = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -238,6 +248,10 @@ internal static MachineLearningCodeVersionProperties DeserializeMachineLearningC tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + isAnonymous, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 isArchived, isAnonymous, codeUri, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs index 90662eb43160..353b198e3283 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCodeVersionProperties.cs @@ -23,11 +23,19 @@ public MachineLearningCodeVersionProperties() /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). /// Uri where code is located. /// Provisioning state for the code version. internal MachineLearningCodeVersionProperties(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, Uri codeUri, RegistryAssetProvisioningState? provisioningState) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous) +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + /// Uri where code is located. + /// Provisioning state for the code version. + internal MachineLearningCodeVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, Uri codeUri, RegistryAssetProvisioningState? provisioningState) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { CodeUri = codeUri; ProvisioningState = provisioningState; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs index fbc70941ed78..29bd2fc2b16f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.Serialization.cs @@ -26,11 +26,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } writer.WriteStartObject(); +<<<<<<< HEAD if (Optional.IsDefined(Resources)) { writer.WritePropertyName("resources"u8); writer.WriteObjectValue(Resources, options); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(CodeId)) { if (CodeId != null) @@ -180,6 +183,40 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WritePropertyName("experimentName"u8); writer.WriteStringValue(ExperimentName); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Identity)) + { + if (Identity != null) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + else + { + writer.WriteNull("identity"); + } + } + if (Optional.IsDefined(IsArchived)) + { + writer.WritePropertyName("isArchived"u8); + writer.WriteBooleanValue(IsArchived.Value); + } + writer.WritePropertyName("jobType"u8); + writer.WriteStringValue(JobType.ToString()); + if (Optional.IsDefined(NotificationSetting)) + { + if (NotificationSetting != null) + { + writer.WritePropertyName("notificationSetting"u8); + writer.WriteObjectValue(NotificationSetting, options); + } + else + { + writer.WriteNull("notificationSetting"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -337,7 +374,10 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J { return null; } +<<<<<<< HEAD MachineLearningJobResourceConfiguration resources = default; +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ResourceIdentifier codeId = default; string command = default; ResourceIdentifier environmentId = default; @@ -349,7 +389,12 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J BinaryData parameters = default; JobQueueSettings queueSettings = default; JobType jobType = default; +<<<<<<< HEAD string displayName = default; +======= + NotificationSetting notificationSetting = default; + IDictionary services = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningJobStatus? status = default; string experimentName = default; IDictionary services = default; @@ -365,6 +410,7 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("resources"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -374,6 +420,8 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J resources = MachineLearningJobResourceConfiguration.DeserializeMachineLearningJobResourceConfiguration(property.Value, options); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("codeId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -508,6 +556,43 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J experimentName = property.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + identity = null; + continue; + } + identity = MachineLearningIdentityConfiguration.DeserializeMachineLearningIdentityConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("isArchived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isArchived = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new JobType(property.Value.GetString()); + continue; + } + if (property.NameEquals("notificationSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationSetting = null; + continue; + } + notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -624,6 +709,7 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, jobType, +<<<<<<< HEAD displayName, status, experimentName, @@ -634,6 +720,11 @@ internal static MachineLearningCommandJob DeserializeMachineLearningCommandJob(J componentId, notificationSetting, resources, +======= + notificationSetting, + services ?? new ChangeTrackingDictionary(), + status, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 codeId, command, environmentId, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs index 0e3a20550234..ddea6e36bc50 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCommandJob.cs @@ -54,9 +54,24 @@ public MachineLearningCommandJob(string command, ResourceIdentifier environmentI /// /// ARM resource ID of the component resource. /// Notification setting for the job. +<<<<<<< HEAD /// Compute Resource configuration for the job. /// ARM resource ID of the code asset. /// [Required] The command to execute on startup of the job. eg. "python train.py". +======= + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// ARM resource ID of the code asset. + /// [Required] The command to execute on startup of the job. eg. "python train.py". + /// + /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] The ARM resource ID of the Environment specification for the job. /// /// Mapping of input data bindings used in the job. @@ -77,9 +92,15 @@ public MachineLearningCommandJob(string command, ResourceIdentifier environmentI /// Environment variables included in the job. /// Input parameters. /// Queue settings for the job. +<<<<<<< HEAD internal MachineLearningCommandJob(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, JobType jobType, string displayName, MachineLearningJobStatus? status, string experimentName, IDictionary services, ResourceIdentifier computeId, bool? isArchived, MachineLearningIdentityConfiguration identity, ResourceIdentifier componentId, NotificationSetting notificationSetting, MachineLearningJobResourceConfiguration resources, ResourceIdentifier codeId, string command, ResourceIdentifier environmentId, IDictionary inputs, IDictionary outputs, MachineLearningDistributionConfiguration distribution, MachineLearningCommandJobLimits limits, IDictionary environmentVariables, BinaryData parameters, JobQueueSettings queueSettings) : base(description, tags, properties, serializedAdditionalRawData, jobType, displayName, status, experimentName, services, computeId, isArchived, identity, componentId, notificationSetting) { Resources = resources; +======= + /// Compute Resource configuration for the job. + internal MachineLearningCommandJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, ResourceIdentifier codeId, string command, MachineLearningDistributionConfiguration distribution, ResourceIdentifier environmentId, IDictionary environmentVariables, IDictionary inputs, MachineLearningCommandJobLimits limits, IDictionary outputs, BinaryData parameters, JobQueueSettings queueSettings, MachineLearningJobResourceConfiguration resources) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) + { +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 CodeId = codeId; Command = command; EnvironmentId = environmentId; @@ -98,12 +119,24 @@ internal MachineLearningCommandJob() { } +<<<<<<< HEAD /// Compute Resource configuration for the job. public MachineLearningJobResourceConfiguration Resources { get; set; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// ARM resource ID of the code asset. public ResourceIdentifier CodeId { get; set; } /// [Required] The command to execute on startup of the job. eg. "python train.py". public string Command { get; set; } +<<<<<<< HEAD +======= + /// + /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public MachineLearningDistributionConfiguration Distribution { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] The ARM resource ID of the Environment specification for the job. public ResourceIdentifier EnvironmentId { get; set; } /// @@ -172,5 +205,11 @@ public JobTier? QueueJobTier QueueSettings.JobTier = value; } } +<<<<<<< HEAD +======= + + /// Compute Resource configuration for the job. + public MachineLearningJobResourceConfiguration Resources { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs index 4fc64f81073e..bc454fb363ea 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.Serialization.cs @@ -50,11 +50,14 @@ void IJsonModel.Write(Utf8JsonWriter writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } +<<<<<<< HEAD if (Optional.IsDefined(IsArchived)) { writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -148,6 +151,10 @@ internal static MachineLearningComponentVersionProperties DeserializeMachineLear } BinaryData componentSpec = default; RegistryAssetProvisioningState? provisioningState = default; +<<<<<<< HEAD +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -176,6 +183,7 @@ internal static MachineLearningComponentVersionProperties DeserializeMachineLear provisioningState = new RegistryAssetProvisioningState(property.Value.GetString()); continue; } +<<<<<<< HEAD if (property.NameEquals("isArchived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -185,6 +193,8 @@ internal static MachineLearningComponentVersionProperties DeserializeMachineLear isArchived = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -245,6 +255,10 @@ internal static MachineLearningComponentVersionProperties DeserializeMachineLear tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + isAnonymous, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 isArchived, isAnonymous, componentSpec, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs index deeb50d96153..ea1c7c119c3f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComponentVersionProperties.cs @@ -23,14 +23,23 @@ public MachineLearningComponentVersionProperties() /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Defines Component definition details. /// <see href="https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-component-command" /> /// /// Provisioning state for the component version. +<<<<<<< HEAD internal MachineLearningComponentVersionProperties(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, BinaryData componentSpec, RegistryAssetProvisioningState? provisioningState) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous) +======= + internal MachineLearningComponentVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, BinaryData componentSpec, RegistryAssetProvisioningState? provisioningState) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { ComponentSpec = componentSpec; ProvisioningState = provisioningState; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs index e0328ddb0c16..a7b48637fc36 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.Serialization.cs @@ -46,6 +46,11 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("mountAction"u8); writer.WriteStringValue(MountAction.Value.ToString()); } + if (Optional.IsDefined(MountMode)) + { + writer.WritePropertyName("mountMode"u8); + writer.WriteStringValue(MountMode.Value.ToString()); + } if (Optional.IsDefined(CreatedBy)) { writer.WritePropertyName("createdBy"u8); @@ -113,6 +118,7 @@ internal static MachineLearningComputeInstanceDataMount DeserializeMachineLearni MachineLearningSourceType? sourceType = default; string mountName = default; MachineLearningMountAction? mountAction = default; + MountMode? mountMode = default; string createdBy = default; string mountPath = default; MachineLearningMountState? mountState = default; @@ -150,6 +156,15 @@ internal static MachineLearningComputeInstanceDataMount DeserializeMachineLearni mountAction = new MachineLearningMountAction(property.Value.GetString()); continue; } + if (property.NameEquals("mountMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mountMode = new MountMode(property.Value.GetString()); + continue; + } if (property.NameEquals("createdBy"u8)) { createdBy = property.Value.GetString(); @@ -194,6 +209,7 @@ internal static MachineLearningComputeInstanceDataMount DeserializeMachineLearni sourceType, mountName, mountAction, + mountMode, createdBy, mountPath, mountState, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs index 0810ecad2bbd..bed98f0652e2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceDataMount.cs @@ -46,7 +46,7 @@ public partial class MachineLearningComputeInstanceDataMount private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal MachineLearningComputeInstanceDataMount() + public MachineLearningComputeInstanceDataMount() { } @@ -55,18 +55,20 @@ internal MachineLearningComputeInstanceDataMount() /// Data source type. /// name of the ComputeInstance data mount. /// Mount Action. + /// Mount Mode. /// who this data mount created by. /// Path of this data mount. /// Mount state. /// The time when the disk mounted. /// Error of this data mount. /// Keeps track of any properties unknown to the library. - internal MachineLearningComputeInstanceDataMount(string source, MachineLearningSourceType? sourceType, string mountName, MachineLearningMountAction? mountAction, string createdBy, string mountPath, MachineLearningMountState? mountState, DateTimeOffset? mountedOn, string error, IDictionary serializedAdditionalRawData) + internal MachineLearningComputeInstanceDataMount(string source, MachineLearningSourceType? sourceType, string mountName, MachineLearningMountAction? mountAction, MountMode? mountMode, string createdBy, string mountPath, MachineLearningMountState? mountState, DateTimeOffset? mountedOn, string error, IDictionary serializedAdditionalRawData) { Source = source; SourceType = sourceType; MountName = mountName; MountAction = mountAction; + MountMode = mountMode; CreatedBy = createdBy; MountPath = mountPath; MountState = mountState; @@ -76,22 +78,24 @@ internal MachineLearningComputeInstanceDataMount(string source, MachineLearningS } /// Source of the ComputeInstance data mount. - public string Source { get; } + public string Source { get; set; } /// Data source type. - public MachineLearningSourceType? SourceType { get; } + public MachineLearningSourceType? SourceType { get; set; } /// name of the ComputeInstance data mount. - public string MountName { get; } + public string MountName { get; set; } /// Mount Action. - public MachineLearningMountAction? MountAction { get; } + public MachineLearningMountAction? MountAction { get; set; } + /// Mount Mode. + public MountMode? MountMode { get; set; } /// who this data mount created by. - public string CreatedBy { get; } + public string CreatedBy { get; set; } /// Path of this data mount. - public string MountPath { get; } + public string MountPath { get; set; } /// Mount state. - public MachineLearningMountState? MountState { get; } + public MachineLearningMountState? MountState { get; set; } /// The time when the disk mounted. - public DateTimeOffset? MountedOn { get; } + public DateTimeOffset? MountedOn { get; set; } /// Error of this data mount. - public string Error { get; } + public string Error { get; set; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs index 7904fc4d70d6..f27d19dd5036 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.Serialization.cs @@ -129,6 +129,54 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WriteNull("computeInstanceAuthorizationType"); } } + if (Optional.IsDefined(EnableOSPatching)) + { + if (EnableOSPatching != null) + { + writer.WritePropertyName("enableOSPatching"u8); + writer.WriteBooleanValue(EnableOSPatching.Value); + } + else + { + writer.WriteNull("enableOSPatching"); + } + } + if (Optional.IsDefined(EnableRootAccess)) + { + if (EnableRootAccess != null) + { + writer.WritePropertyName("enableRootAccess"u8); + writer.WriteBooleanValue(EnableRootAccess.Value); + } + else + { + writer.WriteNull("enableRootAccess"); + } + } + if (Optional.IsDefined(EnableSso)) + { + if (EnableSso != null) + { + writer.WritePropertyName("enableSSO"u8); + writer.WriteBooleanValue(EnableSso.Value); + } + else + { + writer.WriteNull("enableSSO"); + } + } + if (Optional.IsDefined(ReleaseQuotaOnStop)) + { + if (ReleaseQuotaOnStop != null) + { + writer.WritePropertyName("releaseQuotaOnStop"u8); + writer.WriteBooleanValue(ReleaseQuotaOnStop.Value); + } + else + { + writer.WriteNull("releaseQuotaOnStop"); + } + } if (Optional.IsDefined(PersonalComputeInstanceSettings)) { if (PersonalComputeInstanceSettings != null) @@ -288,6 +336,10 @@ internal static MachineLearningComputeInstanceProperties DeserializeMachineLearn IReadOnlyList errors = default; MachineLearningComputeInstanceState? state = default; MachineLearningComputeInstanceAuthorizationType? computeInstanceAuthorizationType = default; + bool? enableOSPatching = default; + bool? enableRootAccess = default; + bool? enableSso = default; + bool? releaseQuotaOnStop = default; PersonalComputeInstanceSettings personalComputeInstanceSettings = default; SetupScripts setupScripts = default; MachineLearningComputeInstanceLastOperation lastOperation = default; @@ -424,6 +476,46 @@ internal static MachineLearningComputeInstanceProperties DeserializeMachineLearn computeInstanceAuthorizationType = new MachineLearningComputeInstanceAuthorizationType(property.Value.GetString()); continue; } + if (property.NameEquals("enableOSPatching"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + enableOSPatching = null; + continue; + } + enableOSPatching = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableRootAccess"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + enableRootAccess = null; + continue; + } + enableRootAccess = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableSSO"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + enableSso = null; + continue; + } + enableSso = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("releaseQuotaOnStop"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + releaseQuotaOnStop = null; + continue; + } + releaseQuotaOnStop = property.Value.GetBoolean(); + continue; + } if (property.NameEquals("personalComputeInstanceSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -546,6 +638,10 @@ internal static MachineLearningComputeInstanceProperties DeserializeMachineLearn errors ?? new ChangeTrackingList(), state, computeInstanceAuthorizationType, + enableOSPatching, + enableRootAccess, + enableSso, + releaseQuotaOnStop, personalComputeInstanceSettings, setupScripts, lastOperation, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs index 37f2f2d77fed..8f030c85729c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceProperties.cs @@ -70,6 +70,10 @@ public MachineLearningComputeInstanceProperties() /// Collection of errors encountered on this ComputeInstance. /// The current state of this ComputeInstance. /// The Compute Instance Authorization type. Available values are personal (default). + /// Enable Auto OS Patching. Possible values are: true, false. + /// Enable root access. Possible values are: true, false. + /// Enable SSO (single sign on). Possible values are: true, false. + /// Release quota if compute instance stopped. Possible values are: true - release quota if compute instance stopped. false - don't release quota when compute instance stopped. /// Settings for a personal compute instance. /// Details of customized scripts to execute for setting up the cluster. /// The last operation on ComputeInstance. @@ -80,7 +84,11 @@ public MachineLearningComputeInstanceProperties() /// Describes informations of dataMounts on this ComputeInstance. /// ComputeInstance version. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal MachineLearningComputeInstanceProperties(string vmSize, ResourceId subnet, MachineLearningApplicationSharingPolicy? applicationSharingPolicy, MachineLearningComputeInstanceSshSettings sshSettings, IList customServices, ImageMetadata osImageMetadata, MachineLearningComputeInstanceConnectivityEndpoints connectivityEndpoints, IReadOnlyList applications, MachineLearningComputeInstanceCreatedBy createdBy, IReadOnlyList errors, MachineLearningComputeInstanceState? state, MachineLearningComputeInstanceAuthorizationType? computeInstanceAuthorizationType, PersonalComputeInstanceSettings personalComputeInstanceSettings, SetupScripts setupScriptsSettings, MachineLearningComputeInstanceLastOperation lastOperation, ComputeSchedules schedules, bool? enableNodePublicIP, IReadOnlyList containers, IReadOnlyList dataDisks, IReadOnlyList dataMounts, ComputeInstanceVersion versions, IDictionary serializedAdditionalRawData) +======= + internal MachineLearningComputeInstanceProperties(string vmSize, ResourceId subnet, MachineLearningApplicationSharingPolicy? applicationSharingPolicy, ComputeInstanceAutologgerSettings autologgerSettings, MachineLearningComputeInstanceSshSettings sshSettings, IList customServices, ImageMetadata osImageMetadata, MachineLearningComputeInstanceConnectivityEndpoints connectivityEndpoints, IReadOnlyList applications, MachineLearningComputeInstanceCreatedBy createdBy, IReadOnlyList errors, MachineLearningComputeInstanceState? state, MachineLearningComputeInstanceAuthorizationType? computeInstanceAuthorizationType, bool? enableOSPatching, bool? enableRootAccess, bool? enableSso, bool? releaseQuotaOnStop, PersonalComputeInstanceSettings personalComputeInstanceSettings, SetupScripts setupScriptsSettings, MachineLearningComputeInstanceLastOperation lastOperation, ComputeSchedules schedules, string idleTimeBeforeShutdown, bool? enableNodePublicIP, IReadOnlyList containers, IReadOnlyList dataDisks, IReadOnlyList dataMounts, ComputeInstanceVersion versions, IDictionary serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { VmSize = vmSize; Subnet = subnet; @@ -94,6 +102,10 @@ internal MachineLearningComputeInstanceProperties(string vmSize, ResourceId subn Errors = errors; State = state; ComputeInstanceAuthorizationType = computeInstanceAuthorizationType; + EnableOSPatching = enableOSPatching; + EnableRootAccess = enableRootAccess; + EnableSso = enableSso; + ReleaseQuotaOnStop = releaseQuotaOnStop; PersonalComputeInstanceSettings = personalComputeInstanceSettings; SetupScriptsSettings = setupScriptsSettings; LastOperation = lastOperation; @@ -137,6 +149,14 @@ public ResourceIdentifier SubnetId public MachineLearningComputeInstanceState? State { get; } /// The Compute Instance Authorization type. Available values are personal (default). public MachineLearningComputeInstanceAuthorizationType? ComputeInstanceAuthorizationType { get; set; } + /// Enable Auto OS Patching. Possible values are: true, false. + public bool? EnableOSPatching { get; set; } + /// Enable root access. Possible values are: true, false. + public bool? EnableRootAccess { get; set; } + /// Enable SSO (single sign on). Possible values are: true, false. + public bool? EnableSso { get; set; } + /// Release quota if compute instance stopped. Possible values are: true - release quota if compute instance stopped. false - don't release quota when compute instance stopped. + public bool? ReleaseQuotaOnStop { get; set; } /// Settings for a personal compute instance. internal PersonalComputeInstanceSettings PersonalComputeInstanceSettings { get; set; } /// A user explicitly assigned to a personal compute instance. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs index 924e9af414ed..5cd4f18a8ef4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningComputeInstanceState.cs @@ -27,6 +27,7 @@ public MachineLearningComputeInstanceState(string value) private const string DeletingValue = "Deleting"; private const string RunningValue = "Running"; private const string RestartingValue = "Restarting"; + private const string ResizingValue = "Resizing"; private const string JobRunningValue = "JobRunning"; private const string SettingUpValue = "SettingUp"; private const string SetupFailedValue = "SetupFailed"; @@ -48,6 +49,8 @@ public MachineLearningComputeInstanceState(string value) public static MachineLearningComputeInstanceState Running { get; } = new MachineLearningComputeInstanceState(RunningValue); /// Restarting. public static MachineLearningComputeInstanceState Restarting { get; } = new MachineLearningComputeInstanceState(RestartingValue); + /// Resizing. + public static MachineLearningComputeInstanceState Resizing { get; } = new MachineLearningComputeInstanceState(ResizingValue); /// JobRunning. public static MachineLearningComputeInstanceState JobRunning { get; } = new MachineLearningComputeInstanceState(JobRunningValue); /// SettingUp. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs index 5449acc39606..98e30fe39a78 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningConnectionCategory.cs @@ -35,6 +35,7 @@ public MachineLearningConnectionCategory(string value) private const string RedisValue = "Redis"; private const string ApiKeyValue = "ApiKey"; private const string AzureOpenAIValue = "AzureOpenAI"; + private const string AIServicesValue = "AIServices"; private const string CognitiveSearchValue = "CognitiveSearch"; private const string CognitiveServiceValue = "CognitiveService"; private const string CustomKeysValue = "CustomKeys"; @@ -123,7 +124,10 @@ public MachineLearningConnectionCategory(string value) private const string SerpValue = "Serp"; private const string BingLLMSearchValue = "BingLLMSearch"; private const string ServerlessValue = "Serverless"; +<<<<<<< HEAD private const string AIServicesValue = "AIServices"; +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// PythonFeed. public static MachineLearningConnectionCategory PythonFeed { get; } = new MachineLearningConnectionCategory(PythonFeedValue); @@ -151,6 +155,8 @@ public MachineLearningConnectionCategory(string value) public static MachineLearningConnectionCategory ApiKey { get; } = new MachineLearningConnectionCategory(ApiKeyValue); /// AzureOpenAI. public static MachineLearningConnectionCategory AzureOpenAI { get; } = new MachineLearningConnectionCategory(AzureOpenAIValue); + /// AIServices. + public static MachineLearningConnectionCategory AIServices { get; } = new MachineLearningConnectionCategory(AIServicesValue); /// CognitiveSearch. public static MachineLearningConnectionCategory CognitiveSearch { get; } = new MachineLearningConnectionCategory(CognitiveSearchValue); /// CognitiveService. @@ -327,8 +333,11 @@ public MachineLearningConnectionCategory(string value) public static MachineLearningConnectionCategory BingLLMSearch { get; } = new MachineLearningConnectionCategory(BingLLMSearchValue); /// Serverless. public static MachineLearningConnectionCategory Serverless { get; } = new MachineLearningConnectionCategory(ServerlessValue); +<<<<<<< HEAD /// AIServices. public static MachineLearningConnectionCategory AIServices { get; } = new MachineLearningConnectionCategory(AIServicesValue); +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Determines if two values are the same. public static bool operator ==(MachineLearningConnectionCategory left, MachineLearningConnectionCategory right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs index 5c4537d65510..babcd6a4a6e0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.Serialization.cs @@ -26,6 +26,14 @@ void IJsonModel.Write(Utf8JsonWriter writer } writer.WriteStartObject(); +<<<<<<< HEAD +======= + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Uri)) { if (Uri != null) @@ -95,6 +103,10 @@ internal static MachineLearningCustomModelJobOutput DeserializeMachineLearningCu { return null; } +<<<<<<< HEAD +======= + MachineLearningOutputDeliveryMode? mode = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri uri = default; MachineLearningOutputDeliveryMode? mode = default; JobOutputType jobOutputType = default; @@ -103,6 +115,7 @@ internal static MachineLearningCustomModelJobOutput DeserializeMachineLearningCu Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("uri"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -113,6 +126,8 @@ internal static MachineLearningCustomModelJobOutput DeserializeMachineLearningCu uri = new Uri(property.Value.GetString()); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -143,7 +158,11 @@ internal static MachineLearningCustomModelJobOutput DeserializeMachineLearningCu } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new MachineLearningCustomModelJobOutput(jobOutputType, description, serializedAdditionalRawData, uri, mode); +======= + return new MachineLearningCustomModelJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs index 7e2c290d9278..8fa972e384b5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningCustomModelJobOutput.cs @@ -23,15 +23,28 @@ public MachineLearningCustomModelJobOutput() /// [Required] Specifies the type of job. /// Description for the output. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Output Asset URI. /// Output Asset Delivery Mode. internal MachineLearningCustomModelJobOutput(JobOutputType jobOutputType, string description, IDictionary serializedAdditionalRawData, Uri uri, MachineLearningOutputDeliveryMode? mode) : base(jobOutputType, description, serializedAdditionalRawData) { +======= + /// Output Asset Delivery Mode. + /// Output Asset URI. + internal MachineLearningCustomModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + { + Mode = mode; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri = uri; Mode = mode; JobOutputType = jobOutputType; } +<<<<<<< HEAD +======= + /// Output Asset Delivery Mode. + public MachineLearningOutputDeliveryMode? Mode { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Output Asset URI. public Uri Uri { get; set; } /// Output Asset Delivery Mode. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs index 67b779741472..f8c6d4ece449 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.Serialization.cs @@ -29,11 +29,14 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); +<<<<<<< HEAD if (Optional.IsDefined(IsArchived)) { writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs index ac6d1d60626b..4a9ee4a3f1e0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDataVersionProperties.cs @@ -32,11 +32,19 @@ public MachineLearningDataVersionProperties(Uri dataUri) /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. internal MachineLearningDataVersionProperties(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, MachineLearningDataType dataType, Uri dataUri) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous) +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + /// [Required] Specifies the type of data. + /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. + internal MachineLearningDataVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { DataType = dataType; DataUri = dataUri; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs index b62fe805ce66..553790ac3493 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningDatastoreProperties.cs @@ -43,7 +43,13 @@ public MachineLearningDatastoreProperties(MachineLearningDatastoreCredentials cr /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// +<<<<<<< HEAD internal MachineLearningDatastoreProperties(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, DatastoreType datastoreType, bool? isDefault, MachineLearningDatastoreCredentials credentials) : base(description, tags, properties, serializedAdditionalRawData) +======= + /// [Required] Storage type backing the datastore. + /// Readonly property to indicate if datastore is the workspace default datastore. + internal MachineLearningDatastoreProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault) : base(description, properties, tags, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { DatastoreType = datastoreType; IsDefault = isDefault; @@ -65,5 +71,12 @@ internal MachineLearningDatastoreProperties() /// The available derived classes include , , , and . /// public MachineLearningDatastoreCredentials Credentials { get; set; } +<<<<<<< HEAD +======= + /// [Required] Storage type backing the datastore. + internal DatastoreType DatastoreType { get; set; } + /// Readonly property to indicate if datastore is the workspace default datastore. + public bool? IsDefault { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs index e44c5fe8a702..e5049ef2dd1f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEndpointDeploymentProperties.cs @@ -54,6 +54,11 @@ public MachineLearningEndpointDeploymentProperties() /// Initializes a new instance of . /// Description of the endpoint deployment. +<<<<<<< HEAD +======= + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. + /// Environment variables configuration for the deployment. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Property dictionary. Properties can be added, but not removed or altered. /// Code configuration for the endpoint deployment. /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. @@ -71,10 +76,13 @@ internal MachineLearningEndpointDeploymentProperties(string description, IDictio /// Description of the endpoint deployment. public string Description { get; set; } +<<<<<<< HEAD /// Property dictionary. Properties can be added, but not removed or altered. public IDictionary Properties { get; set; } /// Code configuration for the endpoint deployment. public MachineLearningCodeConfiguration CodeConfiguration { get; set; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. public string EnvironmentId { get; set; } /// Environment variables configuration for the deployment. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs index e746b634fbe7..404cc7ffaa5e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.Serialization.cs @@ -41,11 +41,14 @@ void IJsonModel.Write(Utf8JsonWrite writer.WritePropertyName("condaFile"u8); writer.WriteStringValue(CondaFile); } +<<<<<<< HEAD if (Optional.IsDefined(Build)) { writer.WritePropertyName("build"u8); writer.WriteObjectValue(Build, options); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(OSType)) { writer.WritePropertyName("osType"u8); @@ -78,11 +81,14 @@ void IJsonModel.Write(Utf8JsonWrite writer.WriteNull("stage"); } } +<<<<<<< HEAD if (Optional.IsDefined(IsArchived)) { writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -176,13 +182,21 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe } MachineLearningEnvironmentType? environmentType = default; string image = default; +<<<<<<< HEAD string condaFile = default; MachineLearningBuildContext build = default; +======= + MachineLearningInferenceContainerProperties inferenceConfig = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningOperatingSystemType? osType = default; MachineLearningInferenceContainerProperties inferenceConfig = default; AutoRebuildSetting? autoRebuild = default; RegistryAssetProvisioningState? provisioningState = default; string stage = default; +<<<<<<< HEAD +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -211,6 +225,7 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe condaFile = property.Value.GetString(); continue; } +<<<<<<< HEAD if (property.NameEquals("build"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -220,6 +235,8 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe build = MachineLearningBuildContext.DeserializeMachineLearningBuildContext(property.Value, options); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("osType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -266,6 +283,7 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe stage = property.Value.GetString(); continue; } +<<<<<<< HEAD if (property.NameEquals("isArchived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -275,6 +293,8 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe isArchived = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -335,12 +355,20 @@ internal static MachineLearningEnvironmentVersionProperties DeserializeMachineLe tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + isAnonymous, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 isArchived, isAnonymous, environmentType, image, +<<<<<<< HEAD condaFile, build, +======= + inferenceConfig, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 osType, inferenceConfig, autoRebuild, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs index 0b48e082bf95..6ff8c04e6b23 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningEnvironmentVersionProperties.cs @@ -23,8 +23,19 @@ public MachineLearningEnvironmentVersionProperties() /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + /// Defines if image needs to be rebuilt based on base image changes. + /// Configuration settings for Docker build context. + /// + /// Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. + /// <see href="https://repo2docker.readthedocs.io/en/latest/config_files.html#environment-yml-install-a-conda-environment" /> + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Environment type is either user managed or curated by the Azure ML service /// <see href="https://docs.microsoft.com/en-us/azure/machine-learning/resource-curated-environments" /> @@ -33,22 +44,34 @@ public MachineLearningEnvironmentVersionProperties() /// Name of the image that will be used for the environment. /// <seealso href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" /> /// +<<<<<<< HEAD /// /// Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. /// <see href="https://repo2docker.readthedocs.io/en/latest/config_files.html#environment-yml-install-a-conda-environment" /> /// /// Configuration settings for Docker build context. +======= + /// Defines configuration specific to inference. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The OS type of the environment. /// Defines configuration specific to inference. /// Defines if image needs to be rebuilt based on base image changes. /// Provisioning state for the environment version. /// Stage in the environment lifecycle assigned to this environment. +<<<<<<< HEAD internal MachineLearningEnvironmentVersionProperties(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, MachineLearningEnvironmentType? environmentType, string image, string condaFile, MachineLearningBuildContext build, MachineLearningOperatingSystemType? osType, MachineLearningInferenceContainerProperties inferenceConfig, AutoRebuildSetting? autoRebuild, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous) +======= + internal MachineLearningEnvironmentVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, AutoRebuildSetting? autoRebuild, MachineLearningBuildContext build, string condaFile, MachineLearningEnvironmentType? environmentType, string image, MachineLearningInferenceContainerProperties inferenceConfig, MachineLearningOperatingSystemType? osType, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { EnvironmentType = environmentType; Image = image; +<<<<<<< HEAD CondaFile = condaFile; Build = build; +======= + InferenceConfig = inferenceConfig; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 OSType = osType; InferenceConfig = inferenceConfig; AutoRebuild = autoRebuild; @@ -66,6 +89,7 @@ internal MachineLearningEnvironmentVersionProperties(string description, IDictio /// <seealso href="https://docs.microsoft.com/en-us/azure/machine-learning/how-to-deploy-custom-docker-image#use-a-custom-base-image" /> /// public string Image { get; set; } +<<<<<<< HEAD /// /// Standard configuration file used by Conda that lets you install any kind of package, including Python, R, and C/C++ packages. /// <see href="https://repo2docker.readthedocs.io/en/latest/config_files.html#environment-yml-install-a-conda-environment" /> @@ -73,6 +97,10 @@ internal MachineLearningEnvironmentVersionProperties(string description, IDictio public string CondaFile { get; set; } /// Configuration settings for Docker build context. public MachineLearningBuildContext Build { get; set; } +======= + /// Defines configuration specific to inference. + public MachineLearningInferenceContainerProperties InferenceConfig { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The OS type of the environment. public MachineLearningOperatingSystemType? OSType { get; set; } /// Defines configuration specific to inference. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs index 9303a3b26ee2..09dc44ea1c2b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.Serialization.cs @@ -86,8 +86,32 @@ void IJsonModel.Write(Utf8JsonWriter } if (Optional.IsDefined(IsArchived)) { +<<<<<<< HEAD writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); +======= + if (Specification != null) + { + writer.WritePropertyName("specification"u8); + writer.WriteObjectValue(Specification, options); + } + else + { + writer.WriteNull("specification"); + } + } + if (Optional.IsDefined(Stage)) + { + if (Stage != null) + { + writer.WritePropertyName("stage"u8); + writer.WriteStringValue(Stage); + } + else + { + writer.WriteNull("stage"); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(IsAnonymous)) { @@ -183,8 +207,12 @@ internal static MachineLearningFeatureSetVersionProperties DeserializeMachineLea FeaturesetSpecification specification = default; MaterializationSettings materializationSettings = default; string stage = default; +<<<<<<< HEAD IList entities = default; RegistryAssetProvisioningState? provisioningState = default; +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -248,6 +276,38 @@ internal static MachineLearningFeatureSetVersionProperties DeserializeMachineLea provisioningState = new RegistryAssetProvisioningState(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("specification"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + specification = null; + continue; + } + specification = FeaturesetSpecification.DeserializeFeaturesetSpecification(property.Value, options); + continue; + } + if (property.NameEquals("stage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + stage = null; + continue; + } + stage = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAnonymous"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAnonymous = property.Value.GetBoolean(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("isArchived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -317,6 +377,10 @@ internal static MachineLearningFeatureSetVersionProperties DeserializeMachineLea tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + isAnonymous, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 isArchived, isAnonymous, specification, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs index 8d72670ae44f..6acdcbcace26 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureSetVersionProperties.cs @@ -24,14 +24,26 @@ public MachineLearningFeatureSetVersionProperties() /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + /// Specifies list of entities. + /// Specifies the materialization settings. + /// Provisioning state for the featureset version container. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Specifies the feature spec details. /// Specifies the materialization settings. /// Specifies the asset stage. +<<<<<<< HEAD /// Specifies list of entities. /// Provisioning state for the featureset version container. internal MachineLearningFeatureSetVersionProperties(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, FeaturesetSpecification specification, MaterializationSettings materializationSettings, string stage, IList entities, RegistryAssetProvisioningState? provisioningState) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous) +======= + internal MachineLearningFeatureSetVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, IList entities, MaterializationSettings materializationSettings, RegistryAssetProvisioningState? provisioningState, FeaturesetSpecification specification, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Specification = specification; MaterializationSettings = materializationSettings; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs index d748f1ddf47a..e9898d55bae9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.Serialization.cs @@ -55,10 +55,17 @@ void IJsonModel.Write(Utf8Js writer.WriteNull("stage"); } } +<<<<<<< HEAD if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); +======= + if (Optional.IsDefined(IsAnonymous)) + { + writer.WritePropertyName("isAnonymous"u8); + writer.WriteBooleanValue(IsAnonymous.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(IsArchived)) { @@ -158,7 +165,11 @@ internal static MachineLearningFeatureStoreEntityVersionProperties DeserializeMa } IList indexColumns = default; string stage = default; +<<<<<<< HEAD RegistryAssetProvisioningState? provisioningState = default; +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -193,7 +204,11 @@ internal static MachineLearningFeatureStoreEntityVersionProperties DeserializeMa stage = property.Value.GetString(); continue; } +<<<<<<< HEAD if (property.NameEquals("provisioningState"u8)) +======= + if (property.NameEquals("isAnonymous"u8)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { if (property.Value.ValueKind == JsonValueKind.Null) { @@ -271,6 +286,10 @@ internal static MachineLearningFeatureStoreEntityVersionProperties DeserializeMa tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + isAnonymous, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 isArchived, isAnonymous, indexColumns ?? new ChangeTrackingList(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs index f7bf570ebd66..2bf4eab1a823 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFeatureStoreEntityVersionProperties.cs @@ -24,12 +24,21 @@ public MachineLearningFeatureStoreEntityVersionProperties() /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Specifies index columns. /// Specifies the asset stage. +<<<<<<< HEAD /// Provisioning state for the featurestore entity version. internal MachineLearningFeatureStoreEntityVersionProperties(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, IList indexColumns, string stage, RegistryAssetProvisioningState? provisioningState) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous) +======= + internal MachineLearningFeatureStoreEntityVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, IList indexColumns, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { IndexColumns = indexColumns; Stage = stage; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs index 638c58cf1ca4..387590ec6400 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.Serialization.cs @@ -26,6 +26,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); +<<<<<<< HEAD +======= + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Uri)) { if (Uri != null) @@ -95,6 +103,10 @@ internal static MachineLearningFlowModelJobOutput DeserializeMachineLearningFlow { return null; } +<<<<<<< HEAD +======= + MachineLearningOutputDeliveryMode? mode = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri uri = default; MachineLearningOutputDeliveryMode? mode = default; JobOutputType jobOutputType = default; @@ -103,6 +115,7 @@ internal static MachineLearningFlowModelJobOutput DeserializeMachineLearningFlow Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("uri"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -113,6 +126,8 @@ internal static MachineLearningFlowModelJobOutput DeserializeMachineLearningFlow uri = new Uri(property.Value.GetString()); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -143,7 +158,11 @@ internal static MachineLearningFlowModelJobOutput DeserializeMachineLearningFlow } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new MachineLearningFlowModelJobOutput(jobOutputType, description, serializedAdditionalRawData, uri, mode); +======= + return new MachineLearningFlowModelJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs index 3d440aedb201..601dbdfc1ca7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningFlowModelJobOutput.cs @@ -23,15 +23,28 @@ public MachineLearningFlowModelJobOutput() /// [Required] Specifies the type of job. /// Description for the output. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Output Asset URI. /// Output Asset Delivery Mode. internal MachineLearningFlowModelJobOutput(JobOutputType jobOutputType, string description, IDictionary serializedAdditionalRawData, Uri uri, MachineLearningOutputDeliveryMode? mode) : base(jobOutputType, description, serializedAdditionalRawData) { +======= + /// Output Asset Delivery Mode. + /// Output Asset URI. + internal MachineLearningFlowModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + { + Mode = mode; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri = uri; Mode = mode; JobOutputType = jobOutputType; } +<<<<<<< HEAD +======= + /// Output Asset Delivery Mode. + public MachineLearningOutputDeliveryMode? Mode { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Output Asset URI. public Uri Uri { get; set; } /// Output Asset Delivery Mode. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs index b39d1653ac4b..3b9a8a9b4ab2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.Serialization.cs @@ -55,6 +55,38 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNull("trainingSettings"); } } +<<<<<<< HEAD +======= + if (Optional.IsCollectionDefined(CvSplitColumnNames)) + { + if (CvSplitColumnNames != null) + { + writer.WritePropertyName("cvSplitColumnNames"u8); + writer.WriteStartArray(); + foreach (var item in CvSplitColumnNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("cvSplitColumnNames"); + } + } + if (Optional.IsDefined(FeaturizationSettings)) + { + if (FeaturizationSettings != null) + { + writer.WritePropertyName("featurizationSettings"u8); + writer.WriteObjectValue(FeaturizationSettings, options); + } + else + { + writer.WriteNull("featurizationSettings"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -79,6 +111,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNull("nCrossValidations"); } } +<<<<<<< HEAD if (Optional.IsCollectionDefined(CvSplitColumnNames)) { if (CvSplitColumnNames != null) @@ -94,6 +127,54 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe else { writer.WriteNull("cvSplitColumnNames"); +======= + if (Optional.IsDefined(TestData)) + { + if (TestData != null) + { + writer.WritePropertyName("testData"u8); + writer.WriteObjectValue(TestData, options); + } + else + { + writer.WriteNull("testData"); + } + } + if (Optional.IsDefined(TestDataSize)) + { + if (TestDataSize != null) + { + writer.WritePropertyName("testDataSize"u8); + writer.WriteNumberValue(TestDataSize.Value); + } + else + { + writer.WriteNull("testDataSize"); + } + } + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + if (Optional.IsDefined(ValidationDataSize)) + { + if (ValidationDataSize != null) + { + writer.WritePropertyName("validationDataSize"u8); + writer.WriteNumberValue(ValidationDataSize.Value); + } + else + { + writer.WriteNull("validationDataSize"); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } if (Optional.IsDefined(WeightColumnName)) @@ -230,9 +311,20 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting ForecastingPrimaryMetric? primaryMetric = default; ForecastingSettings forecastingSettings = default; ForecastingTrainingSettings trainingSettings = default; +<<<<<<< HEAD TableVerticalLimitSettings limitSettings = default; NCrossValidations nCrossValidations = default; IList cvSplitColumnNames = default; +======= + IList cvSplitColumnNames = default; + TableVerticalFeaturizationSettings featurizationSettings = default; + TableVerticalLimitSettings limitSettings = default; + NCrossValidations nCrossValidations = default; + MachineLearningTableJobInput testData = default; + double? testDataSize = default; + MachineLearningTableJobInput validationData = default; + double? validationDataSize = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 string weightColumnName = default; MachineLearningTableJobInput validationData = default; MachineLearningTableJobInput testData = default; @@ -276,6 +368,34 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting trainingSettings = ForecastingTrainingSettings.DeserializeForecastingTrainingSettings(property.Value, options); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("cvSplitColumnNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + cvSplitColumnNames = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + cvSplitColumnNames = array; + continue; + } + if (property.NameEquals("featurizationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featurizationSettings = null; + continue; + } + featurizationSettings = TableVerticalFeaturizationSettings.DeserializeTableVerticalFeaturizationSettings(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -296,6 +416,7 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting nCrossValidations = NCrossValidations.DeserializeNCrossValidations(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("cvSplitColumnNames"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -309,6 +430,46 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting array.Add(item.GetString()); } cvSplitColumnNames = array; +======= + if (property.NameEquals("testData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + testData = null; + continue; + } + testData = MachineLearningTableJobInput.DeserializeMachineLearningTableJobInput(property.Value, options); + continue; + } + if (property.NameEquals("testDataSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + testDataSize = null; + continue; + } + testDataSize = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningTableJobInput.DeserializeMachineLearningTableJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationDataSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationDataSize = null; + continue; + } + validationDataSize = property.Value.GetDouble(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("weightColumnName"u8)) @@ -415,10 +576,19 @@ internal static MachineLearningForecasting DeserializeMachineLearningForecasting primaryMetric, forecastingSettings, trainingSettings, +<<<<<<< HEAD limitSettings, nCrossValidations, cvSplitColumnNames ?? new ChangeTrackingList(), weightColumnName, +======= + cvSplitColumnNames ?? new ChangeTrackingList(), + featurizationSettings, + limitSettings, + nCrossValidations, + testData, + testDataSize, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 validationData, testData, validationDataSize, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs index b84d5b6839fb..ce0fa17efcb8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningForecasting.cs @@ -36,6 +36,11 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b /// Primary metric for forecasting task. /// Forecasting task specific inputs. /// Inputs for training phase for an AutoML Job. +<<<<<<< HEAD +======= + /// Columns to use for CVSplit data. + /// Featurization inputs needed for AutoML job. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Execution constraints for AutoMLJob. /// /// Number of cross validation folds to be applied on training dataset @@ -43,8 +48,17 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// +<<<<<<< HEAD /// Columns to use for CVSplit data. /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. +======= + /// Test data input. + /// + /// The fraction of test dataset that needs to be set aside for validation purpose. + /// Values between (0.0 , 1.0) + /// Applied when validation dataset is not provided. + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Validation data inputs. /// Test data input. /// @@ -52,6 +66,7 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b /// Values between (0.0 , 1.0) /// Applied when validation dataset is not provided. /// +<<<<<<< HEAD /// /// The fraction of test dataset that needs to be set aside for validation purpose. /// Values between (0.0 , 1.0) @@ -59,13 +74,28 @@ public MachineLearningForecasting(MachineLearningTableJobInput trainingData) : b /// /// Featurization inputs needed for AutoML job. internal MachineLearningForecasting(TaskType taskType, MachineLearningLogVerbosity? logVerbosity, MachineLearningTableJobInput trainingData, string targetColumnName, IDictionary serializedAdditionalRawData, ForecastingPrimaryMetric? primaryMetric, ForecastingSettings forecastingSettings, ForecastingTrainingSettings trainingSettings, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, IList cvSplitColumnNames, string weightColumnName, MachineLearningTableJobInput validationData, MachineLearningTableJobInput testData, double? validationDataSize, double? testDataSize, TableVerticalFeaturizationSettings featurizationSettings) : base(taskType, logVerbosity, trainingData, targetColumnName, serializedAdditionalRawData) +======= + /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. + internal MachineLearningForecasting(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ForecastingSettings forecastingSettings, ForecastingPrimaryMetric? primaryMetric, ForecastingTrainingSettings trainingSettings, IList cvSplitColumnNames, TableVerticalFeaturizationSettings featurizationSettings, TableVerticalLimitSettings limitSettings, NCrossValidations nCrossValidations, MachineLearningTableJobInput testData, double? testDataSize, MachineLearningTableJobInput validationData, double? validationDataSize, string weightColumnName) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { PrimaryMetric = primaryMetric; ForecastingSettings = forecastingSettings; TrainingSettings = trainingSettings; +<<<<<<< HEAD LimitSettings = limitSettings; NCrossValidations = nCrossValidations; CvSplitColumnNames = cvSplitColumnNames; +======= + CvSplitColumnNames = cvSplitColumnNames; + FeaturizationSettings = featurizationSettings; + LimitSettings = limitSettings; + NCrossValidations = nCrossValidations; + TestData = testData; + TestDataSize = testDataSize; + ValidationData = validationData; + ValidationDataSize = validationDataSize; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 WeightColumnName = weightColumnName; ValidationData = validationData; TestData = testData; @@ -86,6 +116,13 @@ internal MachineLearningForecasting() public ForecastingSettings ForecastingSettings { get; set; } /// Inputs for training phase for an AutoML Job. public ForecastingTrainingSettings TrainingSettings { get; set; } +<<<<<<< HEAD +======= + /// Columns to use for CVSplit data. + public IList CvSplitColumnNames { get; set; } + /// Featurization inputs needed for AutoML job. + public TableVerticalFeaturizationSettings FeaturizationSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Execution constraints for AutoMLJob. public TableVerticalLimitSettings LimitSettings { get; set; } /// @@ -95,10 +132,21 @@ internal MachineLearningForecasting() /// The available derived classes include and . /// public NCrossValidations NCrossValidations { get; set; } +<<<<<<< HEAD /// Columns to use for CVSplit data. public IList CvSplitColumnNames { get; set; } /// The name of the sample weight column. Automated ML supports a weighted column as an input, causing rows in the data to be weighted up or down. public string WeightColumnName { get; set; } +======= + /// Test data input. + public MachineLearningTableJobInput TestData { get; set; } + /// + /// The fraction of test dataset that needs to be set aside for validation purpose. + /// Values between (0.0 , 1.0) + /// Applied when validation dataset is not provided. + /// + public double? TestDataSize { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } /// Test data input. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs index 8071a3eba871..ed864165f2a8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.Serialization.cs @@ -49,6 +49,40 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("experimentName"u8); writer.WriteStringValue(ExperimentName); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Identity)) + { + if (Identity != null) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + else + { + writer.WriteNull("identity"); + } + } + if (Optional.IsDefined(IsArchived)) + { + writer.WritePropertyName("isArchived"u8); + writer.WriteBooleanValue(IsArchived.Value); + } + writer.WritePropertyName("jobType"u8); + writer.WriteStringValue(JobType.ToString()); + if (Optional.IsDefined(NotificationSetting)) + { + if (NotificationSetting != null) + { + writer.WritePropertyName("notificationSetting"u8); + writer.WriteObjectValue(NotificationSetting, options); + } + else + { + writer.WriteNull("notificationSetting"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -212,6 +246,10 @@ internal static MachineLearningJobProperties DeserializeMachineLearningJobProper { case "AutoML": return AutoMLJob.DeserializeAutoMLJob(element, options); case "Command": return MachineLearningCommandJob.DeserializeMachineLearningCommandJob(element, options); +<<<<<<< HEAD +======= + case "FineTuning": return FineTuningJob.DeserializeFineTuningJob(element, options); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 case "Pipeline": return MachineLearningPipelineJob.DeserializeMachineLearningPipelineJob(element, options); case "Spark": return SparkJob.DeserializeSparkJob(element, options); case "Sweep": return MachineLearningSweepJob.DeserializeMachineLearningSweepJob(element, options); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs index 7c13212e09c7..054d8e74bf61 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobProperties.cs @@ -14,7 +14,11 @@ namespace Azure.ResourceManager.MachineLearning.Models /// /// Base definition for a job. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +<<<<<<< HEAD /// The available derived classes include , , , and . +======= + /// The available derived classes include , , , , and . +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// public partial class MachineLearningJobProperties : MachineLearningResourceBase { @@ -47,10 +51,24 @@ public MachineLearningJobProperties() /// /// ARM resource ID of the component resource. /// Notification setting for the job. +<<<<<<< HEAD internal MachineLearningJobProperties(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, JobType jobType, string displayName, MachineLearningJobStatus? status, string experimentName, IDictionary services, ResourceIdentifier computeId, bool? isArchived, MachineLearningIdentityConfiguration identity, ResourceIdentifier componentId, NotificationSetting notificationSetting) : base(description, tags, properties, serializedAdditionalRawData) +======= + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + internal MachineLearningJobProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status) : base(description, properties, tags, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { JobType = jobType; +<<<<<<< HEAD DisplayName = displayName; +======= + NotificationSetting = notificationSetting; + Services = services; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Status = status; ExperimentName = experimentName; Services = services; @@ -89,5 +107,15 @@ internal MachineLearningJobProperties(string description, IDictionary Notification setting for the job. public NotificationSetting NotificationSetting { get; set; } +<<<<<<< HEAD +======= + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + public IDictionary Services { get; set; } + /// Status of the job. + public MachineLearningJobStatus? Status { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs index 2c7b1f742e00..364e05f6a825 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobResourceConfiguration.cs @@ -24,8 +24,12 @@ public MachineLearningJobResourceConfiguration() /// Additional properties bag. /// Keeps track of any properties unknown to the library. /// Size of the docker container's shared memory block. This should be in the format of (number)(unit) where number as to be greater than 0 and the unit can be one of b(bytes), k(kilobytes), m(megabytes), or g(gigabytes). +<<<<<<< HEAD /// Extra arguments to pass to the Docker run command. This would override any parameters that have already been set by the system, or in this section. This parameter is only supported for Azure ML compute types. internal MachineLearningJobResourceConfiguration(int? instanceCount, string instanceType, IDictionary properties, IDictionary serializedAdditionalRawData, string shmSize, string dockerArgs) : base(instanceCount, instanceType, properties, serializedAdditionalRawData) +======= + internal MachineLearningJobResourceConfiguration(int? instanceCount, string instanceType, IDictionary properties, IDictionary serializedAdditionalRawData, string dockerArgs, string shmSize) : base(instanceCount, instanceType, properties, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { ShmSize = shmSize; DockerArgs = dockerArgs; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs index c3441987c647..b999bbb2b834 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobScheduleAction.cs @@ -17,7 +17,11 @@ public partial class MachineLearningJobScheduleAction : MachineLearningScheduleA /// /// [Required] Defines Schedule action definition details. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +<<<<<<< HEAD /// The available derived classes include , , , and . +======= + /// The available derived classes include , , , , and . +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// is null. public MachineLearningJobScheduleAction(MachineLearningJobProperties jobDefinition) @@ -34,7 +38,11 @@ public MachineLearningJobScheduleAction(MachineLearningJobProperties jobDefiniti /// /// [Required] Defines Schedule action definition details. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +<<<<<<< HEAD /// The available derived classes include , , , and . +======= + /// The available derived classes include , , , , and . +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// internal MachineLearningJobScheduleAction(ScheduleActionType actionType, IDictionary serializedAdditionalRawData, MachineLearningJobProperties jobDefinition) : base(actionType, serializedAdditionalRawData) { @@ -50,7 +58,11 @@ internal MachineLearningJobScheduleAction() /// /// [Required] Defines Schedule action definition details. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +<<<<<<< HEAD /// The available derived classes include , , , and . +======= + /// The available derived classes include , , , , and . +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// public MachineLearningJobProperties JobDefinition { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs index 518a619b8ff5..8a42d37f6172 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningJobService.cs @@ -64,6 +64,12 @@ public MachineLearningJobService() /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// +<<<<<<< HEAD +======= + /// Port for endpoint. + /// Additional properties to set on the endpoint. + /// Status of endpoint. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Keeps track of any properties unknown to the library. internal MachineLearningJobService(string jobServiceType, int? port, string endpoint, string status, string errorMessage, IDictionary properties, JobNodes nodes, IDictionary serializedAdditionalRawData) { @@ -96,5 +102,14 @@ internal MachineLearningJobService(string jobServiceType, int? port, string endp /// The available derived classes include . /// public JobNodes Nodes { get; set; } +<<<<<<< HEAD +======= + /// Port for endpoint. + public int? Port { get; set; } + /// Additional properties to set on the endpoint. + public IDictionary Properties { get; set; } + /// Status of endpoint. + public string Status { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs index 049cf41f7d95..71785c43f2a9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningKubernetesOnlineDeployment.cs @@ -21,6 +21,11 @@ public MachineLearningKubernetesOnlineDeployment() /// Initializes a new instance of . /// Description of the endpoint deployment. +<<<<<<< HEAD +======= + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. + /// Environment variables configuration for the deployment. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Property dictionary. Properties can be added, but not removed or altered. /// Code configuration for the endpoint deployment. /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs index 6b990e743438..44ad0280d53d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.Serialization.cs @@ -43,12 +43,21 @@ void IJsonModel.Write writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -57,12 +66,54 @@ void IJsonModel.Write { writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); +======= + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -93,6 +144,12 @@ void IJsonModel.Write { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -136,6 +193,7 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -144,6 +202,18 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -180,6 +250,14 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,11 +285,14 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -224,6 +305,41 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri dictionary.Add(property0.Name, property0.Value.GetString()); } metadata = dictionary; +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("sharedUserList"u8)) @@ -254,6 +370,15 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri valueFormat = new MachineLearningValueFormat(property.Value.GetString()); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -264,6 +389,7 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -272,6 +398,18 @@ internal static MachineLearningManagedIdentityAuthTypeWorkspaceConnection Deseri sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs index 2fedf624f7a4..64d08071a4cd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedIdentityAuthTypeWorkspaceConnection.cs @@ -24,6 +24,7 @@ public MachineLearningManagedIdentityAuthTypeWorkspaceConnection() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -35,6 +36,21 @@ public MachineLearningManagedIdentityAuthTypeWorkspaceConnection() /// Keeps track of any properties unknown to the library. /// internal MachineLearningManagedIdentityAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionManagedIdentity credentials) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal MachineLearningManagedIdentityAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionManagedIdentity credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs index c0e519b94ab1..a11558ec2a95 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningManagedOnlineDeployment.cs @@ -21,6 +21,11 @@ public MachineLearningManagedOnlineDeployment() /// Initializes a new instance of . /// Description of the endpoint deployment. +<<<<<<< HEAD +======= + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. + /// Environment variables configuration for the deployment. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Property dictionary. Properties can be added, but not removed or altered. /// Code configuration for the endpoint deployment. /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs index 7deee18b35ee..56066040023f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.Serialization.cs @@ -44,6 +44,21 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteNull("flavors"); } } +<<<<<<< HEAD +======= + if (Optional.IsDefined(JobName)) + { + if (JobName != null) + { + writer.WritePropertyName("jobName"u8); + writer.WriteStringValue(JobName); + } + else + { + writer.WriteNull("jobName"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ModelType)) { if (ModelType != null) @@ -97,11 +112,14 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteNull("stage"); } } +<<<<<<< HEAD if (Optional.IsDefined(IsArchived)) { writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -194,11 +212,19 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning return null; } IDictionary flavors = default; +<<<<<<< HEAD +======= + string jobName = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 string modelType = default; Uri modelUri = default; string jobName = default; RegistryAssetProvisioningState? provisioningState = default; string stage = default; +<<<<<<< HEAD +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -223,6 +249,19 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning flavors = dictionary; continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("jobName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + jobName = null; + continue; + } + jobName = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("modelType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -272,6 +311,7 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning stage = property.Value.GetString(); continue; } +<<<<<<< HEAD if (property.NameEquals("isArchived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -281,6 +321,8 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning isArchived = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -341,9 +383,17 @@ internal static MachineLearningModelVersionProperties DeserializeMachineLearning tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + isAnonymous, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 isArchived, isAnonymous, flavors ?? new ChangeTrackingDictionary(), +<<<<<<< HEAD +======= + jobName, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 modelType, modelUri, jobName, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs index d06798ebbfac..dcf51e78fb4f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningModelVersionProperties.cs @@ -24,17 +24,31 @@ public MachineLearningModelVersionProperties() /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). /// Mapping of model flavors to their properties. +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + /// Mapping of model flavors to their properties. + /// Name of the training job which produced this model. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The storage format for this entity. Used for NCD. /// The URI path to the model contents. /// Name of the training job which produced this model. /// Provisioning state for the model version. /// Stage in the model lifecycle assigned to this model. +<<<<<<< HEAD internal MachineLearningModelVersionProperties(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, IDictionary flavors, string modelType, Uri modelUri, string jobName, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous) { Flavors = flavors; +======= + internal MachineLearningModelVersionProperties(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, IDictionary flavors, string jobName, string modelType, Uri modelUri, RegistryAssetProvisioningState? provisioningState, string stage) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived) + { + Flavors = flavors; + JobName = jobName; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ModelType = modelType; ModelUri = modelUri; JobName = jobName; @@ -44,6 +58,11 @@ internal MachineLearningModelVersionProperties(string description, IDictionary Mapping of model flavors to their properties. public IDictionary Flavors { get; set; } +<<<<<<< HEAD +======= + /// Name of the training job which produced this model. + public string JobName { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The storage format for this entity. Used for NCD. public string ModelType { get; set; } /// The URI path to the model contents. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs index 3c4e596e7571..6669946d344a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.Serialization.cs @@ -38,12 +38,21 @@ void IJsonModel.Write(Utf8JsonWr writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -52,12 +61,54 @@ void IJsonModel.Write(Utf8JsonWr { writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); +======= + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -88,6 +139,12 @@ void IJsonModel.Write(Utf8JsonWr { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -130,6 +187,7 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -138,6 +196,18 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -165,6 +235,14 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -192,11 +270,14 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -209,6 +290,41 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin dictionary.Add(property0.Name, property0.Value.GetString()); } metadata = dictionary; +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("sharedUserList"u8)) @@ -239,6 +355,15 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin valueFormat = new MachineLearningValueFormat(property.Value.GetString()); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -249,6 +374,7 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -257,6 +383,18 @@ internal static MachineLearningNoneAuthTypeWorkspaceConnection DeserializeMachin sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs index ec140dd829ec..c01b58d2a05d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningNoneAuthTypeWorkspaceConnection.cs @@ -24,6 +24,7 @@ public MachineLearningNoneAuthTypeWorkspaceConnection() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -34,6 +35,20 @@ public MachineLearningNoneAuthTypeWorkspaceConnection() /// format for the workspace connection value. /// Keeps track of any properties unknown to the library. internal MachineLearningNoneAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal MachineLearningNoneAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { AuthType = authType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs index 12bb04ef162f..05dc15121918 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOnlineDeploymentProperties.cs @@ -23,6 +23,11 @@ public MachineLearningOnlineDeploymentProperties() /// Initializes a new instance of . /// Description of the endpoint deployment. +<<<<<<< HEAD +======= + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. + /// Environment variables configuration for the deployment. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Property dictionary. Properties can be added, but not removed or altered. /// Code configuration for the endpoint deployment. /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs index 7f3860bc2dd9..47201536eea7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationName.cs @@ -26,6 +26,7 @@ public MachineLearningOperationName(string value) private const string StartValue = "Start"; private const string StopValue = "Stop"; private const string RestartValue = "Restart"; + private const string ResizeValue = "Resize"; private const string ReimageValue = "Reimage"; private const string DeleteValue = "Delete"; @@ -37,6 +38,8 @@ public MachineLearningOperationName(string value) public static MachineLearningOperationName Stop { get; } = new MachineLearningOperationName(StopValue); /// Restart. public static MachineLearningOperationName Restart { get; } = new MachineLearningOperationName(RestartValue); + /// Resize. + public static MachineLearningOperationName Resize { get; } = new MachineLearningOperationName(ResizeValue); /// Reimage. public static MachineLearningOperationName Reimage { get; } = new MachineLearningOperationName(ReimageValue); /// Delete. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs index 4230c3790541..c6297a42b7fb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOperationStatus.cs @@ -28,6 +28,7 @@ public MachineLearningOperationStatus(string value) private const string StartFailedValue = "StartFailed"; private const string StopFailedValue = "StopFailed"; private const string RestartFailedValue = "RestartFailed"; + private const string ResizeFailedValue = "ResizeFailed"; private const string ReimageFailedValue = "ReimageFailed"; private const string DeleteFailedValue = "DeleteFailed"; @@ -43,6 +44,8 @@ public MachineLearningOperationStatus(string value) public static MachineLearningOperationStatus StopFailed { get; } = new MachineLearningOperationStatus(StopFailedValue); /// RestartFailed. public static MachineLearningOperationStatus RestartFailed { get; } = new MachineLearningOperationStatus(RestartFailedValue); + /// ResizeFailed. + public static MachineLearningOperationStatus ResizeFailed { get; } = new MachineLearningOperationStatus(ResizeFailedValue); /// ReimageFailed. public static MachineLearningOperationStatus ReimageFailed { get; } = new MachineLearningOperationStatus(ReimageFailedValue); /// DeleteFailed. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs index 25a9b295e848..7a02756a749d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.Serialization.cs @@ -31,6 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs index cabaf91430a0..c1ad233e93cf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningOutboundRule.cs @@ -52,16 +52,19 @@ public abstract partial class MachineLearningOutboundRule /// Initializes a new instance of . protected MachineLearningOutboundRule() { + ParentRuleNames = new ChangeTrackingList(); } /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. - internal MachineLearningOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) + internal MachineLearningOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) { Category = category; + ParentRuleNames = parentRuleNames; Status = status; OutboundRuleType = outboundRuleType; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -69,6 +72,8 @@ internal MachineLearningOutboundRule(OutboundRuleCategory? category, OutboundRul /// Category of a managed network Outbound Rule of a machine learning workspace. public OutboundRuleCategory? Category { get; set; } + /// Gets the parent rule names. + public IReadOnlyList ParentRuleNames { get; } /// Type of a managed network Outbound Rule of a machine learning workspace. public OutboundRuleStatus? Status { get; set; } /// Type of a managed network Outbound Rule of a machine learning workspace. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs index 71e1ab036f1f..23427adb88b1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.Serialization.cs @@ -43,12 +43,21 @@ void IJsonModel.Write(Utf8JsonWri writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -57,12 +66,54 @@ void IJsonModel.Write(Utf8JsonWri { writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); +======= + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -93,6 +144,12 @@ void IJsonModel.Write(Utf8JsonWri { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -136,6 +193,7 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -144,6 +202,18 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -180,6 +250,14 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,11 +285,14 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -224,6 +305,41 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine dictionary.Add(property0.Name, property0.Value.GetString()); } metadata = dictionary; +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("sharedUserList"u8)) @@ -254,6 +370,15 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine valueFormat = new MachineLearningValueFormat(property.Value.GetString()); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -264,6 +389,7 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -272,6 +398,18 @@ internal static MachineLearningPatAuthTypeWorkspaceConnection DeserializeMachine sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs index 21984023be90..8e0d27e177d7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPatAuthTypeWorkspaceConnection.cs @@ -24,6 +24,7 @@ public MachineLearningPatAuthTypeWorkspaceConnection() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -35,6 +36,21 @@ public MachineLearningPatAuthTypeWorkspaceConnection() /// Keeps track of any properties unknown to the library. /// internal MachineLearningPatAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData, WorkspaceConnectionPersonalAccessToken credentials) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal MachineLearningPatAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionPersonalAccessToken credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs index df0366c180b5..667485d2078c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.Serialization.cs @@ -147,6 +147,40 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("experimentName"u8); writer.WriteStringValue(ExperimentName); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Identity)) + { + if (Identity != null) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + else + { + writer.WriteNull("identity"); + } + } + if (Optional.IsDefined(IsArchived)) + { + writer.WritePropertyName("isArchived"u8); + writer.WriteBooleanValue(IsArchived.Value); + } + writer.WritePropertyName("jobType"u8); + writer.WriteStringValue(JobType.ToString()); + if (Optional.IsDefined(NotificationSetting)) + { + if (NotificationSetting != null) + { + writer.WritePropertyName("notificationSetting"u8); + writer.WriteObjectValue(NotificationSetting, options); + } + else + { + writer.WriteNull("notificationSetting"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -310,7 +344,12 @@ internal static MachineLearningPipelineJob DeserializeMachineLearningPipelineJob IDictionary outputs = default; ResourceIdentifier sourceJobId = default; JobType jobType = default; +<<<<<<< HEAD string displayName = default; +======= + NotificationSetting notificationSetting = default; + IDictionary services = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningJobStatus? status = default; string experimentName = default; IDictionary services = default; @@ -427,6 +466,43 @@ internal static MachineLearningPipelineJob DeserializeMachineLearningPipelineJob experimentName = property.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + identity = null; + continue; + } + identity = MachineLearningIdentityConfiguration.DeserializeMachineLearningIdentityConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("isArchived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isArchived = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new JobType(property.Value.GetString()); + continue; + } + if (property.NameEquals("notificationSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationSetting = null; + continue; + } + notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -543,7 +619,12 @@ internal static MachineLearningPipelineJob DeserializeMachineLearningPipelineJob properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, jobType, +<<<<<<< HEAD displayName, +======= + notificationSetting, + services ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 status, experimentName, services ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs index 3f662aac93a6..14a85d8db426 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningPipelineJob.cs @@ -46,8 +46,16 @@ public MachineLearningPipelineJob() /// /// ARM resource ID of the component resource. /// Notification setting for the job. +<<<<<<< HEAD /// Pipeline settings, for things like ContinueRunOnStepFailure etc. /// Jobs construct the Pipeline Job. +======= + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Inputs for the pipeline job. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -59,7 +67,11 @@ public MachineLearningPipelineJob() /// The available derived classes include , , , , and . /// /// ARM resource ID of source job. +<<<<<<< HEAD internal MachineLearningPipelineJob(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, JobType jobType, string displayName, MachineLearningJobStatus? status, string experimentName, IDictionary services, ResourceIdentifier computeId, bool? isArchived, MachineLearningIdentityConfiguration identity, ResourceIdentifier componentId, NotificationSetting notificationSetting, BinaryData settings, IDictionary jobs, IDictionary inputs, IDictionary outputs, ResourceIdentifier sourceJobId) : base(description, tags, properties, serializedAdditionalRawData, jobType, displayName, status, experimentName, services, computeId, isArchived, identity, componentId, notificationSetting) +======= + internal MachineLearningPipelineJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, IDictionary inputs, IDictionary jobs, IDictionary outputs, BinaryData settings, ResourceIdentifier sourceJobId) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Settings = settings; Jobs = jobs; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.Serialization.cs index dcf3d0d2a6f8..da2d6baf9e06 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.Serialization.cs @@ -118,6 +118,10 @@ internal static MachineLearningRecurrenceTrigger DeserializeMachineLearningRecur string endTime = default; string startTime = default; string timeZone = default; +<<<<<<< HEAD +======= + TriggerType triggerType = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -172,6 +176,14 @@ internal static MachineLearningRecurrenceTrigger DeserializeMachineLearningRecur timeZone = property.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("triggerType"u8)) + { + triggerType = new TriggerType(property.Value.GetString()); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.cs index b757faf8d24c..91d2cb20c051 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningRecurrenceTrigger.cs @@ -39,7 +39,11 @@ public MachineLearningRecurrenceTrigger(MachineLearningRecurrenceFrequency frequ /// [Required] The frequency to trigger schedule. /// [Required] Specifies schedule interval in conjunction with frequency. /// The recurrence schedule. +<<<<<<< HEAD internal MachineLearningRecurrenceTrigger(TriggerType triggerType, string endTime, string startTime, string timeZone, IDictionary serializedAdditionalRawData, MachineLearningRecurrenceFrequency frequency, int interval, MachineLearningRecurrenceSchedule schedule) : base(triggerType, endTime, startTime, timeZone, serializedAdditionalRawData) +======= + internal MachineLearningRecurrenceTrigger(string endTime, string startTime, string timeZone, TriggerType triggerType, IDictionary serializedAdditionalRawData, MachineLearningRecurrenceFrequency frequency, int interval, MachineLearningRecurrenceSchedule schedule) : base(endTime, startTime, timeZone, triggerType, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Frequency = frequency; Interval = interval; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs index abe190d66ee2..f1a5c3571565 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.Serialization.cs @@ -43,12 +43,21 @@ void IJsonModel.Write(Utf8JsonWri writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -57,12 +66,54 @@ void IJsonModel.Write(Utf8JsonWri { writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); +======= + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -93,6 +144,12 @@ void IJsonModel.Write(Utf8JsonWri { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -136,6 +193,7 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -144,6 +202,18 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -180,6 +250,14 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,11 +285,14 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -224,6 +305,41 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine dictionary.Add(property0.Name, property0.Value.GetString()); } metadata = dictionary; +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("sharedUserList"u8)) @@ -254,6 +370,15 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine valueFormat = new MachineLearningValueFormat(property.Value.GetString()); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -264,6 +389,7 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -272,6 +398,18 @@ internal static MachineLearningSasAuthTypeWorkspaceConnection DeserializeMachine sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs index 8cb7b0ab4866..5e61c5cc8a54 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSasAuthTypeWorkspaceConnection.cs @@ -24,6 +24,7 @@ public MachineLearningSasAuthTypeWorkspaceConnection() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -35,6 +36,21 @@ public MachineLearningSasAuthTypeWorkspaceConnection() /// Keeps track of any properties unknown to the library. /// internal MachineLearningSasAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData, WorkspaceConnectionSharedAccessSignature credentials) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal MachineLearningSasAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionSharedAccessSignature credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs index 25f38f0aec44..b4c750a30787 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningScheduleProperties.cs @@ -14,6 +14,14 @@ namespace Azure.ResourceManager.MachineLearning.Models public partial class MachineLearningScheduleProperties : MachineLearningResourceBase { /// Initializes a new instance of . +<<<<<<< HEAD +======= + /// + /// [Required] Specifies the action of the schedule + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// [Required] Specifies the trigger details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -39,6 +47,14 @@ public MachineLearningScheduleProperties(MachineLearningTriggerBase trigger, Mac /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD +======= + /// + /// [Required] Specifies the action of the schedule + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Display name of schedule. /// Is the schedule enabled?. /// @@ -66,6 +82,15 @@ internal MachineLearningScheduleProperties() { } +<<<<<<< HEAD +======= + /// + /// [Required] Specifies the action of the schedule + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public MachineLearningScheduleAction Action { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Display name of schedule. public string DisplayName { get; set; } /// Is the schedule enabled?. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs index e2ae79706fe4..1f214354206d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.Serialization.cs @@ -130,6 +130,40 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WritePropertyName("experimentName"u8); writer.WriteStringValue(ExperimentName); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Identity)) + { + if (Identity != null) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + else + { + writer.WriteNull("identity"); + } + } + if (Optional.IsDefined(IsArchived)) + { + writer.WritePropertyName("isArchived"u8); + writer.WriteBooleanValue(IsArchived.Value); + } + writer.WritePropertyName("jobType"u8); + writer.WriteStringValue(JobType.ToString()); + if (Optional.IsDefined(NotificationSetting)) + { + if (NotificationSetting != null) + { + writer.WritePropertyName("notificationSetting"u8); + writer.WriteObjectValue(NotificationSetting, options); + } + else + { + writer.WriteNull("notificationSetting"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -297,7 +331,12 @@ internal static MachineLearningSweepJob DeserializeMachineLearningSweepJob(JsonE IDictionary outputs = default; JobQueueSettings queueSettings = default; JobType jobType = default; +<<<<<<< HEAD string displayName = default; +======= + NotificationSetting notificationSetting = default; + IDictionary services = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningJobStatus? status = default; string experimentName = default; IDictionary services = default; @@ -421,6 +460,43 @@ internal static MachineLearningSweepJob DeserializeMachineLearningSweepJob(JsonE experimentName = property.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + identity = null; + continue; + } + identity = MachineLearningIdentityConfiguration.DeserializeMachineLearningIdentityConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("isArchived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isArchived = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new JobType(property.Value.GetString()); + continue; + } + if (property.NameEquals("notificationSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationSetting = null; + continue; + } + notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -537,7 +613,12 @@ internal static MachineLearningSweepJob DeserializeMachineLearningSweepJob(JsonE properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, jobType, +<<<<<<< HEAD displayName, +======= + notificationSetting, + services ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 status, experimentName, services ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs index a8de39758365..b5434a11aea7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningSweepJob.cs @@ -63,11 +63,17 @@ public MachineLearningSweepJob(BinaryData searchSpace, SamplingAlgorithm samplin /// /// ARM resource ID of the component resource. /// Notification setting for the job. +<<<<<<< HEAD /// [Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the parameter. /// /// [Required] The hyperparameter sampling algorithm /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , and . +======= + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Sweep Job limit. /// @@ -88,7 +94,18 @@ public MachineLearningSweepJob(BinaryData searchSpace, SamplingAlgorithm samplin /// The available derived classes include , , , , and . /// /// Queue settings for the job. +<<<<<<< HEAD internal MachineLearningSweepJob(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, JobType jobType, string displayName, MachineLearningJobStatus? status, string experimentName, IDictionary services, ResourceIdentifier computeId, bool? isArchived, MachineLearningIdentityConfiguration identity, ResourceIdentifier componentId, NotificationSetting notificationSetting, BinaryData searchSpace, SamplingAlgorithm samplingAlgorithm, MachineLearningSweepJobLimits limits, MachineLearningEarlyTerminationPolicy earlyTermination, MachineLearningObjective objective, MachineLearningTrialComponent trial, IDictionary inputs, IDictionary outputs, JobQueueSettings queueSettings) : base(description, tags, properties, serializedAdditionalRawData, jobType, displayName, status, experimentName, services, computeId, isArchived, identity, componentId, notificationSetting) +======= + /// + /// [Required] The hyperparameter sampling algorithm + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// [Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the parameter. + /// [Required] Trial component definition. + internal MachineLearningSweepJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, MachineLearningEarlyTerminationPolicy earlyTermination, IDictionary inputs, MachineLearningSweepJobLimits limits, MachineLearningObjective objective, IDictionary outputs, JobQueueSettings queueSettings, SamplingAlgorithm samplingAlgorithm, BinaryData searchSpace, MachineLearningTrialComponent trial) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { SearchSpace = searchSpace; SamplingAlgorithm = samplingAlgorithm; @@ -108,6 +125,51 @@ internal MachineLearningSweepJob() } /// +<<<<<<< HEAD +======= + /// Early termination policies enable canceling poor-performing runs before they complete + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public MachineLearningEarlyTerminationPolicy EarlyTermination { get; set; } + /// + /// Mapping of input data bindings used in the job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + public IDictionary Inputs { get; set; } + /// Sweep Job limit. + public MachineLearningSweepJobLimits Limits { get; set; } + /// [Required] Optimization objective. + public MachineLearningObjective Objective { get; set; } + /// + /// Mapping of output data bindings used in the job. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , and . + /// + public IDictionary Outputs { get; set; } + /// Queue settings for the job. + internal JobQueueSettings QueueSettings { get; set; } + /// Controls the compute job tier. + public JobTier? QueueJobTier + { + get => QueueSettings is null ? default : QueueSettings.JobTier; + set + { + if (QueueSettings is null) + QueueSettings = new JobQueueSettings(); + QueueSettings.JobTier = value; + } + } + + /// + /// [Required] The hyperparameter sampling algorithm + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public SamplingAlgorithm SamplingAlgorithm { get; set; } + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] A dictionary containing each parameter and its distribution. The dictionary key is the name of the parameter /// /// To assign an object to this property use . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs index ce4847defcdd..2d8a59d02d32 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.Serialization.cs @@ -52,11 +52,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); +<<<<<<< HEAD if (Optional.IsDefined(IsArchived)) { writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -151,6 +154,10 @@ internal static MachineLearningTable DeserializeMachineLearningTable(JsonElement IList referencedUris = default; MachineLearningDataType dataType = default; Uri dataUri = default; +<<<<<<< HEAD +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -192,6 +199,7 @@ internal static MachineLearningTable DeserializeMachineLearningTable(JsonElement dataUri = new Uri(property.Value.GetString()); continue; } +<<<<<<< HEAD if (property.NameEquals("isArchived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -201,6 +209,8 @@ internal static MachineLearningTable DeserializeMachineLearningTable(JsonElement isArchived = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -261,6 +271,10 @@ internal static MachineLearningTable DeserializeMachineLearningTable(JsonElement tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + isAnonymous, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 isArchived, isAnonymous, dataType, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs index 50d710e8563a..d3fb7035d459 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTable.cs @@ -29,12 +29,21 @@ public MachineLearningTable(Uri dataUri) : base(dataUri) /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. /// Uris referenced in the MLTable definition (required for lineage). internal MachineLearningTable(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, MachineLearningDataType dataType, Uri dataUri, IList referencedUris) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous, dataType, dataUri) +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + /// [Required] Specifies the type of data. + /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. + /// Uris referenced in the MLTable definition (required for lineage). + internal MachineLearningTable(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri, IList referencedUris) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { ReferencedUris = referencedUris; DataType = dataType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs index 0d67ec95e3da..fb81a56c88e5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.Serialization.cs @@ -26,6 +26,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); +<<<<<<< HEAD +======= + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Uri)) { if (Uri != null) @@ -95,6 +103,10 @@ internal static MachineLearningTableJobOutput DeserializeMachineLearningTableJob { return null; } +<<<<<<< HEAD +======= + MachineLearningOutputDeliveryMode? mode = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri uri = default; MachineLearningOutputDeliveryMode? mode = default; JobOutputType jobOutputType = default; @@ -103,6 +115,7 @@ internal static MachineLearningTableJobOutput DeserializeMachineLearningTableJob Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("uri"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -113,6 +126,8 @@ internal static MachineLearningTableJobOutput DeserializeMachineLearningTableJob uri = new Uri(property.Value.GetString()); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -143,7 +158,11 @@ internal static MachineLearningTableJobOutput DeserializeMachineLearningTableJob } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new MachineLearningTableJobOutput(jobOutputType, description, serializedAdditionalRawData, uri, mode); +======= + return new MachineLearningTableJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs index 016983af239b..fc4fe3f63927 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTableJobOutput.cs @@ -23,15 +23,28 @@ public MachineLearningTableJobOutput() /// [Required] Specifies the type of job. /// Description for the output. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Output Asset URI. /// Output Asset Delivery Mode. internal MachineLearningTableJobOutput(JobOutputType jobOutputType, string description, IDictionary serializedAdditionalRawData, Uri uri, MachineLearningOutputDeliveryMode? mode) : base(jobOutputType, description, serializedAdditionalRawData) { +======= + /// Output Asset Delivery Mode. + /// Output Asset URI. + internal MachineLearningTableJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + { + Mode = mode; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri = uri; Mode = mode; JobOutputType = jobOutputType; } +<<<<<<< HEAD +======= + /// Output Asset Delivery Mode. + public MachineLearningOutputDeliveryMode? Mode { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Output Asset URI. public Uri Uri { get; set; } /// Output Asset Delivery Mode. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs index 4b4a6fb55d28..9db7067dbd9a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.Serialization.cs @@ -63,11 +63,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WritePropertyName("enableModelExplainability"u8); writer.WriteBooleanValue(IsModelExplainabilityEnabled.Value); } +<<<<<<< HEAD if (Optional.IsDefined(IsDnnTrainingEnabled)) { writer.WritePropertyName("enableDnnTraining"u8); writer.WriteBooleanValue(IsDnnTrainingEnabled.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -111,8 +114,12 @@ internal static MachineLearningTrainingSettings DeserializeMachineLearningTraini bool? enableStackEnsemble = default; bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; +<<<<<<< HEAD bool? enableModelExplainability = default; bool? enableDnnTraining = default; +======= + MachineLearningStackEnsembleSettings stackEnsembleSettings = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -172,6 +179,7 @@ internal static MachineLearningTrainingSettings DeserializeMachineLearningTraini enableModelExplainability = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("enableDnnTraining"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -181,6 +189,8 @@ internal static MachineLearningTrainingSettings DeserializeMachineLearningTraini enableDnnTraining = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -193,8 +203,12 @@ internal static MachineLearningTrainingSettings DeserializeMachineLearningTraini enableStackEnsemble, enableVoteEnsemble, ensembleModelDownloadTimeout, +<<<<<<< HEAD enableModelExplainability, enableDnnTraining, +======= + stackEnsembleSettings, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs index 136c972448fb..3b4d5552f1cb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrainingSettings.cs @@ -59,18 +59,28 @@ public MachineLearningTrainingSettings() /// During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs are downloaded. /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// +<<<<<<< HEAD /// Flag to turn on explainability on best model. /// Enable recommendation of DNN models. /// Keeps track of any properties unknown to the library. internal MachineLearningTrainingSettings(bool? isOnnxCompatibleModelsEnabled, MachineLearningStackEnsembleSettings stackEnsembleSettings, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, bool? isModelExplainabilityEnabled, bool? isDnnTrainingEnabled, IDictionary serializedAdditionalRawData) +======= + /// Stack ensemble settings for stack ensemble run. + /// Keeps track of any properties unknown to the library. + internal MachineLearningTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { IsOnnxCompatibleModelsEnabled = isOnnxCompatibleModelsEnabled; StackEnsembleSettings = stackEnsembleSettings; IsStackEnsembleEnabled = isStackEnsembleEnabled; IsVoteEnsembleEnabled = isVoteEnsembleEnabled; EnsembleModelDownloadTimeout = ensembleModelDownloadTimeout; +<<<<<<< HEAD IsModelExplainabilityEnabled = isModelExplainabilityEnabled; IsDnnTrainingEnabled = isDnnTrainingEnabled; +======= + StackEnsembleSettings = stackEnsembleSettings; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,9 +97,14 @@ internal MachineLearningTrainingSettings(bool? isOnnxCompatibleModelsEnabled, Ma /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// public TimeSpan? EnsembleModelDownloadTimeout { get; set; } +<<<<<<< HEAD /// Flag to turn on explainability on best model. public bool? IsModelExplainabilityEnabled { get; set; } /// Enable recommendation of DNN models. public bool? IsDnnTrainingEnabled { get; set; } +======= + /// Stack ensemble settings for stack ensemble run. + public MachineLearningStackEnsembleSettings StackEnsembleSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs index ad7a7cc62747..948309a96a9a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTrialComponent.cs @@ -92,6 +92,15 @@ internal MachineLearningTrialComponent() public ResourceIdentifier CodeId { get; set; } /// [Required] The command to execute on startup of the job. eg. "python train.py". public string Command { get; set; } +<<<<<<< HEAD +======= + /// + /// Distribution configuration of the job. If set, this should be one of Mpi, Tensorflow, PyTorch, or null. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public MachineLearningDistributionConfiguration Distribution { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] The ARM resource ID of the Environment specification for the job. public ResourceIdentifier EnvironmentId { get; set; } /// Environment variables included in the job. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerBase.cs index 129ddd07ff45..f8bb78362532 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTriggerBase.cs @@ -66,7 +66,11 @@ protected MachineLearningTriggerBase() /// TimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 /// /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal MachineLearningTriggerBase(TriggerType triggerType, string endTime, string startTime, string timeZone, IDictionary serializedAdditionalRawData) +======= + internal MachineLearningTriggerBase(string endTime, string startTime, string timeZone, TriggerType triggerType, IDictionary serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { TriggerType = triggerType; EndTime = endTime; @@ -90,5 +94,10 @@ internal MachineLearningTriggerBase(TriggerType triggerType, string endTime, str /// TimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 /// public string TimeZone { get; set; } +<<<<<<< HEAD +======= + /// [Required]. + internal TriggerType TriggerType { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs index 529b324bc426..b3d24ad631b8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.Serialization.cs @@ -26,6 +26,14 @@ void IJsonModel.Write(Utf8JsonWriter writer } writer.WriteStartObject(); +<<<<<<< HEAD +======= + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Uri)) { if (Uri != null) @@ -95,6 +103,10 @@ internal static MachineLearningTritonModelJobOutput DeserializeMachineLearningTr { return null; } +<<<<<<< HEAD +======= + MachineLearningOutputDeliveryMode? mode = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri uri = default; MachineLearningOutputDeliveryMode? mode = default; JobOutputType jobOutputType = default; @@ -103,6 +115,7 @@ internal static MachineLearningTritonModelJobOutput DeserializeMachineLearningTr Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("uri"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -113,6 +126,8 @@ internal static MachineLearningTritonModelJobOutput DeserializeMachineLearningTr uri = new Uri(property.Value.GetString()); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -143,7 +158,11 @@ internal static MachineLearningTritonModelJobOutput DeserializeMachineLearningTr } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new MachineLearningTritonModelJobOutput(jobOutputType, description, serializedAdditionalRawData, uri, mode); +======= + return new MachineLearningTritonModelJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs index 337796468d86..3770fb0806dc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningTritonModelJobOutput.cs @@ -23,15 +23,28 @@ public MachineLearningTritonModelJobOutput() /// [Required] Specifies the type of job. /// Description for the output. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Output Asset URI. /// Output Asset Delivery Mode. internal MachineLearningTritonModelJobOutput(JobOutputType jobOutputType, string description, IDictionary serializedAdditionalRawData, Uri uri, MachineLearningOutputDeliveryMode? mode) : base(jobOutputType, description, serializedAdditionalRawData) { +======= + /// Output Asset Delivery Mode. + /// Output Asset URI. + internal MachineLearningTritonModelJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + { + Mode = mode; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri = uri; Mode = mode; JobOutputType = jobOutputType; } +<<<<<<< HEAD +======= + /// Output Asset Delivery Mode. + public MachineLearningOutputDeliveryMode? Mode { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Output Asset URI. public Uri Uri { get; set; } /// Output Asset Delivery Mode. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs index 1fa8efbb9b20..07e2412f3950 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.Serialization.cs @@ -30,11 +30,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); +<<<<<<< HEAD if (Optional.IsDefined(IsArchived)) { writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -128,6 +131,10 @@ internal static MachineLearningUriFileDataVersion DeserializeMachineLearningUriF } MachineLearningDataType dataType = default; Uri dataUri = default; +<<<<<<< HEAD +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -147,6 +154,7 @@ internal static MachineLearningUriFileDataVersion DeserializeMachineLearningUriF dataUri = new Uri(property.Value.GetString()); continue; } +<<<<<<< HEAD if (property.NameEquals("isArchived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -156,6 +164,8 @@ internal static MachineLearningUriFileDataVersion DeserializeMachineLearningUriF isArchived = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -216,6 +226,10 @@ internal static MachineLearningUriFileDataVersion DeserializeMachineLearningUriF tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + isAnonymous, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 isArchived, isAnonymous, dataType, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs index fa06dd7ae33d..3f0d175d3e14 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileDataVersion.cs @@ -28,11 +28,19 @@ public MachineLearningUriFileDataVersion(Uri dataUri) : base(dataUri) /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. internal MachineLearningUriFileDataVersion(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, MachineLearningDataType dataType, Uri dataUri) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous, dataType, dataUri) +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + /// [Required] Specifies the type of data. + /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. + internal MachineLearningUriFileDataVersion(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { DataType = dataType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs index 8ec62a10e6db..3baee90145f8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.Serialization.cs @@ -26,6 +26,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); +<<<<<<< HEAD +======= + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Uri)) { if (Uri != null) @@ -95,6 +103,10 @@ internal static MachineLearningUriFileJobOutput DeserializeMachineLearningUriFil { return null; } +<<<<<<< HEAD +======= + MachineLearningOutputDeliveryMode? mode = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri uri = default; MachineLearningOutputDeliveryMode? mode = default; JobOutputType jobOutputType = default; @@ -103,6 +115,7 @@ internal static MachineLearningUriFileJobOutput DeserializeMachineLearningUriFil Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("uri"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -113,6 +126,8 @@ internal static MachineLearningUriFileJobOutput DeserializeMachineLearningUriFil uri = new Uri(property.Value.GetString()); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -143,7 +158,11 @@ internal static MachineLearningUriFileJobOutput DeserializeMachineLearningUriFil } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new MachineLearningUriFileJobOutput(jobOutputType, description, serializedAdditionalRawData, uri, mode); +======= + return new MachineLearningUriFileJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs index 7c49f38f3fd3..9c00cad1c6f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFileJobOutput.cs @@ -23,15 +23,28 @@ public MachineLearningUriFileJobOutput() /// [Required] Specifies the type of job. /// Description for the output. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Output Asset URI. /// Output Asset Delivery Mode. internal MachineLearningUriFileJobOutput(JobOutputType jobOutputType, string description, IDictionary serializedAdditionalRawData, Uri uri, MachineLearningOutputDeliveryMode? mode) : base(jobOutputType, description, serializedAdditionalRawData) { +======= + /// Output Asset Delivery Mode. + /// Output Asset URI. + internal MachineLearningUriFileJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + { + Mode = mode; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri = uri; Mode = mode; JobOutputType = jobOutputType; } +<<<<<<< HEAD +======= + /// Output Asset Delivery Mode. + public MachineLearningOutputDeliveryMode? Mode { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Output Asset URI. public Uri Uri { get; set; } /// Output Asset Delivery Mode. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs index 87f5d2173823..8c7ee8b30d1e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.Serialization.cs @@ -30,11 +30,14 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); +<<<<<<< HEAD if (Optional.IsDefined(IsArchived)) { writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -128,6 +131,10 @@ internal static MachineLearningUriFolderDataVersion DeserializeMachineLearningUr } MachineLearningDataType dataType = default; Uri dataUri = default; +<<<<<<< HEAD +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -147,6 +154,7 @@ internal static MachineLearningUriFolderDataVersion DeserializeMachineLearningUr dataUri = new Uri(property.Value.GetString()); continue; } +<<<<<<< HEAD if (property.NameEquals("isArchived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -156,6 +164,8 @@ internal static MachineLearningUriFolderDataVersion DeserializeMachineLearningUr isArchived = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -216,6 +226,10 @@ internal static MachineLearningUriFolderDataVersion DeserializeMachineLearningUr tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + isAnonymous, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 isArchived, isAnonymous, dataType, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs index 9f5e828a6ca4..2f9b9477801e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderDataVersion.cs @@ -28,11 +28,19 @@ public MachineLearningUriFolderDataVersion(Uri dataUri) : base(dataUri) /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. internal MachineLearningUriFolderDataVersion(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, MachineLearningDataType dataType, Uri dataUri) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous, dataType, dataUri) +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + /// [Required] Specifies the type of data. + /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. + internal MachineLearningUriFolderDataVersion(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { DataType = dataType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs index d7cd73834cf1..20b033d2ab13 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.Serialization.cs @@ -26,6 +26,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); +<<<<<<< HEAD +======= + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Uri)) { if (Uri != null) @@ -95,6 +103,10 @@ internal static MachineLearningUriFolderJobOutput DeserializeMachineLearningUriF { return null; } +<<<<<<< HEAD +======= + MachineLearningOutputDeliveryMode? mode = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri uri = default; MachineLearningOutputDeliveryMode? mode = default; JobOutputType jobOutputType = default; @@ -103,6 +115,7 @@ internal static MachineLearningUriFolderJobOutput DeserializeMachineLearningUriF Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("uri"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -113,6 +126,8 @@ internal static MachineLearningUriFolderJobOutput DeserializeMachineLearningUriF uri = new Uri(property.Value.GetString()); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("mode"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -143,7 +158,11 @@ internal static MachineLearningUriFolderJobOutput DeserializeMachineLearningUriF } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new MachineLearningUriFolderJobOutput(jobOutputType, description, serializedAdditionalRawData, uri, mode); +======= + return new MachineLearningUriFolderJobOutput(description, jobOutputType, serializedAdditionalRawData, mode, uri); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs index 36728d5059f9..f1031b8b8fc9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUriFolderJobOutput.cs @@ -23,15 +23,28 @@ public MachineLearningUriFolderJobOutput() /// [Required] Specifies the type of job. /// Description for the output. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Output Asset URI. /// Output Asset Delivery Mode. internal MachineLearningUriFolderJobOutput(JobOutputType jobOutputType, string description, IDictionary serializedAdditionalRawData, Uri uri, MachineLearningOutputDeliveryMode? mode) : base(jobOutputType, description, serializedAdditionalRawData) { +======= + /// Output Asset Delivery Mode. + /// Output Asset URI. + internal MachineLearningUriFolderJobOutput(string description, JobOutputType jobOutputType, IDictionary serializedAdditionalRawData, MachineLearningOutputDeliveryMode? mode, Uri uri) : base(description, jobOutputType, serializedAdditionalRawData) + { + Mode = mode; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Uri = uri; Mode = mode; JobOutputType = jobOutputType; } +<<<<<<< HEAD +======= + /// Output Asset Delivery Mode. + public MachineLearningOutputDeliveryMode? Mode { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Output Asset URI. public Uri Uri { get; set; } /// Output Asset Delivery Mode. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs index 378f33f0e4bd..eaf037d2d252 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.Serialization.cs @@ -43,12 +43,21 @@ void IJsonModel.Writ writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -57,12 +66,54 @@ void IJsonModel.Writ { writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); +======= + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -93,6 +144,12 @@ void IJsonModel.Writ { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -136,6 +193,7 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -144,6 +202,18 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -180,6 +250,14 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,11 +285,14 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -224,6 +305,41 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser dictionary.Add(property0.Name, property0.Value.GetString()); } metadata = dictionary; +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("sharedUserList"u8)) @@ -254,6 +370,15 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser valueFormat = new MachineLearningValueFormat(property.Value.GetString()); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -264,6 +389,7 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -272,6 +398,18 @@ internal static MachineLearningUsernamePasswordAuthTypeWorkspaceConnection Deser sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs index c849d7a415ad..34065726194f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningUsernamePasswordAuthTypeWorkspaceConnection.cs @@ -24,6 +24,7 @@ public MachineLearningUsernamePasswordAuthTypeWorkspaceConnection() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -35,6 +36,21 @@ public MachineLearningUsernamePasswordAuthTypeWorkspaceConnection() /// Keeps track of any properties unknown to the library. /// internal MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionUsernamePassword credentials) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal MachineLearningUsernamePasswordAuthTypeWorkspaceConnection(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, MachineLearningWorkspaceConnectionUsernamePassword credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs new file mode 100644 index 000000000000..a3b3d1abed5b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionPatch.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The properties that the machine learning workspace connection will be updated with. + public partial class MachineLearningWorkspaceConnectionPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MachineLearningWorkspaceConnectionPatch() + { + } + + /// Initializes a new instance of . + /// + /// The properties that the machine learning workspace connection will be updated with. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , and . + /// + /// Keeps track of any properties unknown to the library. + internal MachineLearningWorkspaceConnectionPatch(MachineLearningWorkspaceConnectionProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The properties that the machine learning workspace connection will be updated with. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , and . + /// + public MachineLearningWorkspaceConnectionProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs index ac6524c817d8..9b79cc5228f2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.Serialization.cs @@ -38,12 +38,30 @@ void IJsonModel.Write(Utf8JsonWrit writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); +======= { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -53,11 +71,44 @@ void IJsonModel.Write(Utf8JsonWrit writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 + } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -88,6 +139,12 @@ void IJsonModel.Write(Utf8JsonWrit { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs index fe363c800b3b..d8fa3ade60ae 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionProperties.cs @@ -60,6 +60,7 @@ protected MachineLearningWorkspaceConnectionProperties() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -70,10 +71,25 @@ protected MachineLearningWorkspaceConnectionProperties() /// format for the workspace connection value. /// Keeps track of any properties unknown to the library. internal MachineLearningWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal MachineLearningWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { AuthType = authType; Category = category; CreatedByWorkspaceArmId = createdByWorkspaceArmId; +<<<<<<< HEAD ExpiryOn = expiryOn; Group = group; IsSharedToAll = isSharedToAll; @@ -82,6 +98,18 @@ internal MachineLearningWorkspaceConnectionProperties(MachineLearningConnectionA SharedUserList = sharedUserList; Value = value; ValueFormat = valueFormat; +======= + Error = error; + ExpiryOn = expiryOn; + Group = group; + IsSharedToAll = isSharedToAll; + Metadata = metadata; + PeRequirement = peRequirement; + PeStatus = peStatus; + SharedUserList = sharedUserList; + Target = target; + UseWorkspaceManagedIdentity = useWorkspaceManagedIdentity; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -91,17 +119,37 @@ internal MachineLearningWorkspaceConnectionProperties(MachineLearningConnectionA public MachineLearningConnectionCategory? Category { get; set; } /// Gets the created by workspace arm id. public ResourceIdentifier CreatedByWorkspaceArmId { get; } +<<<<<<< HEAD +======= + /// Gets or sets the error. + public string Error { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Gets or sets the expiry on. public DateTimeOffset? ExpiryOn { get; set; } /// Group based on connection category. public ConnectionGroup? Group { get; } /// Gets or sets the is shared to all. public bool? IsSharedToAll { get; set; } +<<<<<<< HEAD /// Gets or sets the target. public string Target { get; set; } /// Store user metadata for this connection. public IDictionary Metadata { get; } /// Gets the shared user list. public IList SharedUserList { get; } +======= + /// Store user metadata for this connection. + public IDictionary Metadata { get; } + /// Gets or sets the pe requirement. + public ManagedPERequirement? PeRequirement { get; set; } + /// Gets or sets the pe status. + public ManagedPEStatus? PeStatus { get; set; } + /// Gets the shared user list. + public IList SharedUserList { get; } + /// Gets or sets the target. + public string Target { get; set; } + /// Gets or sets the use workspace managed identity. + public bool? UseWorkspaceManagedIdentity { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs index 935e6ec4f9e4..dea724c55eee 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.Serialization.cs @@ -37,6 +37,14 @@ void IJsonModel.Write(Utf8Js writer.WriteStringValue(Password); } if (Optional.IsDefined(SecurityToken)) +<<<<<<< HEAD +======= + { + writer.WritePropertyName("securityToken"u8); + writer.WriteStringValue(SecurityToken); + } + if (Optional.IsDefined(Username)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { writer.WritePropertyName("securityToken"u8); writer.WriteStringValue(SecurityToken); @@ -79,6 +87,11 @@ internal static MachineLearningWorkspaceConnectionUsernamePassword DeserializeMa { return null; } +<<<<<<< HEAD +======= + string password = default; + string securityToken = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 string username = default; string password = default; string securityToken = default; @@ -97,6 +110,14 @@ internal static MachineLearningWorkspaceConnectionUsernamePassword DeserializeMa continue; } if (property.NameEquals("securityToken"u8)) +<<<<<<< HEAD +======= + { + securityToken = property.Value.GetString(); + continue; + } + if (property.NameEquals("username"u8)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { securityToken = property.Value.GetString(); continue; @@ -107,7 +128,11 @@ internal static MachineLearningWorkspaceConnectionUsernamePassword DeserializeMa } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new MachineLearningWorkspaceConnectionUsernamePassword(username, password, securityToken, serializedAdditionalRawData); +======= + return new MachineLearningWorkspaceConnectionUsernamePassword(password, securityToken, username, serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs index 880be737c088..704e7b5c00c3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceConnectionUsernamePassword.cs @@ -51,18 +51,37 @@ public MachineLearningWorkspaceConnectionUsernamePassword() } /// Initializes a new instance of . +<<<<<<< HEAD +======= + /// + /// Optional, required by connections like SalesForce for extra security in addition to UsernamePassword. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Optional, required by connections like SalesForce for extra security in addition to UsernamePassword. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal MachineLearningWorkspaceConnectionUsernamePassword(string username, string password, string securityToken, IDictionary serializedAdditionalRawData) { +======= + internal MachineLearningWorkspaceConnectionUsernamePassword(string password, string securityToken, string username, IDictionary serializedAdditionalRawData) + { + Password = password; + SecurityToken = securityToken; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Username = username; Password = password; SecurityToken = securityToken; _serializedAdditionalRawData = serializedAdditionalRawData; } +<<<<<<< HEAD +======= + /// Gets or sets the password. + public string Password { get; set; } + /// Optional, required by connections like SalesForce for extra security in addition to UsernamePassword. + public string SecurityToken { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Gets or sets the username. public string Username { get; set; } /// Gets or sets the password. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs index cbc312fd6f03..e9137a579b22 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.Serialization.cs @@ -95,7 +95,34 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteEndObject(); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(DnsResolution)) +======= + if (Optional.IsCollectionDefined(RequiredResourceProviders)) + { + writer.WritePropertyName("requiredResourceProviders"u8); + writer.WriteStartObject(); + foreach (var item in RequiredResourceProviders) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(ResourceLock)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { writer.WritePropertyName("dnsResolution"u8); writer.WriteStartObject(); @@ -271,6 +298,18 @@ internal static MachineLearningWorkspaceDiagnoseProperties DeserializeMachineLea { return null; } +<<<<<<< HEAD +======= + IDictionary applicationInsights = default; + IDictionary containerRegistry = default; + IDictionary dnsResolution = default; + IDictionary keyVault = default; + IDictionary nsg = default; + IDictionary others = default; + IDictionary requiredResourceProviders = default; + IDictionary resourceLock = default; + IDictionary storageAccount = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary udr = default; IDictionary nsg = default; IDictionary resourceLock = default; @@ -326,6 +365,51 @@ internal static MachineLearningWorkspaceDiagnoseProperties DeserializeMachineLea nsg = dictionary; continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("others"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + others = dictionary; + continue; + } + if (property.NameEquals("requiredResourceProviders"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + requiredResourceProviders = dictionary; + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("resourceLock"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -480,6 +564,18 @@ internal static MachineLearningWorkspaceDiagnoseProperties DeserializeMachineLea } serializedAdditionalRawData = rawDataDictionary; return new MachineLearningWorkspaceDiagnoseProperties( +<<<<<<< HEAD +======= + applicationInsights ?? new ChangeTrackingDictionary(), + containerRegistry ?? new ChangeTrackingDictionary(), + dnsResolution ?? new ChangeTrackingDictionary(), + keyVault ?? new ChangeTrackingDictionary(), + nsg ?? new ChangeTrackingDictionary(), + others ?? new ChangeTrackingDictionary(), + requiredResourceProviders ?? new ChangeTrackingDictionary(), + resourceLock ?? new ChangeTrackingDictionary(), + storageAccount ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 udr ?? new ChangeTrackingDictionary(), nsg ?? new ChangeTrackingDictionary(), resourceLock ?? new ChangeTrackingDictionary(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs index 68158d5bab6e..e43dc1f35c97 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspaceDiagnoseProperties.cs @@ -48,6 +48,18 @@ public partial class MachineLearningWorkspaceDiagnoseProperties /// Initializes a new instance of . public MachineLearningWorkspaceDiagnoseProperties() { +<<<<<<< HEAD +======= + ApplicationInsights = new ChangeTrackingDictionary(); + ContainerRegistry = new ChangeTrackingDictionary(); + DnsResolution = new ChangeTrackingDictionary(); + KeyVault = new ChangeTrackingDictionary(); + Nsg = new ChangeTrackingDictionary(); + Others = new ChangeTrackingDictionary(); + RequiredResourceProviders = new ChangeTrackingDictionary(); + ResourceLock = new ChangeTrackingDictionary(); + StorageAccount = new ChangeTrackingDictionary(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Udr = new ChangeTrackingDictionary(); Nsg = new ChangeTrackingDictionary(); ResourceLock = new ChangeTrackingDictionary(); @@ -60,6 +72,18 @@ public MachineLearningWorkspaceDiagnoseProperties() } /// Initializes a new instance of . +<<<<<<< HEAD +======= + /// Setting for diagnosing dependent application insights. + /// Setting for diagnosing dependent container registry. + /// Setting for diagnosing dns resolution. + /// Setting for diagnosing dependent key vault. + /// Setting for diagnosing network security group. + /// Setting for diagnosing unclassified category of problems. + /// Setting for diagnosing the presence of required resource providers in the workspace. + /// Setting for diagnosing resource lock. + /// Setting for diagnosing dependent storage account. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Setting for diagnosing user defined routing. /// Setting for diagnosing network security group. /// Setting for diagnosing resource lock. @@ -70,8 +94,22 @@ public MachineLearningWorkspaceDiagnoseProperties() /// Setting for diagnosing dependent application insights. /// Setting for diagnosing unclassified category of problems. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal MachineLearningWorkspaceDiagnoseProperties(IDictionary udr, IDictionary nsg, IDictionary resourceLock, IDictionary dnsResolution, IDictionary storageAccount, IDictionary keyVault, IDictionary containerRegistry, IDictionary applicationInsights, IDictionary others, IDictionary serializedAdditionalRawData) { +======= + internal MachineLearningWorkspaceDiagnoseProperties(IDictionary applicationInsights, IDictionary containerRegistry, IDictionary dnsResolution, IDictionary keyVault, IDictionary nsg, IDictionary others, IDictionary requiredResourceProviders, IDictionary resourceLock, IDictionary storageAccount, IDictionary udr, IDictionary serializedAdditionalRawData) + { + ApplicationInsights = applicationInsights; + ContainerRegistry = containerRegistry; + DnsResolution = dnsResolution; + KeyVault = keyVault; + Nsg = nsg; + Others = others; + RequiredResourceProviders = requiredResourceProviders; + ResourceLock = resourceLock; + StorageAccount = storageAccount; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Udr = udr; Nsg = nsg; ResourceLock = resourceLock; @@ -147,6 +185,71 @@ internal MachineLearningWorkspaceDiagnoseProperties(IDictionary public IDictionary Nsg { get; } /// +<<<<<<< HEAD +======= + /// Setting for diagnosing unclassified category of problems + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary Others { get; } + /// + /// Setting for diagnosing the presence of required resource providers in the workspace. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary RequiredResourceProviders { get; } + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Setting for diagnosing resource lock /// /// To assign an object to the value of this property use . diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs index 8d1a4c6b9fc4..2a2922bf29ff 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.Serialization.cs @@ -51,11 +51,52 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); +<<<<<<< HEAD +======= + if (Optional.IsDefined(AllowRoleAssignmentOnRG)) + { + writer.WritePropertyName("allowRoleAssignmentOnRG"u8); + writer.WriteBooleanValue(AllowRoleAssignmentOnRG.Value); + } + if (Optional.IsDefined(ApplicationInsights)) + { + writer.WritePropertyName("applicationInsights"u8); + writer.WriteStringValue(ApplicationInsights); + } + if (Optional.IsDefined(ContainerRegistry)) + { + writer.WritePropertyName("containerRegistry"u8); + writer.WriteStringValue(ContainerRegistry); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(EnableDataIsolation)) + { + writer.WritePropertyName("enableDataIsolation"u8); + writer.WriteBooleanValue(EnableDataIsolation.Value); + } + if (Optional.IsDefined(EnableSoftwareBillOfMaterials)) + { + writer.WritePropertyName("enableSoftwareBillOfMaterials"u8); + writer.WriteBooleanValue(EnableSoftwareBillOfMaterials.Value); + } + if (Optional.IsDefined(Encryption)) + { + writer.WritePropertyName("encryption"u8); + writer.WriteObjectValue(Encryption, options); + } + if (Optional.IsDefined(FeatureStoreSettings)) + { + writer.WritePropertyName("featureStoreSettings"u8); + writer.WriteObjectValue(FeatureStoreSettings, options); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(FriendlyName)) { writer.WritePropertyName("friendlyName"u8); @@ -66,7 +107,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("imageBuildCompute"u8); writer.WriteStringValue(ImageBuildCompute); } +<<<<<<< HEAD if (Optional.IsDefined(ServiceManagedResourcesSettings)) +======= + if (Optional.IsCollectionDefined(IPAllowlist)) + { + writer.WritePropertyName("ipAllowlist"u8); + writer.WriteStartArray(); + foreach (var item in IPAllowlist) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ManagedNetwork)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { writer.WritePropertyName("serviceManagedResourcesSettings"u8); writer.WriteObjectValue(ServiceManagedResourcesSettings, options); @@ -86,7 +141,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WritePropertyName("publicNetworkAccess"u8); writer.WriteStringValue(PublicNetworkAccessType.Value.ToString()); } +<<<<<<< HEAD if (Optional.IsDefined(ApplicationInsights)) +======= + if (Optional.IsDefined(ServerlessComputeSettings)) + { + writer.WritePropertyName("serverlessComputeSettings"u8); + writer.WriteObjectValue(ServerlessComputeSettings, options); + } + if (Optional.IsDefined(ServiceManagedResourcesSettings)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { writer.WritePropertyName("applicationInsights"u8); writer.WriteStringValue(ApplicationInsights); @@ -161,11 +225,29 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac return null; } IDictionary tags = default; +<<<<<<< HEAD MachineLearningSku sku = default; ManagedServiceIdentity identity = default; string description = default; string friendlyName = default; string imageBuildCompute = default; +======= + bool? allowRoleAssignmentOnRG = default; + string applicationInsights = default; + string containerRegistry = default; + string description = default; + bool? enableDataIsolation = default; + bool? enableSoftwareBillOfMaterials = default; + EncryptionUpdateProperties encryption = default; + FeatureStoreSettings featureStoreSettings = default; + string friendlyName = default; + string imageBuildCompute = default; + IList ipAllowlist = default; + ManagedNetworkSettings managedNetwork = default; + string primaryUserAssignedIdentity = default; + MachineLearningPublicNetworkAccessType? publicNetworkAccess = default; + ServerlessComputeSettings serverlessComputeSettings = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ServiceManagedResourcesSettings serviceManagedResourcesSettings = default; string primaryUserAssignedIdentity = default; ServerlessComputeSettings serverlessComputeSettings = default; @@ -223,11 +305,72 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac } foreach (var property0 in property.Value.EnumerateObject()) { +<<<<<<< HEAD +======= + if (property0.NameEquals("allowRoleAssignmentOnRG"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowRoleAssignmentOnRG = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("applicationInsights"u8)) + { + applicationInsights = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("containerRegistry"u8)) + { + containerRegistry = property0.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property0.NameEquals("description"u8)) { description = property0.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property0.NameEquals("enableDataIsolation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableDataIsolation = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("enableSoftwareBillOfMaterials"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableSoftwareBillOfMaterials = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("encryption"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryption = EncryptionUpdateProperties.DeserializeEncryptionUpdateProperties(property0.Value, options); + continue; + } + if (property0.NameEquals("featureStoreSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + featureStoreSettings = FeatureStoreSettings.DeserializeFeatureStoreSettings(property0.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property0.NameEquals("friendlyName"u8)) { friendlyName = property0.Value.GetString(); @@ -238,6 +381,55 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac imageBuildCompute = property0.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property0.NameEquals("ipAllowlist"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + ipAllowlist = array; + continue; + } + if (property0.NameEquals("managedNetwork"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedNetwork = ManagedNetworkSettings.DeserializeManagedNetworkSettings(property0.Value, options); + continue; + } + if (property0.NameEquals("primaryUserAssignedIdentity"u8)) + { + primaryUserAssignedIdentity = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("publicNetworkAccess"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + publicNetworkAccess = new MachineLearningPublicNetworkAccessType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("serverlessComputeSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverlessComputeSettings = ServerlessComputeSettings.DeserializeServerlessComputeSettings(property0.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property0.NameEquals("serviceManagedResourcesSettings"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -336,11 +528,29 @@ internal static MachineLearningWorkspacePatch DeserializeMachineLearningWorkspac serializedAdditionalRawData = rawDataDictionary; return new MachineLearningWorkspacePatch( tags ?? new ChangeTrackingDictionary(), +<<<<<<< HEAD sku, identity, description, friendlyName, imageBuildCompute, +======= + allowRoleAssignmentOnRG, + applicationInsights, + containerRegistry, + description, + enableDataIsolation, + enableSoftwareBillOfMaterials, + encryption, + featureStoreSettings, + friendlyName, + imageBuildCompute, + ipAllowlist ?? new ChangeTrackingList(), + managedNetwork, + primaryUserAssignedIdentity, + publicNetworkAccess, + serverlessComputeSettings, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serviceManagedResourcesSettings, primaryUserAssignedIdentity, serverlessComputeSettings, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs index 4bf0f677cb40..973469afaa4b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MachineLearningWorkspacePatch.cs @@ -50,10 +50,12 @@ public partial class MachineLearningWorkspacePatch public MachineLearningWorkspacePatch() { Tags = new ChangeTrackingDictionary(); + IPAllowlist = new ChangeTrackingList(); } /// Initializes a new instance of . /// The resource tags for the machine learning workspace. +<<<<<<< HEAD /// The sku of the workspace. /// The identity of the resource. /// The description of this workspace. @@ -68,17 +70,58 @@ public MachineLearningWorkspacePatch() /// Settings for feature store type workspace. /// Managed Network settings for a machine learning workspace. /// +======= + /// + /// ARM id of the application insights associated with this workspace. + /// ARM id of the container registry associated with this workspace. + /// The description of this workspace. + /// + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. + /// + /// Settings for feature store type workspace. + /// The friendly name for this workspace. This name in mutable. + /// The compute name for image build. + /// The list of IPv4 addresses that are allowed to access the workspace. + /// Managed Network settings for a machine learning workspace. + /// The user assigned identity resource id that represents the workspace identity. + /// Whether requests from Public Network are allowed. + /// Settings for serverless compute in a workspace. + /// The service managed resource settings. + /// Retention time in days after workspace get soft deleted. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Enabling v1_legacy_mode may prevent you from using features provided by the v2 API. /// /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal MachineLearningWorkspacePatch(IDictionary tags, MachineLearningSku sku, ManagedServiceIdentity identity, string description, string friendlyName, string imageBuildCompute, ServiceManagedResourcesSettings serviceManagedResourcesSettings, string primaryUserAssignedIdentity, ServerlessComputeSettings serverlessComputeSettings, PublicNetworkAccess? publicNetworkAccessType, string applicationInsights, string containerRegistry, FeatureStoreSettings featureStoreSettings, ManagedNetworkSettings managedNetwork, bool? enableDataIsolation, bool? v1LegacyMode, EncryptionUpdateProperties encryption, IDictionary serializedAdditionalRawData) +======= + internal MachineLearningWorkspacePatch(ManagedServiceIdentity identity, MachineLearningSku sku, IDictionary tags, bool? allowRoleAssignmentOnRG, string applicationInsights, string containerRegistry, string description, bool? enableDataIsolation, bool? enableSoftwareBillOfMaterials, EncryptionUpdateProperties encryption, FeatureStoreSettings featureStoreSettings, string friendlyName, string imageBuildCompute, IList ipAllowlist, ManagedNetworkSettings managedNetwork, string primaryUserAssignedIdentity, MachineLearningPublicNetworkAccessType? publicNetworkAccessType, ServerlessComputeSettings serverlessComputeSettings, ServiceManagedResourcesSettings serviceManagedResourcesSettings, int? softDeleteRetentionInDays, bool? v1LegacyMode, IDictionary serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Tags = tags; +<<<<<<< HEAD Sku = sku; Identity = identity; Description = description; FriendlyName = friendlyName; ImageBuildCompute = imageBuildCompute; +======= + AllowRoleAssignmentOnRG = allowRoleAssignmentOnRG; + ApplicationInsights = applicationInsights; + ContainerRegistry = containerRegistry; + Description = description; + EnableDataIsolation = enableDataIsolation; + EnableSoftwareBillOfMaterials = enableSoftwareBillOfMaterials; + Encryption = encryption; + FeatureStoreSettings = featureStoreSettings; + FriendlyName = friendlyName; + ImageBuildCompute = imageBuildCompute; + IPAllowlist = ipAllowlist; + ManagedNetwork = managedNetwork; + PrimaryUserAssignedIdentity = primaryUserAssignedIdentity; + PublicNetworkAccessType = publicNetworkAccessType; + ServerlessComputeSettings = serverlessComputeSettings; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ServiceManagedResourcesSettings = serviceManagedResourcesSettings; PrimaryUserAssignedIdentity = primaryUserAssignedIdentity; ServerlessComputeSettings = serverlessComputeSettings; @@ -95,6 +138,7 @@ internal MachineLearningWorkspacePatch(IDictionary tags, Machine /// The resource tags for the machine learning workspace. public IDictionary Tags { get; } +<<<<<<< HEAD /// The sku of the workspace. public MachineLearningSku Sku { get; set; } /// The identity of the resource. @@ -105,6 +149,45 @@ internal MachineLearningWorkspacePatch(IDictionary tags, Machine public string FriendlyName { get; set; } /// The compute name for image build. public string ImageBuildCompute { get; set; } +======= + /// Gets or sets the allow role assignment on rg. + public bool? AllowRoleAssignmentOnRG { get; set; } + /// ARM id of the application insights associated with this workspace. + public string ApplicationInsights { get; set; } + /// ARM id of the container registry associated with this workspace. + public string ContainerRegistry { get; set; } + /// The description of this workspace. + public string Description { get; set; } + /// Gets or sets the enable data isolation. + public bool? EnableDataIsolation { get; set; } + /// Flag to tell if SoftwareBillOfMaterials should be enabled for this workspace. + public bool? EnableSoftwareBillOfMaterials { get; set; } + /// Gets or sets the encryption. + internal EncryptionUpdateProperties Encryption { get; set; } + /// Gets or sets the key identifier. + public string KeyIdentifier + { + get => Encryption is null ? default : Encryption.KeyIdentifier; + set => Encryption = new EncryptionUpdateProperties(value); + } + + /// Settings for feature store type workspace. + public FeatureStoreSettings FeatureStoreSettings { get; set; } + /// The friendly name for this workspace. This name in mutable. + public string FriendlyName { get; set; } + /// The compute name for image build. + public string ImageBuildCompute { get; set; } + /// The list of IPv4 addresses that are allowed to access the workspace. + public IList IPAllowlist { get; } + /// Managed Network settings for a machine learning workspace. + public ManagedNetworkSettings ManagedNetwork { get; set; } + /// The user assigned identity resource id that represents the workspace identity. + public string PrimaryUserAssignedIdentity { get; set; } + /// Whether requests from Public Network are allowed. + public MachineLearningPublicNetworkAccessType? PublicNetworkAccessType { get; set; } + /// Settings for serverless compute in a workspace. + public ServerlessComputeSettings ServerlessComputeSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The service managed resource settings. internal ServiceManagedResourcesSettings ServiceManagedResourcesSettings { get; set; } /// The throughput of the collections in cosmosdb database. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs index f24b7039c644..75eba1f4c797 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.Serialization.cs @@ -38,6 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteNull("managedIdentityType"); } } +<<<<<<< HEAD if (Optional.IsDefined(UserManagedIdentityResourceId)) { if (UserManagedIdentityResourceId != null) @@ -50,6 +51,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteNull("userManagedIdentityResourceId"); } } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(UserManagedIdentityClientId)) { if (UserManagedIdentityClientId != null) @@ -74,6 +77,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteNull("userManagedIdentityPrincipalId"); } } +<<<<<<< HEAD +======= + if (Optional.IsDefined(UserManagedIdentityResourceId)) + { + if (UserManagedIdentityResourceId != null) + { + writer.WritePropertyName("userManagedIdentityResourceId"u8); + writer.WriteStringValue(UserManagedIdentityResourceId); + } + else + { + writer.WriteNull("userManagedIdentityResourceId"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(UserManagedIdentityTenantId)) { if (UserManagedIdentityTenantId != null) @@ -127,9 +145,15 @@ internal static ManagedIdentityCredential DeserializeManagedIdentityCredential(J return null; } string managedIdentityType = default; +<<<<<<< HEAD string userManagedIdentityResourceId = default; string userManagedIdentityClientId = default; string userManagedIdentityPrincipalId = default; +======= + string userManagedIdentityClientId = default; + string userManagedIdentityPrincipalId = default; + string userManagedIdentityResourceId = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 string userManagedIdentityTenantId = default; DataReferenceCredentialType credentialType = default; IDictionary serializedAdditionalRawData = default; @@ -146,6 +170,7 @@ internal static ManagedIdentityCredential DeserializeManagedIdentityCredential(J managedIdentityType = property.Value.GetString(); continue; } +<<<<<<< HEAD if (property.NameEquals("userManagedIdentityResourceId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -156,6 +181,8 @@ internal static ManagedIdentityCredential DeserializeManagedIdentityCredential(J userManagedIdentityResourceId = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("userManagedIdentityClientId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -176,6 +203,19 @@ internal static ManagedIdentityCredential DeserializeManagedIdentityCredential(J userManagedIdentityPrincipalId = property.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("userManagedIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + userManagedIdentityResourceId = null; + continue; + } + userManagedIdentityResourceId = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("userManagedIdentityTenantId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -201,9 +241,15 @@ internal static ManagedIdentityCredential DeserializeManagedIdentityCredential(J credentialType, serializedAdditionalRawData, managedIdentityType, +<<<<<<< HEAD userManagedIdentityResourceId, userManagedIdentityClientId, userManagedIdentityPrincipalId, +======= + userManagedIdentityClientId, + userManagedIdentityPrincipalId, + userManagedIdentityResourceId, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 userManagedIdentityTenantId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs index 39807455c741..322678914548 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedIdentityCredential.cs @@ -23,6 +23,7 @@ internal ManagedIdentityCredential() /// [Required] Credential type used to authentication with storage. /// Keeps track of any properties unknown to the library. /// ManagedIdentityCredential identity type. +<<<<<<< HEAD /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. /// ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. /// PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. @@ -33,18 +34,38 @@ internal ManagedIdentityCredential(DataReferenceCredentialType credentialType, I UserManagedIdentityResourceId = userManagedIdentityResourceId; UserManagedIdentityClientId = userManagedIdentityClientId; UserManagedIdentityPrincipalId = userManagedIdentityPrincipalId; +======= + /// ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + /// TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. + internal ManagedIdentityCredential(DataReferenceCredentialType credentialType, IDictionary serializedAdditionalRawData, string managedIdentityType, string userManagedIdentityClientId, string userManagedIdentityPrincipalId, string userManagedIdentityResourceId, string userManagedIdentityTenantId) : base(credentialType, serializedAdditionalRawData) + { + ManagedIdentityType = managedIdentityType; + UserManagedIdentityClientId = userManagedIdentityClientId; + UserManagedIdentityPrincipalId = userManagedIdentityPrincipalId; + UserManagedIdentityResourceId = userManagedIdentityResourceId; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 UserManagedIdentityTenantId = userManagedIdentityTenantId; CredentialType = credentialType; } /// ManagedIdentityCredential identity type. public string ManagedIdentityType { get; } +<<<<<<< HEAD /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. public string UserManagedIdentityResourceId { get; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// ClientId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. public string UserManagedIdentityClientId { get; } /// PrincipalId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. public string UserManagedIdentityPrincipalId { get; } +<<<<<<< HEAD +======= + /// Full arm scope for the Id. For ManagedIdentityType = SystemManaged, this field is null. + public string UserManagedIdentityResourceId { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// TenantId for the UAMI. For ManagedIdentityType = SystemManaged, this field is null. public string UserManagedIdentityTenantId { get; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs index 5f6dbcba5900..2c63996e8dfd 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.Serialization.cs @@ -59,6 +59,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WritePropertyName("status"u8); writer.WriteObjectValue(Status, options); } + if (options.Format != "W" && Optional.IsCollectionDefined(ChangeableIsolationModes)) + { + writer.WritePropertyName("changeableIsolationModes"u8); + writer.WriteStartArray(); + foreach (var item in ChangeableIsolationModes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -101,6 +111,7 @@ internal static ManagedNetworkSettings DeserializeManagedNetworkSettings(JsonEle string networkId = default; IDictionary outboundRules = default; ManagedNetworkProvisionStatus status = default; + IReadOnlyList changeableIsolationModes = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -143,13 +154,33 @@ internal static ManagedNetworkSettings DeserializeManagedNetworkSettings(JsonEle status = ManagedNetworkProvisionStatus.DeserializeManagedNetworkProvisionStatus(property.Value, options); continue; } + if (property.NameEquals("changeableIsolationModes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new IsolationMode(item.GetString())); + } + changeableIsolationModes = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedNetworkSettings(isolationMode, networkId, outboundRules ?? new ChangeTrackingDictionary(), status, serializedAdditionalRawData); + return new ManagedNetworkSettings( + isolationMode, + networkId, + outboundRules ?? new ChangeTrackingDictionary(), + status, + changeableIsolationModes ?? new ChangeTrackingList(), + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs index 57c04e669be1..6a50509cb982 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedNetworkSettings.cs @@ -49,6 +49,7 @@ public partial class ManagedNetworkSettings public ManagedNetworkSettings() { OutboundRules = new ChangeTrackingDictionary(); + ChangeableIsolationModes = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -60,13 +61,15 @@ public ManagedNetworkSettings() /// The available derived classes include , and . /// /// Status of the Provisioning for the managed network of a machine learning workspace. + /// /// Keeps track of any properties unknown to the library. - internal ManagedNetworkSettings(IsolationMode? isolationMode, string networkId, IDictionary outboundRules, ManagedNetworkProvisionStatus status, IDictionary serializedAdditionalRawData) + internal ManagedNetworkSettings(IsolationMode? isolationMode, string networkId, IDictionary outboundRules, ManagedNetworkProvisionStatus status, IReadOnlyList changeableIsolationModes, IDictionary serializedAdditionalRawData) { IsolationMode = isolationMode; NetworkId = networkId; OutboundRules = outboundRules; Status = status; + ChangeableIsolationModes = changeableIsolationModes; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -82,5 +85,7 @@ internal ManagedNetworkSettings(IsolationMode? isolationMode, string networkId, public IDictionary OutboundRules { get; set; } /// Status of the Provisioning for the managed network of a machine learning workspace. public ManagedNetworkProvisionStatus Status { get; set; } + /// Gets the changeable isolation modes. + public IReadOnlyList ChangeableIsolationModes { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 000000000000..0618aa7bc1e4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ManagedOnlineEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(EndpointComputeType)) + { + writer.WritePropertyName("endpointComputeType"u8); + writer.WriteStringValue(EndpointComputeType.Value.ToString()); + } + if (Optional.IsDefined(Model)) + { + writer.WritePropertyName("model"u8); + writer.WriteStringValue(Model); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedOnlineEndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedOnlineEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static ManagedOnlineEndpointDeploymentResourceProperties DeserializeManagedOnlineEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MachineLearningEndpointComputeType? endpointComputeType = default; + string model = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpointComputeType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointComputeType = new MachineLearningEndpointComputeType(property.Value.GetString()); + continue; + } + if (property.NameEquals("model"u8)) + { + model = property.Value.GetString(); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedOnlineEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + endpointComputeType, + model); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ManagedOnlineEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedOnlineEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.cs new file mode 100644 index 000000000000..44f2699f74f9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointDeploymentResourceProperties.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedOnlineEndpointDeploymentResourceProperties. + public partial class ManagedOnlineEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + public ManagedOnlineEndpointDeploymentResourceProperties() + { + EndpointDeploymentResourcePropertiesType = "managedOnlineEndpoint"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Enum to determine endpoint compute type. + /// + internal ManagedOnlineEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, MachineLearningEndpointComputeType? endpointComputeType, string model) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + EndpointComputeType = endpointComputeType; + Model = model; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "managedOnlineEndpoint"; + } + + /// Enum to determine endpoint compute type. + public MachineLearningEndpointComputeType? EndpointComputeType { get; set; } + /// Gets or sets the model. + public string Model { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.Serialization.cs new file mode 100644 index 000000000000..630b2660c608 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.Serialization.cs @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ManagedOnlineEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AuthMode)) + { + writer.WritePropertyName("authMode"u8); + writer.WriteStringValue(AuthMode.Value.ToString()); + } + if (Optional.IsDefined(Compute)) + { + writer.WritePropertyName("compute"u8); + writer.WriteStringValue(Compute); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsCollectionDefined(MirrorTraffic)) + { + writer.WritePropertyName("mirrorTraffic"u8); + writer.WriteStartObject(); + foreach (var item in MirrorTraffic) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(ScoringUri)) + { + writer.WritePropertyName("scoringUri"u8); + writer.WriteStringValue(ScoringUri.AbsoluteUri); + } + if (Optional.IsCollectionDefined(Traffic)) + { + writer.WritePropertyName("traffic"u8); + writer.WriteStartObject(); + foreach (var item in Traffic) + { + writer.WritePropertyName(item.Key); + writer.WriteNumberValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedOnlineEndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedOnlineEndpointResourceProperties(document.RootElement, options); + } + + internal static ManagedOnlineEndpointResourceProperties DeserializeManagedOnlineEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MachineLearningEndpointAuthMode? authMode = default; + string compute = default; + string description = default; + IDictionary mirrorTraffic = default; + Uri scoringUri = default; + IDictionary traffic = default; + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new MachineLearningEndpointAuthMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("compute"u8)) + { + compute = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("mirrorTraffic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetInt32()); + } + mirrorTraffic = dictionary; + continue; + } + if (property.NameEquals("scoringUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scoringUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("traffic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetInt32()); + } + traffic = dictionary; + continue; + } + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedOnlineEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData, + authMode, + compute, + description, + mirrorTraffic ?? new ChangeTrackingDictionary(), + scoringUri, + traffic ?? new ChangeTrackingDictionary()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ManagedOnlineEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedOnlineEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedOnlineEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.cs new file mode 100644 index 000000000000..c88617aa3005 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedOnlineEndpointResourceProperties.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedOnlineEndpointResourceProperties. + public partial class ManagedOnlineEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public ManagedOnlineEndpointResourceProperties() + { + MirrorTraffic = new ChangeTrackingDictionary(); + Traffic = new ChangeTrackingDictionary(); + EndpointType = EndpointType.ManagedOnlineEndpoint; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + /// Enum to determine endpoint authentication mode. + /// + /// + /// Dictionary of <integer>. + /// + /// Dictionary of <integer>. + internal ManagedOnlineEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData, MachineLearningEndpointAuthMode? authMode, string compute, string description, IDictionary mirrorTraffic, Uri scoringUri, IDictionary traffic) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + AuthMode = authMode; + Compute = compute; + Description = description; + MirrorTraffic = mirrorTraffic; + ScoringUri = scoringUri; + Traffic = traffic; + EndpointType = endpointType; + } + + /// Enum to determine endpoint authentication mode. + public MachineLearningEndpointAuthMode? AuthMode { get; set; } + /// Gets or sets the compute. + public string Compute { get; set; } + /// Gets or sets the description. + public string Description { get; set; } + /// Dictionary of <integer>. + public IDictionary MirrorTraffic { get; } + /// Gets or sets the scoring uri. + public Uri ScoringUri { get; set; } + /// Dictionary of <integer>. + public IDictionary Traffic { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPERequirement.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPERequirement.cs new file mode 100644 index 000000000000..bef855e02feb --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPERequirement.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedPERequirement. + public readonly partial struct ManagedPERequirement : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedPERequirement(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RequiredValue = "Required"; + private const string NotRequiredValue = "NotRequired"; + private const string NotApplicableValue = "NotApplicable"; + + /// Required. + public static ManagedPERequirement Required { get; } = new ManagedPERequirement(RequiredValue); + /// NotRequired. + public static ManagedPERequirement NotRequired { get; } = new ManagedPERequirement(NotRequiredValue); + /// NotApplicable. + public static ManagedPERequirement NotApplicable { get; } = new ManagedPERequirement(NotApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedPERequirement left, ManagedPERequirement right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedPERequirement left, ManagedPERequirement right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ManagedPERequirement(string value) => new ManagedPERequirement(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedPERequirement other && Equals(other); + /// + public bool Equals(ManagedPERequirement other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPEStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPEStatus.cs new file mode 100644 index 000000000000..0f093ab17e78 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedPEStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ManagedPEStatus. + public readonly partial struct ManagedPEStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedPEStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InactiveValue = "Inactive"; + private const string ActiveValue = "Active"; + private const string NotApplicableValue = "NotApplicable"; + + /// Inactive. + public static ManagedPEStatus Inactive { get; } = new ManagedPEStatus(InactiveValue); + /// Active. + public static ManagedPEStatus Active { get; } = new ManagedPEStatus(ActiveValue); + /// NotApplicable. + public static ManagedPEStatus NotApplicable { get; } = new ManagedPEStatus(NotApplicableValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedPEStatus left, ManagedPEStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedPEStatus left, ManagedPEStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ManagedPEStatus(string value) => new ManagedPEStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedPEStatus other && Equals(other); + /// + public bool Equals(ManagedPEStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.Serialization.cs new file mode 100644 index 000000000000..dca7b304c2e6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ManagedResourceGroupAssignedIdentities : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedResourceGroupAssignedIdentities IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedResourceGroupAssignedIdentities(document.RootElement, options); + } + + internal static ManagedResourceGroupAssignedIdentities DeserializeManagedResourceGroupAssignedIdentities(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid? principalId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("principalId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedResourceGroupAssignedIdentities(principalId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support writing '{options.Format}' format."); + } + } + + ManagedResourceGroupAssignedIdentities IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedResourceGroupAssignedIdentities(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedResourceGroupAssignedIdentities)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs new file mode 100644 index 000000000000..80abe02f0024 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs + /// The MonitorEmailNotificationSettings. + internal partial class MonitorEmailNotificationSettings +======== + /// Details for managed resource group assigned identities. + public partial class ManagedResourceGroupAssignedIdentities +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs + /// Initializes a new instance of . + public MonitorEmailNotificationSettings() +======== + /// Initializes a new instance of . + public ManagedResourceGroupAssignedIdentities() +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs + { + Emails = new ChangeTrackingList(); + } + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs + /// Initializes a new instance of . + /// The email recipient list which has a limitation of 499 characters in total. + /// Keeps track of any properties unknown to the library. + internal MonitorEmailNotificationSettings(IList emails, IDictionary serializedAdditionalRawData) + { + Emails = emails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The email recipient list which has a limitation of 499 characters in total. + public IList Emails { get; set; } +======== + /// Initializes a new instance of . + /// Identity principal Id. + /// Keeps track of any properties unknown to the library. + internal ManagedResourceGroupAssignedIdentities(Guid? principalId, IDictionary serializedAdditionalRawData) + { + PrincipalId = principalId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Identity principal Id. + public Guid? PrincipalId { get; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.Serialization.cs new file mode 100644 index 000000000000..e5329dc0a898 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class ManagedResourceGroupSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AssignedIdentities)) + { + if (AssignedIdentities != null) + { + writer.WritePropertyName("assignedIdentities"u8); + writer.WriteStartArray(); + foreach (var item in AssignedIdentities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("assignedIdentities"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ManagedResourceGroupSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedResourceGroupSettings(document.RootElement, options); + } + + internal static ManagedResourceGroupSettings DeserializeManagedResourceGroupSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList assignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + assignedIdentities = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ManagedResourceGroupAssignedIdentities.DeserializeManagedResourceGroupAssignedIdentities(item, options)); + } + assignedIdentities = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedResourceGroupSettings(assignedIdentities ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support writing '{options.Format}' format."); + } + } + + ManagedResourceGroupSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeManagedResourceGroupSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedResourceGroupSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs new file mode 100644 index 000000000000..e11d11cb5295 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs + /// The MarketplacePlan. + public partial class MarketplacePlan +======== + /// Managed resource group settings. + internal partial class ManagedResourceGroupSettings +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs + /// Initializes a new instance of . + internal MarketplacePlan() + { + } + + /// Initializes a new instance of . + /// The identifying name of the Publisher of the Marketplace Plan. + /// The identifying name of the Offer of the Marketplace Plan. + /// The identifying name of the Plan of the Marketplace Plan. + /// Keeps track of any properties unknown to the library. + internal MarketplacePlan(string publisherId, string offerId, string planId, IDictionary serializedAdditionalRawData) + { + PublisherId = publisherId; + OfferId = offerId; + PlanId = planId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The identifying name of the Publisher of the Marketplace Plan. + public string PublisherId { get; } + /// The identifying name of the Offer of the Marketplace Plan. + public string OfferId { get; } + /// The identifying name of the Plan of the Marketplace Plan. + public string PlanId { get; } +======== + /// Initializes a new instance of . + public ManagedResourceGroupSettings() + { + AssignedIdentities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of assigned identities for the managed resource group. + /// Keeps track of any properties unknown to the library. + internal ManagedResourceGroupSettings(IList assignedIdentities, IDictionary serializedAdditionalRawData) + { + AssignedIdentities = assignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of assigned identities for the managed resource group. + public IList AssignedIdentities { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs index 859fac4a794f..c43263c5ff1f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs @@ -13,6 +13,10 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class MarketplacePlan : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -26,6 +30,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO } writer.WriteStartObject(); +<<<<<<< HEAD if (options.Format != "W" && Optional.IsDefined(PublisherId)) { if (PublisherId != null) @@ -38,6 +43,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WriteNull("publisherId"); } } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && Optional.IsDefined(OfferId)) { if (OfferId != null) @@ -60,8 +67,58 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO else { writer.WriteNull("planId"); +<<<<<<< HEAD +======== + public partial class ServerlessInferenceEndpoint : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsCollectionDefined(Headers)) + { + if (Headers != null) + { + writer.WritePropertyName("headers"u8); + writer.WriteStartObject(); + foreach (var item in Headers) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("headers"); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs + } + } + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); +======= + } + } + if (options.Format != "W" && Optional.IsDefined(PublisherId)) + { + if (PublisherId != null) + { + writer.WritePropertyName("publisherId"u8); + writer.WriteStringValue(PublisherId); + } + else + { + writer.WriteNull("publisherId"); } } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -80,6 +137,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WriteEndObject(); } +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MarketplacePlan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -93,6 +154,24 @@ MarketplacePlan IJsonModel.Create(ref Utf8JsonReader reader, Mo } internal static MarketplacePlan DeserializeMarketplacePlan(JsonElement element, ModelReaderWriterOptions options = null) +<<<<<<< HEAD +======== + ServerlessInferenceEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessInferenceEndpoint(document.RootElement, options); + } + + internal static ServerlessInferenceEndpoint DeserializeServerlessInferenceEndpoint(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { options ??= ModelSerializationExtensions.WireOptions; @@ -100,13 +179,26 @@ internal static MarketplacePlan DeserializeMarketplacePlan(JsonElement element, { return null; } +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs string publisherId = default; string offerId = default; string planId = default; +======== + IReadOnlyDictionary headers = default; + Uri uri = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +======= + string offerId = default; + string planId = default; + string publisherId = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs if (property.NameEquals("publisherId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -117,6 +209,8 @@ internal static MarketplacePlan DeserializeMarketplacePlan(JsonElement element, publisherId = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("offerId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -135,6 +229,39 @@ internal static MarketplacePlan DeserializeMarketplacePlan(JsonElement element, continue; } planId = property.Value.GetString(); +<<<<<<< HEAD +======== + if (property.NameEquals("headers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + headers = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + headers = dictionary; + continue; + } + if (property.NameEquals("uri"u8)) + { + uri = new Uri(property.Value.GetString()); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +======= + continue; + } + if (property.NameEquals("publisherId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + publisherId = null; + continue; + } + publisherId = property.Value.GetString(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (options.Format != "W") @@ -143,18 +270,38 @@ internal static MarketplacePlan DeserializeMarketplacePlan(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs return new MarketplacePlan(publisherId, offerId, planId, serializedAdditionalRawData); +======= + return new MarketplacePlan(offerId, planId, publisherId, serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +<<<<<<< HEAD +======== + return new ServerlessInferenceEndpoint(headers ?? new ChangeTrackingDictionary(), uri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 throw new FormatException($"The model {nameof(MarketplacePlan)} does not support writing '{options.Format}' format."); } } @@ -162,12 +309,28 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions opt MarketplacePlan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +<<<<<<< HEAD +======== + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support writing '{options.Format}' format."); + } + } + + ServerlessInferenceEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 return DeserializeMarketplacePlan(document.RootElement, options); } default: @@ -176,5 +339,18 @@ MarketplacePlan IPersistableModel.Create(BinaryData data, Model } string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +<<<<<<< HEAD +======== + return DeserializeServerlessInferenceEndpoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs index 7774ec4380b2..1f0009ca8e7a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs @@ -10,8 +10,23 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs /// The MarketplacePlan. public partial class MarketplacePlan +======== + /// Managed resource group settings. + internal partial class ManagedResourceGroupSettings +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs +======= +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs + /// The MonitorNotificationSettings. + internal partial class MonitorNotificationSettings +======== + /// The MarketplacePlan. + public partial class MarketplacePlan +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +60,46 @@ public partial class MarketplacePlan /// private IDictionary _serializedAdditionalRawData; +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs +======= +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs + /// Initializes a new instance of . + public MonitorNotificationSettings() + { + } + + /// Initializes a new instance of . + /// The AML notification email settings. + /// Keeps track of any properties unknown to the library. + internal MonitorNotificationSettings(MonitorEmailNotificationSettings emailNotificationSettings, IDictionary serializedAdditionalRawData) + { + EmailNotificationSettings = emailNotificationSettings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The AML notification email settings. + internal MonitorEmailNotificationSettings EmailNotificationSettings { get; set; } + /// The email recipient list which has a limitation of 499 characters in total. + public IList Emails + { + get => EmailNotificationSettings is null ? default : EmailNotificationSettings.Emails; + set + { + if (EmailNotificationSettings is null) + EmailNotificationSettings = new MonitorEmailNotificationSettings(); + EmailNotificationSettings.Emails = value; + } + } +======== +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Initializes a new instance of . internal MarketplacePlan() { } /// Initializes a new instance of . +<<<<<<< HEAD /// The identifying name of the Publisher of the Marketplace Plan. /// The identifying name of the Offer of the Marketplace Plan. /// The identifying name of the Plan of the Marketplace Plan. @@ -65,9 +114,48 @@ internal MarketplacePlan(string publisherId, string offerId, string planId, IDic /// The identifying name of the Publisher of the Marketplace Plan. public string PublisherId { get; } +======= + /// The identifying name of the Offer of the Marketplace Plan. + /// The identifying name of the Plan of the Marketplace Plan. + /// The identifying name of the Publisher of the Marketplace Plan. + /// Keeps track of any properties unknown to the library. + internal MarketplacePlan(string offerId, string planId, string publisherId, IDictionary serializedAdditionalRawData) + { + OfferId = offerId; + PlanId = planId; + PublisherId = publisherId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The identifying name of the Offer of the Marketplace Plan. public string OfferId { get; } /// The identifying name of the Plan of the Marketplace Plan. public string PlanId { get; } +<<<<<<< HEAD +======== + /// Initializes a new instance of . + public ManagedResourceGroupSettings() + { + AssignedIdentities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// List of assigned identities for the managed resource group. + /// Keeps track of any properties unknown to the library. + internal ManagedResourceGroupSettings(IList assignedIdentities, IDictionary serializedAdditionalRawData) + { + AssignedIdentities = assignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// List of assigned identities for the managed resource group. + public IList AssignedIdentities { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupSettings.cs +======= + /// The identifying name of the Publisher of the Marketplace Plan. + public string PublisherId { get; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs index 6c6079180f69..9d3d08e0a806 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); +<<<<<<< HEAD writer.WritePropertyName("modelId"u8); writer.WriteStringValue(ModelId); +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && Optional.IsDefined(MarketplacePlan)) { if (MarketplacePlan != null) @@ -45,6 +48,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("marketplaceSubscriptionStatus"u8); writer.WriteStringValue(MarketplaceSubscriptionStatus.Value.ToString()); } +<<<<<<< HEAD +======= + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -88,19 +96,28 @@ internal static MarketplaceSubscriptionProperties DeserializeMarketplaceSubscrip { return null; } +<<<<<<< HEAD string modelId = default; MarketplacePlan marketplacePlan = default; MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default; +======= + MarketplacePlan marketplacePlan = default; + MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus = default; + string modelId = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MarketplaceSubscriptionProvisioningState? provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("modelId"u8)) { modelId = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("marketplacePlan"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -120,6 +137,14 @@ internal static MarketplaceSubscriptionProperties DeserializeMarketplaceSubscrip marketplaceSubscriptionStatus = new MarketplaceSubscriptionStatus(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("provisioningState"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -135,7 +160,11 @@ internal static MarketplaceSubscriptionProperties DeserializeMarketplaceSubscrip } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new MarketplaceSubscriptionProperties(modelId, marketplacePlan, marketplaceSubscriptionStatus, provisioningState, serializedAdditionalRawData); +======= + return new MarketplaceSubscriptionProperties(marketplacePlan, marketplaceSubscriptionStatus, modelId, provisioningState, serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.cs index 98d60870f504..0473e7091545 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionProperties.cs @@ -56,6 +56,7 @@ public MarketplaceSubscriptionProperties(string modelId) } /// Initializes a new instance of . +<<<<<<< HEAD /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. /// Marketplace Plan associated with the Marketplace Subscription. /// Current status of the Marketplace Subscription. @@ -66,6 +67,18 @@ internal MarketplaceSubscriptionProperties(string modelId, MarketplacePlan marke ModelId = modelId; MarketplacePlan = marketplacePlan; MarketplaceSubscriptionStatus = marketplaceSubscriptionStatus; +======= + /// Marketplace Plan associated with the Marketplace Subscription. + /// Current status of the Marketplace Subscription. + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + /// Provisioning State of the Marketplace Subscription. + /// Keeps track of any properties unknown to the library. + internal MarketplaceSubscriptionProperties(MarketplacePlan marketplacePlan, MarketplaceSubscriptionStatus? marketplaceSubscriptionStatus, string modelId, MarketplaceSubscriptionProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + MarketplacePlan = marketplacePlan; + MarketplaceSubscriptionStatus = marketplaceSubscriptionStatus; + ModelId = modelId; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ProvisioningState = provisioningState; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -75,12 +88,20 @@ internal MarketplaceSubscriptionProperties() { } +<<<<<<< HEAD /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. public string ModelId { get; set; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Marketplace Plan associated with the Marketplace Subscription. public MarketplacePlan MarketplacePlan { get; } /// Current status of the Marketplace Subscription. public MarketplaceSubscriptionStatus? MarketplaceSubscriptionStatus { get; } +<<<<<<< HEAD +======= + /// [Required] Target Marketplace Model ID to create a Marketplace Subscription for. + public string ModelId { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Provisioning State of the Marketplace Subscription. public MarketplaceSubscriptionProvisioningState? ProvisioningState { get; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs index c912f79ca46b..cd75c0b278ae 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.Serialization.cs @@ -81,6 +81,10 @@ internal static MarketplaceSubscriptionResourceArmPaginatedResult DeserializeMar } IReadOnlyList value = default; string nextLink = default; +<<<<<<< HEAD +======= + IReadOnlyList value = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -110,7 +114,11 @@ internal static MarketplaceSubscriptionResourceArmPaginatedResult DeserializeMar } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new MarketplaceSubscriptionResourceArmPaginatedResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); +======= + return new MarketplaceSubscriptionResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs index ce030770c3f9..9be4c0bfee1d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplaceSubscriptionResourceArmPaginatedResult.cs @@ -52,6 +52,7 @@ internal MarketplaceSubscriptionResourceArmPaginatedResult() } /// Initializes a new instance of . +<<<<<<< HEAD /// An array of objects of type MarketplaceSubscription. /// The link to the next page of MarketplaceSubscription objects. If null, there are no additional pages. /// Keeps track of any properties unknown to the library. @@ -66,5 +67,21 @@ internal MarketplaceSubscriptionResourceArmPaginatedResult(IReadOnlyList Value { get; } /// The link to the next page of MarketplaceSubscription objects. If null, there are no additional pages. public string NextLink { get; } +======= + /// The link to the next page of MarketplaceSubscription objects. If null, there are no additional pages. + /// An array of objects of type MarketplaceSubscription. + /// Keeps track of any properties unknown to the library. + internal MarketplaceSubscriptionResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The link to the next page of MarketplaceSubscription objects. If null, there are no additional pages. + public string NextLink { get; } + /// An array of objects of type MarketplaceSubscription. + public IReadOnlyList Value { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelLifecycleStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelLifecycleStatus.cs new file mode 100644 index 000000000000..0b6a4651ccac --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelLifecycleStatus.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Model lifecycle status. + public readonly partial struct ModelLifecycleStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ModelLifecycleStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string GenerallyAvailableValue = "GenerallyAvailable"; + private const string PreviewValue = "Preview"; + + /// GenerallyAvailable. + public static ModelLifecycleStatus GenerallyAvailable { get; } = new ModelLifecycleStatus(GenerallyAvailableValue); + /// Preview. + public static ModelLifecycleStatus Preview { get; } = new ModelLifecycleStatus(PreviewValue); + /// Determines if two values are the same. + public static bool operator ==(ModelLifecycleStatus left, ModelLifecycleStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ModelLifecycleStatus left, ModelLifecycleStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ModelLifecycleStatus(string value) => new ModelLifecycleStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ModelLifecycleStatus other && Equals(other); + /// + public bool Equals(ModelLifecycleStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelProvider.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelProvider.cs new file mode 100644 index 000000000000..abfac75efe61 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelProvider.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Enum to determine the type of fine tuning. + internal readonly partial struct ModelProvider : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ModelProvider(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureOpenAIValue = "AzureOpenAI"; + private const string CustomValue = "Custom"; + + /// Fine tuning using Azure Open AI model. + public static ModelProvider AzureOpenAI { get; } = new ModelProvider(AzureOpenAIValue); + /// Fine tuning using custom model. + public static ModelProvider Custom { get; } = new ModelProvider(CustomValue); + /// Determines if two values are the same. + public static bool operator ==(ModelProvider left, ModelProvider right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ModelProvider left, ModelProvider right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ModelProvider(string value) => new ModelProvider(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ModelProvider other && Equals(other); + /// + public bool Equals(ModelProvider other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs index 00b70fc620c1..f0553a5bfb9f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs @@ -11,8 +11,9 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.MachineLearning.Models +namespace Azure.ResourceManager.Compute.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs internal partial class ModelSettings : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -37,6 +38,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt { writer.WriteNull("modelId"); } +======== + public partial class ComputeSkuProfileVmSize : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeSkuProfileVmSize)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -56,6 +76,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt writer.WriteEndObject(); } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs ModelSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -69,6 +90,21 @@ ModelSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelR } internal static ModelSettings DeserializeModelSettings(JsonElement element, ModelReaderWriterOptions options = null) +======== + ComputeSkuProfileVmSize IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeSkuProfileVmSize)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeSkuProfileVmSize(document.RootElement, options); + } + + internal static ComputeSkuProfileVmSize DeserializeComputeSkuProfileVmSize(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs { options ??= ModelSerializationExtensions.WireOptions; @@ -76,11 +112,16 @@ internal static ModelSettings DeserializeModelSettings(JsonElement element, Mode { return null; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs string modelId = default; +======== + string name = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs if (property.NameEquals("modelId"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -89,6 +130,11 @@ internal static ModelSettings DeserializeModelSettings(JsonElement element, Mode continue; } modelId = property.Value.GetString(); +======== + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs continue; } if (options.Format != "W") @@ -97,18 +143,28 @@ internal static ModelSettings DeserializeModelSettings(JsonElement element, Mode } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs return new ModelSettings(modelId, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new ComputeSkuProfileVmSize(name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs throw new FormatException($"The model {nameof(ModelSettings)} does not support writing '{options.Format}' format."); } } @@ -116,12 +172,22 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions optio ModelSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(ComputeSkuProfileVmSize)} does not support writing '{options.Format}' format."); + } + } + + ComputeSkuProfileVmSize IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.Serialization.cs return DeserializeModelSettings(document.RootElement, options); } default: @@ -130,5 +196,15 @@ ModelSettings IPersistableModel.Create(BinaryData data, ModelRead } string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeComputeSkuProfileVmSize(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeSkuProfileVmSize)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/compute/Azure.ResourceManager.Compute/src/Generated/Models/ComputeSkuProfileVmSize.Serialization.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs index 8aca8bc65464..71a2241b3181 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs @@ -8,10 +8,15 @@ using System; using System.Collections.Generic; -namespace Azure.ResourceManager.MachineLearning.Models +namespace Azure.ResourceManager.ComputeFleet.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs /// The ModelSettings. internal partial class ModelSettings +======== + /// Describes the uri of a disk. + internal partial class ComputeFleetVirtualHardDisk +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.cs { /// /// Keeps track of any properties unknown to the library. @@ -45,6 +50,7 @@ internal partial class ModelSettings /// private IDictionary _serializedAdditionalRawData; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs /// Initializes a new instance of . public ModelSettings() { @@ -54,12 +60,28 @@ public ModelSettings() /// The unique model identifier that this ServerlessEndpoint should provision. /// Keeps track of any properties unknown to the library. internal ModelSettings(string modelId, IDictionary serializedAdditionalRawData) +======== + /// Initializes a new instance of . + public ComputeFleetVirtualHardDisk() + { + } + + /// Initializes a new instance of . + /// Specifies the virtual hard disk's uri. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVirtualHardDisk(Uri uri, IDictionary serializedAdditionalRawData) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.cs { ModelId = modelId; _serializedAdditionalRawData = serializedAdditionalRawData; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ModelSettings.cs /// The unique model identifier that this ServerlessEndpoint should provision. public string ModelId { get; set; } +======== + /// Specifies the virtual hard disk's uri. + public Uri Uri { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVirtualHardDisk.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs index aead0b6b7fd0..fa2332992665 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.Serialization.cs @@ -26,6 +26,23 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite } writer.WriteStartObject(); +<<<<<<< HEAD +======= + if (Optional.IsDefined(AlertNotificationSettings)) + { + if (AlertNotificationSettings != null) + { + writer.WritePropertyName("alertNotificationSettings"u8); + writer.WriteObjectValue(AlertNotificationSettings, options); + } + else + { + writer.WriteNull("alertNotificationSettings"); + } + } + writer.WritePropertyName("computeConfiguration"u8); + writer.WriteObjectValue(ComputeConfiguration, options); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(MonitoringTarget)) { if (MonitoringTarget != null) @@ -98,6 +115,11 @@ internal static MonitorDefinition DeserializeMonitorDefinition(JsonElement eleme { return null; } +<<<<<<< HEAD +======= + MonitorNotificationSettings alertNotificationSettings = default; + MonitorComputeConfigurationBase computeConfiguration = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MonitoringTarget monitoringTarget = default; IDictionary signals = default; MonitorComputeConfigurationBase computeConfiguration = default; @@ -106,6 +128,24 @@ internal static MonitorDefinition DeserializeMonitorDefinition(JsonElement eleme Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD +======= + if (property.NameEquals("alertNotificationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + alertNotificationSettings = null; + continue; + } + alertNotificationSettings = MonitorNotificationSettings.DeserializeMonitorNotificationSettings(property.Value, options); + continue; + } + if (property.NameEquals("computeConfiguration"u8)) + { + computeConfiguration = MonitorComputeConfigurationBase.DeserializeMonitorComputeConfigurationBase(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("monitoringTarget"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -147,7 +187,11 @@ internal static MonitorDefinition DeserializeMonitorDefinition(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new MonitorDefinition(monitoringTarget, signals, computeConfiguration, alertNotificationSettings, serializedAdditionalRawData); +======= + return new MonitorDefinition(alertNotificationSettings, computeConfiguration, monitoringTarget, signals, serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs index 692d7cae992c..c532d6741a35 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorDefinition.cs @@ -56,8 +56,18 @@ public partial class MonitorDefinition /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// +<<<<<<< HEAD /// or is null. public MonitorDefinition(IDictionary signals, MonitorComputeConfigurationBase computeConfiguration) +======= + /// + /// [Required] The signals to monitor. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// or is null. + public MonitorDefinition(MonitorComputeConfigurationBase computeConfiguration, IDictionary signals) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Argument.AssertNotNull(signals, nameof(signals)); Argument.AssertNotNull(computeConfiguration, nameof(computeConfiguration)); @@ -67,21 +77,39 @@ public MonitorDefinition(IDictionary signals, Moni } /// Initializes a new instance of . +<<<<<<< HEAD /// The entities targeted by the monitor. /// /// [Required] The signals to monitor. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// +======= + /// The monitor's notification settings. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// [Required] The ARM resource ID of the compute resource to run the monitoring job on. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// +<<<<<<< HEAD /// The monitor's notification settings. /// Keeps track of any properties unknown to the library. internal MonitorDefinition(MonitoringTarget monitoringTarget, IDictionary signals, MonitorComputeConfigurationBase computeConfiguration, MonitorNotificationSettings alertNotificationSettings, IDictionary serializedAdditionalRawData) { +======= + /// The entities targeted by the monitor. + /// + /// [Required] The signals to monitor. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Keeps track of any properties unknown to the library. + internal MonitorDefinition(MonitorNotificationSettings alertNotificationSettings, MonitorComputeConfigurationBase computeConfiguration, MonitoringTarget monitoringTarget, IDictionary signals, IDictionary serializedAdditionalRawData) + { + AlertNotificationSettings = alertNotificationSettings; + ComputeConfiguration = computeConfiguration; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MonitoringTarget = monitoringTarget; Signals = signals; ComputeConfiguration = computeConfiguration; @@ -94,6 +122,7 @@ internal MonitorDefinition() { } +<<<<<<< HEAD /// The entities targeted by the monitor. public MonitoringTarget MonitoringTarget { get; set; } /// @@ -102,12 +131,29 @@ internal MonitorDefinition() /// The available derived classes include , , , and . /// public IDictionary Signals { get; } +======= + /// The monitor's notification settings. + internal MonitorNotificationSettings AlertNotificationSettings { get; set; } + /// The email recipient list which has a limitation of 499 characters in total. + public IList Emails + { + get => AlertNotificationSettings is null ? default : AlertNotificationSettings.Emails; + set + { + if (AlertNotificationSettings is null) + AlertNotificationSettings = new MonitorNotificationSettings(); + AlertNotificationSettings.Emails = value; + } + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// [Required] The ARM resource ID of the compute resource to run the monitoring job on. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// public MonitorComputeConfigurationBase ComputeConfiguration { get; set; } +<<<<<<< HEAD /// The monitor's notification settings. internal MonitorNotificationSettings AlertNotificationSettings { get; set; } /// The email recipient list which has a limitation of 499 characters in total. @@ -121,5 +167,15 @@ public IList Emails AlertNotificationSettings.Emails = value; } } +======= + /// The entities targeted by the monitor. + public MonitoringTarget MonitoringTarget { get; set; } + /// + /// [Required] The signals to monitor. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public IDictionary Signals { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs index 7e88982908ca..2e44787146ac 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs @@ -11,8 +11,9 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.MachineLearning.Models +namespace Azure.ResourceManager.Monitor.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs internal partial class MonitorEmailNotificationSettings : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -42,6 +43,34 @@ void IJsonModel.Write(Utf8JsonWriter writer, M { writer.WriteNull("emails"); } +======== + public partial class PipelineGroupExporter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupExporter)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ExporterType.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(AzureMonitorWorkspaceLogs)) + { + writer.WritePropertyName("azureMonitorWorkspaceLogs"u8); + writer.WriteObjectValue(AzureMonitorWorkspaceLogs, options); + } + if (Optional.IsDefined(Tcp)) + { + writer.WritePropertyName("tcp"u8); + writer.WriteObjectValue(Tcp, options); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -61,6 +90,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WriteEndObject(); } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs MonitorEmailNotificationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -74,6 +104,21 @@ MonitorEmailNotificationSettings IJsonModel.Cr } internal static MonitorEmailNotificationSettings DeserializeMonitorEmailNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) +======== + PipelineGroupExporter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupExporter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupExporter(document.RootElement, options); + } + + internal static PipelineGroupExporter DeserializePipelineGroupExporter(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs { options ??= ModelSerializationExtensions.WireOptions; @@ -81,24 +126,56 @@ internal static MonitorEmailNotificationSettings DeserializeMonitorEmailNotifica { return null; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs IList emails = default; +======== + PipelineGroupExporterType type = default; + string name = default; + MonitorWorkspaceLogsExporter azureMonitorWorkspaceLogs = default; + TcpExporter tcp = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs if (property.NameEquals("emails"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { emails = null; +======== + if (property.NameEquals("type"u8)) + { + type = new PipelineGroupExporterType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureMonitorWorkspaceLogs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + azureMonitorWorkspaceLogs = MonitorWorkspaceLogsExporter.DeserializeMonitorWorkspaceLogsExporter(property.Value, options); + continue; + } + if (property.NameEquals("tcp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) { - array.Add(item.GetString()); + continue; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs emails = array; +======== + tcp = TcpExporter.DeserializeTcpExporter(property.Value, options); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs continue; } if (options.Format != "W") @@ -107,18 +184,28 @@ internal static MonitorEmailNotificationSettings DeserializeMonitorEmailNotifica } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs return new MonitorEmailNotificationSettings(emails ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new PipelineGroupExporter(type, name, azureMonitorWorkspaceLogs, tcp, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs throw new FormatException($"The model {nameof(MonitorEmailNotificationSettings)} does not support writing '{options.Format}' format."); } } @@ -126,12 +213,22 @@ BinaryData IPersistableModel.Write(ModelReader MonitorEmailNotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(PipelineGroupExporter)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupExporter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.Serialization.cs return DeserializeMonitorEmailNotificationSettings(document.RootElement, options); } default: @@ -140,5 +237,15 @@ MonitorEmailNotificationSettings IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializePipelineGroupExporter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupExporter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.Serialization.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs index 4a748e4f6368..80abe02f0024 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs @@ -10,8 +10,13 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs /// The MonitorEmailNotificationSettings. internal partial class MonitorEmailNotificationSettings +======== + /// Details for managed resource group assigned identities. + public partial class ManagedResourceGroupAssignedIdentities +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +50,18 @@ internal partial class MonitorEmailNotificationSettings /// private IDictionary _serializedAdditionalRawData; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs /// Initializes a new instance of . public MonitorEmailNotificationSettings() +======== + /// Initializes a new instance of . + public ManagedResourceGroupAssignedIdentities() +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs { Emails = new ChangeTrackingList(); } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorEmailNotificationSettings.cs /// Initializes a new instance of . /// The email recipient list which has a limitation of 499 characters in total. /// Keeps track of any properties unknown to the library. @@ -62,5 +73,18 @@ internal MonitorEmailNotificationSettings(IList emails, IDictionary The email recipient list which has a limitation of 499 characters in total. public IList Emails { get; set; } +======== + /// Initializes a new instance of . + /// Identity principal Id. + /// Keeps track of any properties unknown to the library. + internal ManagedResourceGroupAssignedIdentities(Guid? principalId, IDictionary serializedAdditionalRawData) + { + PrincipalId = principalId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Identity principal Id. + public Guid? PrincipalId { get; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ManagedResourceGroupAssignedIdentities.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs index 76f1b9e5d4d9..08ee520e63f5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs @@ -11,8 +11,9 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.MachineLearning.Models +namespace Azure.ResourceManager.ComputeFleet.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs internal partial class MonitorNotificationSettings : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -36,7 +37,30 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR else { writer.WriteNull("emailNotificationSettings"); +======== + internal partial class WinRMConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WinRMConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Listeners)) + { + writer.WritePropertyName("listeners"u8); + writer.WriteStartArray(); + foreach (var item in Listeners) + { + writer.WriteObjectValue(item, options); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs } + writer.WriteEndArray(); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -56,6 +80,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteEndObject(); } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs MonitorNotificationSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -69,6 +94,21 @@ MonitorNotificationSettings IJsonModel.Create(ref U } internal static MonitorNotificationSettings DeserializeMonitorNotificationSettings(JsonElement element, ModelReaderWriterOptions options = null) +======== + WinRMConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WinRMConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWinRMConfiguration(document.RootElement, options); + } + + internal static WinRMConfiguration DeserializeWinRMConfiguration(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs { options ??= ModelSerializationExtensions.WireOptions; @@ -76,19 +116,36 @@ internal static MonitorNotificationSettings DeserializeMonitorNotificationSettin { return null; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs MonitorEmailNotificationSettings emailNotificationSettings = default; +======== + IList listeners = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs if (property.NameEquals("emailNotificationSettings"u8)) +======== + if (property.NameEquals("listeners"u8)) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs { if (property.Value.ValueKind == JsonValueKind.Null) { emailNotificationSettings = null; continue; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs emailNotificationSettings = MonitorEmailNotificationSettings.DeserializeMonitorEmailNotificationSettings(property.Value, options); +======== + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ComputeFleetWinRMListener.DeserializeComputeFleetWinRMListener(item, options)); + } + listeners = array; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs continue; } if (options.Format != "W") @@ -97,18 +154,28 @@ internal static MonitorNotificationSettings DeserializeMonitorNotificationSettin } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs return new MonitorNotificationSettings(emailNotificationSettings, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new WinRMConfiguration(listeners ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs throw new FormatException($"The model {nameof(MonitorNotificationSettings)} does not support writing '{options.Format}' format."); } } @@ -116,12 +183,22 @@ BinaryData IPersistableModel.Write(ModelReaderWrite MonitorNotificationSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(WinRMConfiguration)} does not support writing '{options.Format}' format."); + } + } + + WinRMConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.Serialization.cs return DeserializeMonitorNotificationSettings(document.RootElement, options); } default: @@ -130,5 +207,15 @@ MonitorNotificationSettings IPersistableModel.Creat } string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeWinRMConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WinRMConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/WinRMConfiguration.Serialization.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs index abc1244c89eb..96a95d248056 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs @@ -10,8 +10,13 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs /// The MonitorNotificationSettings. internal partial class MonitorNotificationSettings +======== + /// The MarketplacePlan. + public partial class MarketplacePlan +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs { /// /// Keeps track of any properties unknown to the library. @@ -45,6 +50,7 @@ internal partial class MonitorNotificationSettings /// private IDictionary _serializedAdditionalRawData; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitorNotificationSettings.cs /// Initializes a new instance of . public MonitorNotificationSettings() { @@ -72,5 +78,31 @@ public IList Emails EmailNotificationSettings.Emails = value; } } +======== + /// Initializes a new instance of . + internal MarketplacePlan() + { + } + + /// Initializes a new instance of . + /// The identifying name of the Offer of the Marketplace Plan. + /// The identifying name of the Plan of the Marketplace Plan. + /// The identifying name of the Publisher of the Marketplace Plan. + /// Keeps track of any properties unknown to the library. + internal MarketplacePlan(string offerId, string planId, string publisherId, IDictionary serializedAdditionalRawData) + { + OfferId = offerId; + PlanId = planId; + PublisherId = publisherId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The identifying name of the Offer of the Marketplace Plan. + public string OfferId { get; } + /// The identifying name of the Plan of the Marketplace Plan. + public string PlanId { get; } + /// The identifying name of the Publisher of the Marketplace Plan. + public string PublisherId { get; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs index 59c35500e196..f912576b5fa7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); +<<<<<<< HEAD writer.WritePropertyName("signalType"u8); writer.WriteStringValue(SignalType.ToString()); +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(NotificationTypes)) { if (NotificationTypes != null) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs index a07a176e6651..d9c1d7b63c6c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringSignalBase.cs @@ -56,18 +56,37 @@ protected MonitoringSignalBase() } /// Initializes a new instance of . +<<<<<<< HEAD +======= + /// The current notification mode for this signal. + /// Property dictionary. Properties can be added, but not removed or altered. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Specifies the type of signal to monitor. /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal MonitoringSignalBase(MonitoringSignalType signalType, IList notificationTypes, IDictionary properties, IDictionary serializedAdditionalRawData) { +======= + internal MonitoringSignalBase(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData) + { + NotificationTypes = notificationTypes; + Properties = properties; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 SignalType = signalType; NotificationTypes = notificationTypes; Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } +<<<<<<< HEAD +======= + /// The current notification mode for this signal. + public IList NotificationTypes { get; set; } + /// Property dictionary. Properties can be added, but not removed or altered. + public IDictionary Properties { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Specifies the type of signal to monitor. internal MonitoringSignalType SignalType { get; set; } /// The current notification mode for this signal. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs index 695c09a8d308..45d9d54a6606 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MonitoringTarget.cs @@ -53,8 +53,13 @@ public MonitoringTarget(ModelTaskType taskType) } /// Initializes a new instance of . +<<<<<<< HEAD /// Reference to the model asset targeted by this monitor. /// Reference to the deployment asset targeted by this monitor. +======= + /// Reference to the deployment asset targeted by this monitor. + /// Reference to the model asset targeted by this monitor. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] The machine learning task type of the monitored model. /// Keeps track of any properties unknown to the library. internal MonitoringTarget(string modelId, string deploymentId, ModelTaskType taskType, IDictionary serializedAdditionalRawData) @@ -70,10 +75,17 @@ internal MonitoringTarget() { } +<<<<<<< HEAD /// Reference to the model asset targeted by this monitor. public string ModelId { get; set; } /// Reference to the deployment asset targeted by this monitor. public string DeploymentId { get; set; } +======= + /// Reference to the deployment asset targeted by this monitor. + public string DeploymentId { get; set; } + /// Reference to the model asset targeted by this monitor. + public string ModelId { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] The machine learning task type of the monitored model. public ModelTaskType TaskType { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MountMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MountMode.cs new file mode 100644 index 000000000000..7ddf80dfea74 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MountMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Mount Mode. + public readonly partial struct MountMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MountMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadOnlyValue = "ReadOnly"; + private const string ReadWriteValue = "ReadWrite"; + + /// ReadOnly. + public static MountMode ReadOnly { get; } = new MountMode(ReadOnlyValue); + /// ReadWrite. + public static MountMode ReadWrite { get; } = new MountMode(ReadWriteValue); + /// Determines if two values are the same. + public static bool operator ==(MountMode left, MountMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MountMode left, MountMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MountMode(string value) => new MountMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MountMode other && Equals(other); + /// + public bool Equals(MountMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs index ac9d21dd7729..c281df3fd1e3 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.Serialization.cs @@ -28,8 +28,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteStartObject(); if (Optional.IsDefined(Timeout)) { +<<<<<<< HEAD writer.WritePropertyName("timeout"u8); writer.WriteStringValue(Timeout.Value, "P"); +======= + writer.WritePropertyName("maxConcurrentTrials"u8); + writer.WriteNumberValue(MaxConcurrentTrials.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(MaxTrials)) { @@ -38,8 +43,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } if (Optional.IsDefined(MaxConcurrentTrials)) { +<<<<<<< HEAD writer.WritePropertyName("maxConcurrentTrials"u8); writer.WriteNumberValue(MaxConcurrentTrials.Value); +======= + writer.WritePropertyName("timeout"u8); + writer.WriteStringValue(Timeout.Value, "P"); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -79,9 +89,15 @@ internal static NlpVerticalLimitSettings DeserializeNlpVerticalLimitSettings(Jso { return null; } +<<<<<<< HEAD TimeSpan? timeout = default; int? maxTrials = default; int? maxConcurrentTrials = default; +======= + int? maxConcurrentTrials = default; + int? maxTrials = default; + TimeSpan? timeout = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +108,11 @@ internal static NlpVerticalLimitSettings DeserializeNlpVerticalLimitSettings(Jso { continue; } +<<<<<<< HEAD timeout = property.Value.GetTimeSpan("P"); +======= + maxConcurrentTrials = property.Value.GetInt32(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("maxTrials"u8)) @@ -110,7 +130,11 @@ internal static NlpVerticalLimitSettings DeserializeNlpVerticalLimitSettings(Jso { continue; } +<<<<<<< HEAD maxConcurrentTrials = property.Value.GetInt32(); +======= + timeout = property.Value.GetTimeSpan("P"); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (options.Format != "W") @@ -119,7 +143,11 @@ internal static NlpVerticalLimitSettings DeserializeNlpVerticalLimitSettings(Jso } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new NlpVerticalLimitSettings(timeout, maxTrials, maxConcurrentTrials, serializedAdditionalRawData); +======= + return new NlpVerticalLimitSettings(maxConcurrentTrials, maxTrials, timeout, serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs index 1859d033df4f..1432284885a0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/NlpVerticalLimitSettings.cs @@ -51,6 +51,7 @@ public NlpVerticalLimitSettings() } /// Initializes a new instance of . +<<<<<<< HEAD /// AutoML job timeout. /// Number of AutoML iterations. /// Maximum Concurrent AutoML iterations. @@ -69,5 +70,25 @@ internal NlpVerticalLimitSettings(TimeSpan? timeout, int? maxTrials, int? maxCon public int? MaxTrials { get; set; } /// Maximum Concurrent AutoML iterations. public int? MaxConcurrentTrials { get; set; } +======= + /// Maximum Concurrent AutoML iterations. + /// Number of AutoML iterations. + /// AutoML job timeout. + /// Keeps track of any properties unknown to the library. + internal NlpVerticalLimitSettings(int? maxConcurrentTrials, int? maxTrials, TimeSpan? timeout, IDictionary serializedAdditionalRawData) + { + MaxConcurrentTrials = maxConcurrentTrials; + MaxTrials = maxTrials; + Timeout = timeout; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Maximum Concurrent AutoML iterations. + public int? MaxConcurrentTrials { get; set; } + /// Number of AutoML iterations. + public int? MaxTrials { get; set; } + /// AutoML job timeout. + public TimeSpan? Timeout { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs index 8e7f89946435..1311eaf36bc9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -43,6 +43,14 @@ void IJsonModel.Write(Utf8JsonWrite writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); @@ -58,11 +66,14 @@ void IJsonModel.Write(Utf8JsonWrite writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); } +<<<<<<< HEAD if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -74,6 +85,19 @@ void IJsonModel.Write(Utf8JsonWrite } writer.WriteEndObject(); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(SharedUserList)) { writer.WritePropertyName("sharedUserList"u8); @@ -84,6 +108,7 @@ void IJsonModel.Write(Utf8JsonWrite } writer.WriteEndArray(); } +<<<<<<< HEAD if (Optional.IsDefined(Value)) { writer.WritePropertyName("value"u8); @@ -93,6 +118,17 @@ void IJsonModel.Write(Utf8JsonWrite { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -136,6 +172,7 @@ internal static OAuth2AuthTypeWorkspaceConnectionProperties DeserializeOAuth2Aut MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -144,6 +181,18 @@ internal static OAuth2AuthTypeWorkspaceConnectionProperties DeserializeOAuth2Aut IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -180,6 +229,14 @@ internal static OAuth2AuthTypeWorkspaceConnectionProperties DeserializeOAuth2Aut createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,11 +264,14 @@ internal static OAuth2AuthTypeWorkspaceConnectionProperties DeserializeOAuth2Aut isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -226,6 +286,27 @@ internal static OAuth2AuthTypeWorkspaceConnectionProperties DeserializeOAuth2Aut metadata = dictionary; continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("sharedUserList"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -240,18 +321,31 @@ internal static OAuth2AuthTypeWorkspaceConnectionProperties DeserializeOAuth2Aut sharedUserList = array; continue; } +<<<<<<< HEAD if (property.NameEquals("value"u8)) { value = property.Value.GetString(); continue; } if (property.NameEquals("valueFormat"u8)) +======= + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } +<<<<<<< HEAD valueFormat = new MachineLearningValueFormat(property.Value.GetString()); +======= + useWorkspaceManagedIdentity = property.Value.GetBoolean(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (options.Format != "W") @@ -264,6 +358,7 @@ internal static OAuth2AuthTypeWorkspaceConnectionProperties DeserializeOAuth2Aut authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -272,6 +367,18 @@ internal static OAuth2AuthTypeWorkspaceConnectionProperties DeserializeOAuth2Aut sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs index c9e4df458c52..ecc16e42b0ab 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OAuth2AuthTypeWorkspaceConnectionProperties.cs @@ -24,6 +24,7 @@ public OAuth2AuthTypeWorkspaceConnectionProperties() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -32,12 +33,28 @@ public OAuth2AuthTypeWorkspaceConnectionProperties() /// /// Value details of the workspace connection. /// format for the workspace connection value. +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Keeps track of any properties unknown to the library. /// /// ClientId and ClientSecret are required. Other properties are optional /// depending on each OAuth2 provider's implementation. /// +<<<<<<< HEAD internal OAuth2AuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData, WorkspaceConnectionOAuth2 credentials) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + internal OAuth2AuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionOAuth2 credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs new file mode 100644 index 000000000000..dcc3aef7e0d9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.Serialization.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OSPatchingStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(PatchStatus)) + { + writer.WritePropertyName("patchStatus"u8); + writer.WriteStringValue(PatchStatus.Value.ToString()); + } + if (Optional.IsDefined(LatestPatchOn)) + { + writer.WritePropertyName("latestPatchTime"u8); + writer.WriteStringValue(LatestPatchOn.Value, "O"); + } + if (Optional.IsDefined(RebootPending)) + { + writer.WritePropertyName("rebootPending"u8); + writer.WriteBooleanValue(RebootPending.Value); + } + if (Optional.IsDefined(ScheduledRebootOn)) + { + writer.WritePropertyName("scheduledRebootTime"u8); + writer.WriteStringValue(ScheduledRebootOn.Value, "O"); + } + if (Optional.IsCollectionDefined(OSPatchingErrors)) + { + if (OSPatchingErrors != null) + { + writer.WritePropertyName("osPatchingErrors"u8); + writer.WriteStartArray(); + foreach (var item in OSPatchingErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("osPatchingErrors"); + } + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OSPatchingStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSPatchingStatus(document.RootElement, options); + } + + internal static OSPatchingStatus DeserializeOSPatchingStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PatchStatus? patchStatus = default; + DateTimeOffset? latestPatchTime = default; + bool? rebootPending = default; + DateTimeOffset? scheduledRebootTime = default; + IReadOnlyList osPatchingErrors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("patchStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchStatus = new PatchStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("latestPatchTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latestPatchTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("rebootPending"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rebootPending = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("scheduledRebootTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + scheduledRebootTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("osPatchingErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + osPatchingErrors = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MachineLearningError.DeserializeMachineLearningError(item, options)); + } + osPatchingErrors = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OSPatchingStatus( + patchStatus, + latestPatchTime, + rebootPending, + scheduledRebootTime, + osPatchingErrors ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support writing '{options.Format}' format."); + } + } + + OSPatchingStatus IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOSPatchingStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSPatchingStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs new file mode 100644 index 000000000000..5f9f0d128b84 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OSPatchingStatus.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Returns metadata about the os patching. + public partial class OSPatchingStatus + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal OSPatchingStatus() + { + OSPatchingErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The os patching status. + /// Time of the latest os patching. + /// Specifies whether this compute instance is pending for reboot to finish os patching. + /// Time of scheduled reboot. + /// Collection of errors encountered when doing os patching. + /// Keeps track of any properties unknown to the library. + internal OSPatchingStatus(PatchStatus? patchStatus, DateTimeOffset? latestPatchOn, bool? rebootPending, DateTimeOffset? scheduledRebootOn, IReadOnlyList osPatchingErrors, IDictionary serializedAdditionalRawData) + { + PatchStatus = patchStatus; + LatestPatchOn = latestPatchOn; + RebootPending = rebootPending; + ScheduledRebootOn = scheduledRebootOn; + OSPatchingErrors = osPatchingErrors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The os patching status. + public PatchStatus? PatchStatus { get; } + /// Time of the latest os patching. + public DateTimeOffset? LatestPatchOn { get; } + /// Specifies whether this compute instance is pending for reboot to finish os patching. + public bool? RebootPending { get; } + /// Time of scheduled reboot. + public DateTimeOffset? ScheduledRebootOn { get; } + /// Collection of errors encountered when doing os patching. + public IReadOnlyList OSPatchingErrors { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs index 6ce71ab75781..0b58deacd2b6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OneLakeDatastore.cs @@ -49,6 +49,11 @@ public OneLakeDatastore(MachineLearningDatastoreCredentials credentials, OneLake /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// +<<<<<<< HEAD +======= + /// [Required] Storage type backing the datastore. + /// Readonly property to indicate if datastore is the workspace default datastore. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// [Required] OneLake artifact backing the datastore. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -57,7 +62,11 @@ public OneLakeDatastore(MachineLearningDatastoreCredentials credentials, OneLake /// [Required] OneLake workspace name. /// OneLake endpoint to use for the datastore. /// Indicates which identity to use to authenticate service data access to customer's storage. +<<<<<<< HEAD internal OneLakeDatastore(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, DatastoreType datastoreType, bool? isDefault, MachineLearningDatastoreCredentials credentials, OneLakeArtifact artifact, string oneLakeWorkspaceName, string endpoint, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity) : base(description, tags, properties, serializedAdditionalRawData, datastoreType, isDefault, credentials) +======= + internal OneLakeDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault, OneLakeArtifact artifact, string endpoint, string oneLakeWorkspaceName, MachineLearningServiceDataAccessAuthIdentity? serviceDataAccessAuthIdentity) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Artifact = artifact; OneLakeWorkspaceName = oneLakeWorkspaceName; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 000000000000..b4fd7a3ec41a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OpenAIEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (Optional.IsDefined(RaiPolicyName)) + { + writer.WritePropertyName("raiPolicyName"u8); + writer.WriteStringValue(RaiPolicyName); + } + if (Optional.IsDefined(VersionUpgradeOption)) + { + writer.WritePropertyName("versionUpgradeOption"u8); + writer.WriteStringValue(VersionUpgradeOption.Value.ToString()); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OpenAIEndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenAIEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static OpenAIEndpointDeploymentResourceProperties DeserializeOpenAIEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentModel model = default; + string raiPolicyName = default; + DeploymentModelVersionUpgradeOption? versionUpgradeOption = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model"u8)) + { + model = EndpointDeploymentModel.DeserializeEndpointDeploymentModel(property.Value, options); + continue; + } + if (property.NameEquals("raiPolicyName"u8)) + { + raiPolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("versionUpgradeOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + versionUpgradeOption = new DeploymentModelVersionUpgradeOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAIEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + model, + raiPolicyName, + versionUpgradeOption); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + OpenAIEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenAIEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAIEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.cs new file mode 100644 index 000000000000..f73542323150 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointDeploymentResourceProperties.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The OpenAIEndpointDeploymentResourceProperties. + public partial class OpenAIEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// Model used for the endpoint deployment. + /// is null. + public OpenAIEndpointDeploymentResourceProperties(EndpointDeploymentModel model) + { + Argument.AssertNotNull(model, nameof(model)); + + Model = model; + EndpointDeploymentResourcePropertiesType = "Azure.OpenAI"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + internal OpenAIEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, EndpointDeploymentModel model, string raiPolicyName, DeploymentModelVersionUpgradeOption? versionUpgradeOption) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + Model = model; + RaiPolicyName = raiPolicyName; + VersionUpgradeOption = versionUpgradeOption; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Azure.OpenAI"; + } + + /// Initializes a new instance of for deserialization. + internal OpenAIEndpointDeploymentResourceProperties() + { + } + + /// Model used for the endpoint deployment. + public EndpointDeploymentModel Model { get; set; } + /// The name of RAI policy. + public string RaiPolicyName { get; set; } + /// Deployment model version upgrade option. + public DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.Serialization.cs new file mode 100644 index 000000000000..b79f2cb16cda --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class OpenAIEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OpenAIEndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOpenAIEndpointResourceProperties(document.RootElement, options); + } + + internal static OpenAIEndpointResourceProperties DeserializeOpenAIEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OpenAIEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + OpenAIEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOpenAIEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OpenAIEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.cs new file mode 100644 index 000000000000..fe0f3b068576 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/OpenAIEndpointResourceProperties.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The OpenAIEndpointResourceProperties. + public partial class OpenAIEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public OpenAIEndpointResourceProperties() + { + EndpointType = EndpointType.AzureOpenAI; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal OpenAIEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PatchStatus.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PatchStatus.cs new file mode 100644 index 000000000000..cf568facb6ea --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PatchStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The os patching status. + public readonly partial struct PatchStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CompletedWithWarningsValue = "CompletedWithWarnings"; + private const string FailedValue = "Failed"; + private const string InProgressValue = "InProgress"; + private const string SucceededValue = "Succeeded"; + private const string UnknownValue = "Unknown"; + + /// CompletedWithWarnings. + public static PatchStatus CompletedWithWarnings { get; } = new PatchStatus(CompletedWithWarningsValue); + /// Failed. + public static PatchStatus Failed { get; } = new PatchStatus(FailedValue); + /// InProgress. + public static PatchStatus InProgress { get; } = new PatchStatus(InProgressValue); + /// Succeeded. + public static PatchStatus Succeeded { get; } = new PatchStatus(SucceededValue); + /// Unknown. + public static PatchStatus Unknown { get; } = new PatchStatus(UnknownValue); + /// Determines if two values are the same. + public static bool operator ==(PatchStatus left, PatchStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchStatus left, PatchStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PatchStatus(string value) => new PatchStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchStatus other && Equals(other); + /// + public bool Equals(PatchStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs index 0389693d129c..fc385e351a22 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.Serialization.cs @@ -26,6 +26,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo } writer.WriteStartObject(); + if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) + { + if (FeatureDataTypeOverride != null) + { + writer.WritePropertyName("featureDataTypeOverride"u8); + writer.WriteStartObject(); + foreach (var item in FeatureDataTypeOverride) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value.ToString()); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("featureDataTypeOverride"); + } + } writer.WritePropertyName("metricThresholds"u8); writer.WriteStartArray(); foreach (var item in MetricThresholds) @@ -37,6 +55,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteObjectValue(ProductionData, options); writer.WritePropertyName("referenceData"u8); writer.WriteObjectValue(ReferenceData, options); +<<<<<<< HEAD if (Optional.IsCollectionDefined(FeatureDataTypeOverride)) { if (FeatureDataTypeOverride != null) @@ -59,6 +78,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteStringValue(SignalType.ToString()); if (Optional.IsCollectionDefined(NotificationTypes)) { +======= + if (Optional.IsCollectionDefined(NotificationTypes)) + { +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (NotificationTypes != null) { writer.WritePropertyName("notificationTypes"u8); @@ -130,10 +153,16 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito { return null; } + IDictionary featureDataTypeOverride = default; IList metricThresholds = default; MonitoringInputDataBase productionData = default; MonitoringInputDataBase referenceData = default; +<<<<<<< HEAD IDictionary featureDataTypeOverride = default; +======= + IList notificationTypes = default; + IDictionary properties = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MonitoringSignalType signalType = default; IList notificationTypes = default; IDictionary properties = default; @@ -141,6 +170,21 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("featureDataTypeOverride"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featureDataTypeOverride = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, new MonitoringFeatureDataType(property0.Value.GetString())); + } + featureDataTypeOverride = dictionary; + continue; + } if (property.NameEquals("metricThresholds"u8)) { List array = new List(); @@ -161,6 +205,7 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito referenceData = MonitoringInputDataBase.DeserializeMonitoringInputDataBase(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("featureDataTypeOverride"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -188,6 +233,15 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito notificationTypes = null; continue; } +======= + if (property.NameEquals("notificationTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationTypes = null; + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -218,10 +272,16 @@ internal static PredictionDriftMonitoringSignal DeserializePredictionDriftMonito } serializedAdditionalRawData = rawDataDictionary; return new PredictionDriftMonitoringSignal( +<<<<<<< HEAD +======= + notificationTypes ?? new ChangeTrackingList(), + properties ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 signalType, notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, + featureDataTypeOverride ?? new ChangeTrackingDictionary(), metricThresholds, productionData, referenceData, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs index 50ecebd1df47..2f0e296f8712 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PredictionDriftMonitoringSignal.cs @@ -37,6 +37,7 @@ public PredictionDriftMonitoringSignal(IEnumerable(); MetricThresholds = metricThresholds.ToList(); ProductionData = productionData; ReferenceData = referenceData; @@ -45,10 +46,16 @@ public PredictionDriftMonitoringSignal(IEnumerable Initializes a new instance of . +<<<<<<< HEAD +======= + /// The current notification mode for this signal. + /// Property dictionary. Properties can be added, but not removed or altered. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Specifies the type of signal to monitor. /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. + /// A dictionary that maps feature names to their respective data types. /// /// [Required] A list of metrics to calculate and their associated thresholds. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -64,9 +71,14 @@ public PredictionDriftMonitoringSignal(IEnumerable is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , and . /// +<<<<<<< HEAD /// A dictionary that maps feature names to their respective data types. internal PredictionDriftMonitoringSignal(MonitoringSignalType signalType, IList notificationTypes, IDictionary properties, IDictionary serializedAdditionalRawData, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData, IDictionary featureDataTypeOverride) : base(signalType, notificationTypes, properties, serializedAdditionalRawData) +======= + internal PredictionDriftMonitoringSignal(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData, IDictionary featureDataTypeOverride, IList metricThresholds, MonitoringInputDataBase productionData, MonitoringInputDataBase referenceData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { + FeatureDataTypeOverride = featureDataTypeOverride; MetricThresholds = metricThresholds; ProductionData = productionData; ReferenceData = referenceData; @@ -79,6 +91,8 @@ internal PredictionDriftMonitoringSignal() { } + /// A dictionary that maps feature names to their respective data types. + public IDictionary FeatureDataTypeOverride { get; set; } /// /// [Required] A list of metrics to calculate and their associated thresholds. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs index 01e9b4c88fa7..7e66f6fa245e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.Serialization.cs @@ -31,11 +31,31 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("destination"u8); writer.WriteObjectValue(Destination, options); } + if (Optional.IsCollectionDefined(Fqdns)) + { + writer.WritePropertyName("fqdns"u8); + writer.WriteStartArray(); + foreach (var item in Fqdns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Category)) { writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -82,7 +102,9 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu return null; } PrivateEndpointDestination destination = default; + IList fqdns = default; OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = default; IDictionary serializedAdditionalRawData = default; @@ -98,6 +120,20 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu destination = PrivateEndpointDestination.DeserializePrivateEndpointDestination(property.Value, options); continue; } + if (property.NameEquals("fqdns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + fqdns = array; + continue; + } if (property.NameEquals("category"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -107,6 +143,20 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -127,7 +177,14 @@ internal static PrivateEndpointOutboundRule DeserializePrivateEndpointOutboundRu } } serializedAdditionalRawData = rawDataDictionary; - return new PrivateEndpointOutboundRule(category, status, type, serializedAdditionalRawData, destination); + return new PrivateEndpointOutboundRule( + category, + parentRuleNames ?? new ChangeTrackingList(), + status, + type, + serializedAdditionalRawData, + destination, + fqdns ?? new ChangeTrackingList()); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs index 320e28bbee68..429377fc8c6d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/PrivateEndpointOutboundRule.cs @@ -16,22 +16,28 @@ public partial class PrivateEndpointOutboundRule : MachineLearningOutboundRule /// Initializes a new instance of . public PrivateEndpointOutboundRule() { + Fqdns = new ChangeTrackingList(); OutboundRuleType = OutboundRuleType.PrivateEndpoint; } /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. /// Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. - internal PrivateEndpointOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, PrivateEndpointDestination destination) : base(category, status, outboundRuleType, serializedAdditionalRawData) + /// + internal PrivateEndpointOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, PrivateEndpointDestination destination, IList fqdns) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { Destination = destination; + Fqdns = fqdns; OutboundRuleType = outboundRuleType; } /// Private Endpoint destination for a Private Endpoint Outbound Rule for the managed network of a machine learning workspace. public PrivateEndpointDestination Destination { get; set; } + /// Gets the fqdns. + public IList Fqdns { get; } } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.Serialization.cs new file mode 100644 index 000000000000..129c21219324 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiBlocklistConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Blocking)) + { + writer.WritePropertyName("blocking"u8); + writer.WriteBooleanValue(Blocking.Value); + } + if (Optional.IsDefined(BlocklistName)) + { + writer.WritePropertyName("blocklistName"u8); + writer.WriteStringValue(BlocklistName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistConfig(document.RootElement, options); + } + + internal static RaiBlocklistConfig DeserializeRaiBlocklistConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? blocking = default; + string blocklistName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("blocking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blocking = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("blocklistName"u8)) + { + blocklistName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistConfig(blocking, blocklistName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.cs new file mode 100644 index 000000000000..83e1be0f35fe --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistConfig.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI blocklist config. + public partial class RaiBlocklistConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiBlocklistConfig() + { + } + + /// Initializes a new instance of . + /// If blocking would occur. + /// Name of ContentFilter. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistConfig(bool? blocking, string blocklistName, IDictionary serializedAdditionalRawData) + { + Blocking = blocking; + BlocklistName = blocklistName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If blocking would occur. + public bool? Blocking { get; set; } + /// Name of ContentFilter. + public string BlocklistName { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.Serialization.cs new file mode 100644 index 000000000000..23dade87b963 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiBlocklistItemBulkRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistItemBulkRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistItemBulkRequest(document.RootElement, options); + } + + internal static RaiBlocklistItemBulkRequest DeserializeRaiBlocklistItemBulkRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + RaiBlocklistItemProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = RaiBlocklistItemProperties.DeserializeRaiBlocklistItemProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistItemBulkRequest(name, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistItemBulkRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistItemBulkRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemBulkRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.cs new file mode 100644 index 000000000000..b29c159c5854 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemBulkRequest.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The Cognitive Services RaiBlocklist Item request body. + public partial class RaiBlocklistItemBulkRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiBlocklistItemBulkRequest() + { + } + + /// Initializes a new instance of . + /// + /// Properties of Cognitive Services RaiBlocklist Item. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemBulkRequest(string name, RaiBlocklistItemProperties properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the name. + public string Name { get; set; } + /// Properties of Cognitive Services RaiBlocklist Item. + public RaiBlocklistItemProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.Serialization.cs new file mode 100644 index 000000000000..7f1f607d80f7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiBlocklistItemProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(IsRegex)) + { + writer.WritePropertyName("isRegex"u8); + writer.WriteBooleanValue(IsRegex.Value); + } + if (Optional.IsDefined(Pattern)) + { + writer.WritePropertyName("pattern"u8); + writer.WriteStringValue(Pattern); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistItemProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistItemProperties(document.RootElement, options); + } + + internal static RaiBlocklistItemProperties DeserializeRaiBlocklistItemProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? isRegex = default; + string pattern = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("isRegex"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isRegex = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("pattern"u8)) + { + pattern = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistItemProperties(isRegex, pattern, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistItemProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistItemProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.cs new file mode 100644 index 000000000000..73f38f3c677c --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// RAI Custom Blocklist Item properties. + public partial class RaiBlocklistItemProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiBlocklistItemProperties() + { + } + + /// Initializes a new instance of . + /// If the pattern is a regex pattern. + /// Pattern to match against. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemProperties(bool? isRegex, string pattern, IDictionary serializedAdditionalRawData) + { + IsRegex = isRegex; + Pattern = pattern; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If the pattern is a regex pattern. + public bool? IsRegex { get; set; } + /// Pattern to match against. + public string Pattern { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 000000000000..b0cfc60cff31 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 000000000000..44ebeba3ee01 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult. + internal partial class RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.Serialization.cs new file mode 100644 index 000000000000..13ba791cccfe --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.Serialization.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiBlocklistProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistProperties(document.RootElement, options); + } + + internal static RaiBlocklistProperties DeserializeRaiBlocklistProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistProperties(description, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.cs new file mode 100644 index 000000000000..616e6f5311a2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// RAI Custom Blocklist properties. + public partial class RaiBlocklistProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiBlocklistProperties() + { + } + + /// Initializes a new instance of . + /// Description of the block list. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistProperties(string description, IDictionary serializedAdditionalRawData) + { + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Description of the block list. + public string Description { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 000000000000..bcaa0b6f547b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class RaiBlocklistPropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistPropertiesBasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static RaiBlocklistPropertiesBasicResourceArmPaginatedResult DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistPropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistPropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 000000000000..79e77b0814ef --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiBlocklistPropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The RaiBlocklistPropertiesBasicResourceArmPaginatedResult. + internal partial class RaiBlocklistPropertiesBasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal RaiBlocklistPropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistPropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.Serialization.cs new file mode 100644 index 000000000000..e10035dd34c9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.Serialization.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiPolicyContentFilter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AllowedContentLevel)) + { + writer.WritePropertyName("allowedContentLevel"u8); + writer.WriteStringValue(AllowedContentLevel.Value.ToString()); + } + if (Optional.IsDefined(Blocking)) + { + writer.WritePropertyName("blocking"u8); + writer.WriteBooleanValue(Blocking.Value); + } + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"u8); + writer.WriteBooleanValue(Enabled.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyContentFilter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyContentFilter(document.RootElement, options); + } + + internal static RaiPolicyContentFilter DeserializeRaiPolicyContentFilter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AllowedContentLevel? allowedContentLevel = default; + bool? blocking = default; + bool? enabled = default; + string name = default; + RaiPolicyContentSource? source = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("allowedContentLevel"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + allowedContentLevel = new AllowedContentLevel(property.Value.GetString()); + continue; + } + if (property.NameEquals("blocking"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + blocking = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + source = new RaiPolicyContentSource(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyContentFilter( + allowedContentLevel, + blocking, + enabled, + name, + source, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyContentFilter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyContentFilter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyContentFilter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.cs new file mode 100644 index 000000000000..7f552a2bd145 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentFilter.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI Content Filter. + public partial class RaiPolicyContentFilter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiPolicyContentFilter() + { + } + + /// Initializes a new instance of . + /// Level at which content is filtered. + /// If blocking would occur. + /// If the ContentFilter is enabled. + /// Name of ContentFilter. + /// Content source to apply the Content Filters. + /// Keeps track of any properties unknown to the library. + internal RaiPolicyContentFilter(AllowedContentLevel? allowedContentLevel, bool? blocking, bool? enabled, string name, RaiPolicyContentSource? source, IDictionary serializedAdditionalRawData) + { + AllowedContentLevel = allowedContentLevel; + Blocking = blocking; + Enabled = enabled; + Name = name; + Source = source; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Level at which content is filtered. + public AllowedContentLevel? AllowedContentLevel { get; set; } + /// If blocking would occur. + public bool? Blocking { get; set; } + /// If the ContentFilter is enabled. + public bool? Enabled { get; set; } + /// Name of ContentFilter. + public string Name { get; set; } + /// Content source to apply the Content Filters. + public RaiPolicyContentSource? Source { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentSource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentSource.cs new file mode 100644 index 000000000000..bda93bfeeb39 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyContentSource.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Content source to apply the Content Filters. + public readonly partial struct RaiPolicyContentSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RaiPolicyContentSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PromptValue = "Prompt"; + private const string CompletionValue = "Completion"; + + /// Prompt. + public static RaiPolicyContentSource Prompt { get; } = new RaiPolicyContentSource(PromptValue); + /// Completion. + public static RaiPolicyContentSource Completion { get; } = new RaiPolicyContentSource(CompletionValue); + /// Determines if two values are the same. + public static bool operator ==(RaiPolicyContentSource left, RaiPolicyContentSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RaiPolicyContentSource left, RaiPolicyContentSource right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RaiPolicyContentSource(string value) => new RaiPolicyContentSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RaiPolicyContentSource other && Equals(other); + /// + public bool Equals(RaiPolicyContentSource other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyMode.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyMode.cs new file mode 100644 index 000000000000..2a627aafe4ad --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyMode.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Content Filters mode. + public readonly partial struct RaiPolicyMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RaiPolicyMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string DeferredValue = "Deferred"; + private const string BlockingValue = "Blocking"; + + /// Default. + public static RaiPolicyMode Default { get; } = new RaiPolicyMode(DefaultValue); + /// Deferred. + public static RaiPolicyMode Deferred { get; } = new RaiPolicyMode(DeferredValue); + /// Blocking. + public static RaiPolicyMode Blocking { get; } = new RaiPolicyMode(BlockingValue); + /// Determines if two values are the same. + public static bool operator ==(RaiPolicyMode left, RaiPolicyMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RaiPolicyMode left, RaiPolicyMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RaiPolicyMode(string value) => new RaiPolicyMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RaiPolicyMode other && Equals(other); + /// + public bool Equals(RaiPolicyMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.Serialization.cs new file mode 100644 index 000000000000..dbd6ff6d2945 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.Serialization.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RaiPolicyProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(BasePolicyName)) + { + writer.WritePropertyName("basePolicyName"u8); + writer.WriteStringValue(BasePolicyName); + } + if (Optional.IsCollectionDefined(CompletionBlocklists)) + { + writer.WritePropertyName("completionBlocklists"u8); + writer.WriteStartArray(); + foreach (var item in CompletionBlocklists) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ContentFilters)) + { + writer.WritePropertyName("contentFilters"u8); + writer.WriteStartArray(); + foreach (var item in ContentFilters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsCollectionDefined(PromptBlocklists)) + { + writer.WritePropertyName("promptBlocklists"u8); + writer.WriteStartArray(); + foreach (var item in PromptBlocklists) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PolicyType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(PolicyType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyProperties(document.RootElement, options); + } + + internal static RaiPolicyProperties DeserializeRaiPolicyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string basePolicyName = default; + IList completionBlocklists = default; + IList contentFilters = default; + RaiPolicyMode? mode = default; + IList promptBlocklists = default; + RaiPolicyType? type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("basePolicyName"u8)) + { + basePolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("completionBlocklists"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistConfig.DeserializeRaiBlocklistConfig(item, options)); + } + completionBlocklists = array; + continue; + } + if (property.NameEquals("contentFilters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiPolicyContentFilter.DeserializeRaiPolicyContentFilter(item, options)); + } + contentFilters = array; + continue; + } + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new RaiPolicyMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("promptBlocklists"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiBlocklistConfig.DeserializeRaiBlocklistConfig(item, options)); + } + promptBlocklists = array; + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new RaiPolicyType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyProperties( + basePolicyName, + completionBlocklists ?? new ChangeTrackingList(), + contentFilters ?? new ChangeTrackingList(), + mode, + promptBlocklists ?? new ChangeTrackingList(), + type, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.cs new file mode 100644 index 000000000000..051f56aa0aef --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyProperties.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI Content Filters properties. + public partial class RaiPolicyProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RaiPolicyProperties() + { + CompletionBlocklists = new ChangeTrackingList(); + ContentFilters = new ChangeTrackingList(); + PromptBlocklists = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of the base Content Filters. + /// + /// + /// Content Filters mode. + /// + /// Content Filters policy type. + /// Keeps track of any properties unknown to the library. + internal RaiPolicyProperties(string basePolicyName, IList completionBlocklists, IList contentFilters, RaiPolicyMode? mode, IList promptBlocklists, RaiPolicyType? policyType, IDictionary serializedAdditionalRawData) + { + BasePolicyName = basePolicyName; + CompletionBlocklists = completionBlocklists; + ContentFilters = contentFilters; + Mode = mode; + PromptBlocklists = promptBlocklists; + PolicyType = policyType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the base Content Filters. + public string BasePolicyName { get; set; } + /// Gets the completion blocklists. + public IList CompletionBlocklists { get; } + /// Gets the content filters. + public IList ContentFilters { get; } + /// Content Filters mode. + public RaiPolicyMode? Mode { get; set; } + /// Gets the prompt blocklists. + public IList PromptBlocklists { get; } + /// Content Filters policy type. + public RaiPolicyType? PolicyType { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.Serialization.cs new file mode 100644 index 000000000000..5b9391b3a220 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class RaiPolicyPropertiesBasicResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (Optional.IsCollectionDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyPropertiesBasicResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + + internal static RaiPolicyPropertiesBasicResourceArmPaginatedResult DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyPropertiesBasicResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyPropertiesBasicResourceArmPaginatedResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceArmPaginatedResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.cs new file mode 100644 index 000000000000..7085d0e21698 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyPropertiesBasicResourceArmPaginatedResult.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Azure OpenAI Content Filters resource list. + internal partial class RaiPolicyPropertiesBasicResourceArmPaginatedResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal RaiPolicyPropertiesBasicResourceArmPaginatedResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal RaiPolicyPropertiesBasicResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the next link. + public string NextLink { get; } + /// Gets the value. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyType.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyType.cs new file mode 100644 index 000000000000..1c9f489932e2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RaiPolicyType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Content Filters policy type. + public readonly partial struct RaiPolicyType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RaiPolicyType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserManagedValue = "UserManaged"; + private const string SystemManagedValue = "SystemManaged"; + + /// UserManaged. + public static RaiPolicyType UserManaged { get; } = new RaiPolicyType(UserManagedValue); + /// SystemManaged. + public static RaiPolicyType SystemManaged { get; } = new RaiPolicyType(SystemManagedValue); + /// Determines if two values are the same. + public static bool operator ==(RaiPolicyType left, RaiPolicyType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RaiPolicyType left, RaiPolicyType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator RaiPolicyType(string value) => new RaiPolicyType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RaiPolicyType other && Equals(other); + /// + public bool Equals(RaiPolicyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs index 47027e3002ee..0c82643acd2a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.Serialization.cs @@ -26,6 +26,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteStartObject(); +<<<<<<< HEAD +======= + if (Optional.IsDefined(Rule)) + { + writer.WritePropertyName("rule"u8); + writer.WriteStringValue(Rule.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Seed)) { if (Seed != null) @@ -83,6 +91,10 @@ internal static RandomSamplingAlgorithm DeserializeRandomSamplingAlgorithm(JsonE { return null; } +<<<<<<< HEAD +======= + RandomSamplingAlgorithmRule? rule = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 int? seed = default; RandomSamplingAlgorithmRule? rule = default; SamplingAlgorithmType samplingAlgorithmType = default; @@ -90,6 +102,7 @@ internal static RandomSamplingAlgorithm DeserializeRandomSamplingAlgorithm(JsonE Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("seed"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -100,6 +113,8 @@ internal static RandomSamplingAlgorithm DeserializeRandomSamplingAlgorithm(JsonE seed = property.Value.GetInt32(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("rule"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -120,7 +135,11 @@ internal static RandomSamplingAlgorithm DeserializeRandomSamplingAlgorithm(JsonE } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new RandomSamplingAlgorithm(samplingAlgorithmType, serializedAdditionalRawData, seed, rule); +======= + return new RandomSamplingAlgorithm(samplingAlgorithmType, serializedAdditionalRawData, rule, seed); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs index 10c37a08d96f..ee3c41c11900 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RandomSamplingAlgorithm.cs @@ -22,15 +22,28 @@ public RandomSamplingAlgorithm() /// Initializes a new instance of . /// [Required] The algorithm used for generating hyperparameter values, along with configuration properties. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// An optional integer to use as the seed for random number generation. /// The specific type of random algorithm. internal RandomSamplingAlgorithm(SamplingAlgorithmType samplingAlgorithmType, IDictionary serializedAdditionalRawData, int? seed, RandomSamplingAlgorithmRule? rule) : base(samplingAlgorithmType, serializedAdditionalRawData) { +======= + /// The specific type of random algorithm. + /// An optional integer to use as the seed for random number generation. + internal RandomSamplingAlgorithm(SamplingAlgorithmType samplingAlgorithmType, IDictionary serializedAdditionalRawData, RandomSamplingAlgorithmRule? rule, int? seed) : base(samplingAlgorithmType, serializedAdditionalRawData) + { + Rule = rule; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Seed = seed; Rule = rule; SamplingAlgorithmType = samplingAlgorithmType; } +<<<<<<< HEAD +======= + /// The specific type of random algorithm. + public RandomSamplingAlgorithmRule? Rule { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// An optional integer to use as the seed for random number generation. public int? Seed { get; set; } /// The specific type of random algorithm. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.Serialization.cs new file mode 100644 index 000000000000..8d991ab0329e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class RegenerateServiceAccountKeyContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(KeyName)) + { + writer.WritePropertyName("keyName"u8); + writer.WriteStringValue(KeyName.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RegenerateServiceAccountKeyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRegenerateServiceAccountKeyContent(document.RootElement, options); + } + + internal static RegenerateServiceAccountKeyContent DeserializeRegenerateServiceAccountKeyContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServiceAccountKeyName? keyName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyName = new ServiceAccountKeyName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RegenerateServiceAccountKeyContent(keyName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support writing '{options.Format}' format."); + } + } + + RegenerateServiceAccountKeyContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRegenerateServiceAccountKeyContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RegenerateServiceAccountKeyContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.cs new file mode 100644 index 000000000000..a4d96f697c97 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegenerateServiceAccountKeyContent.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The RegenerateServiceAccountKeyContent. + public partial class RegenerateServiceAccountKeyContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RegenerateServiceAccountKeyContent() + { + } + + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal RegenerateServiceAccountKeyContent(ServiceAccountKeyName? keyName, IDictionary serializedAdditionalRawData) + { + KeyName = keyName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the key name. + public ServiceAccountKeyName? KeyName { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs index c0edfc28b528..27f393512b05 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.Serialization.cs @@ -97,11 +97,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WritePropertyName("enableModelExplainability"u8); writer.WriteBooleanValue(IsModelExplainabilityEnabled.Value); } +<<<<<<< HEAD if (Optional.IsDefined(IsDnnTrainingEnabled)) { writer.WritePropertyName("enableDnnTraining"u8); writer.WriteBooleanValue(IsDnnTrainingEnabled.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -147,8 +150,12 @@ internal static RegressionTrainingSettings DeserializeRegressionTrainingSettings bool? enableStackEnsemble = default; bool? enableVoteEnsemble = default; TimeSpan? ensembleModelDownloadTimeout = default; +<<<<<<< HEAD bool? enableModelExplainability = default; bool? enableDnnTraining = default; +======= + MachineLearningStackEnsembleSettings stackEnsembleSettings = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -238,6 +245,7 @@ internal static RegressionTrainingSettings DeserializeRegressionTrainingSettings enableModelExplainability = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("enableDnnTraining"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -247,6 +255,8 @@ internal static RegressionTrainingSettings DeserializeRegressionTrainingSettings enableDnnTraining = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -259,8 +269,12 @@ internal static RegressionTrainingSettings DeserializeRegressionTrainingSettings enableStackEnsemble, enableVoteEnsemble, ensembleModelDownloadTimeout, +<<<<<<< HEAD enableModelExplainability, enableDnnTraining, +======= + stackEnsembleSettings, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, allowedTrainingAlgorithms ?? new ChangeTrackingList(), blockedTrainingAlgorithms ?? new ChangeTrackingList()); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs index 41395defd650..10e789911d5b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RegressionTrainingSettings.cs @@ -29,12 +29,20 @@ public RegressionTrainingSettings() /// During VotingEnsemble and StackEnsemble model generation, multiple fitted models from the previous child runs are downloaded. /// Configure this parameter with a higher value than 300 secs, if more time is needed. /// +<<<<<<< HEAD /// Flag to turn on explainability on best model. /// Enable recommendation of DNN models. /// Keeps track of any properties unknown to the library. /// Allowed models for regression task. /// Blocked models for regression task. internal RegressionTrainingSettings(bool? isOnnxCompatibleModelsEnabled, MachineLearningStackEnsembleSettings stackEnsembleSettings, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, bool? isModelExplainabilityEnabled, bool? isDnnTrainingEnabled, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isOnnxCompatibleModelsEnabled, stackEnsembleSettings, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, isModelExplainabilityEnabled, isDnnTrainingEnabled, serializedAdditionalRawData) +======= + /// Stack ensemble settings for stack ensemble run. + /// Keeps track of any properties unknown to the library. + /// Allowed models for regression task. + /// Blocked models for regression task. + internal RegressionTrainingSettings(bool? isDnnTrainingEnabled, bool? isModelExplainabilityEnabled, bool? isOnnxCompatibleModelsEnabled, bool? isStackEnsembleEnabled, bool? isVoteEnsembleEnabled, TimeSpan? ensembleModelDownloadTimeout, MachineLearningStackEnsembleSettings stackEnsembleSettings, IDictionary serializedAdditionalRawData, IList allowedTrainingAlgorithms, IList blockedTrainingAlgorithms) : base(isDnnTrainingEnabled, isModelExplainabilityEnabled, isOnnxCompatibleModelsEnabled, isStackEnsembleEnabled, isVoteEnsembleEnabled, ensembleModelDownloadTimeout, stackEnsembleSettings, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { AllowedTrainingAlgorithms = allowedTrainingAlgorithms; BlockedTrainingAlgorithms = blockedTrainingAlgorithms; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.Serialization.cs new file mode 100644 index 000000000000..8f3648662266 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.Serialization.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ResizeSchema : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResizeSchema)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(TargetVmSize)) + { + writer.WritePropertyName("targetVMSize"u8); + writer.WriteStringValue(TargetVmSize); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ResizeSchema IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResizeSchema)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResizeSchema(document.RootElement, options); + } + + internal static ResizeSchema DeserializeResizeSchema(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string targetVmSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetVMSize"u8)) + { + targetVmSize = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResizeSchema(targetVmSize, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResizeSchema)} does not support writing '{options.Format}' format."); + } + } + + ResizeSchema IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResizeSchema(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResizeSchema)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.cs new file mode 100644 index 000000000000..be33ee73ef45 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ResizeSchema.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Schema for Compute Instance resize. + public partial class ResizeSchema + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public ResizeSchema() + { + } + + /// Initializes a new instance of . + /// The name of the virtual machine size. + /// Keeps track of any properties unknown to the library. + internal ResizeSchema(string targetVmSize, IDictionary serializedAdditionalRawData) + { + TargetVmSize = targetVmSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the virtual machine size. + public string TargetVmSize { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.Serialization.cs index 61a6211bc43d..bc688079084f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.Serialization.cs @@ -195,6 +195,11 @@ internal static RollingInputData DeserializeRollingInputData(JsonElement element } serializedAdditionalRawData = rawDataDictionary; return new RollingInputData( +<<<<<<< HEAD +======= + columns ?? new ChangeTrackingDictionary(), + dataContext, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 inputDataType, dataContext, jobInputType, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.cs index 09b458411659..1c4cf816ae7b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/RollingInputData.cs @@ -29,16 +29,28 @@ public RollingInputData(JobInputType jobInputType, Uri uri, TimeSpan windowOffse } /// Initializes a new instance of . +<<<<<<< HEAD +======= + /// Mapping of column names to special uses. + /// The context metadata of the data source. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Specifies the type of signal to monitor. /// The context metadata of the data source. /// [Required] Specifies the type of job. /// [Required] Input Asset URI. /// Mapping of column names to special uses. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// [Required] The time offset between the end of the data window and the monitor's current run time. /// [Required] The size of the rolling data window. /// Reference to the component asset used to preprocess the data. internal RollingInputData(MonitoringInputDataType inputDataType, string dataContext, JobInputType jobInputType, Uri uri, IDictionary columns, IDictionary serializedAdditionalRawData, TimeSpan windowOffset, TimeSpan windowSize, string preprocessingComponentId) : base(inputDataType, dataContext, jobInputType, uri, columns, serializedAdditionalRawData) +======= + /// Reference to the component asset used to preprocess the data. + /// [Required] The time offset between the end of the data window and the monitor's current run time. + /// [Required] The size of the rolling data window. + internal RollingInputData(IDictionary columns, string dataContext, MonitoringInputDataType inputDataType, JobInputType jobInputType, Uri uri, IDictionary serializedAdditionalRawData, string preprocessingComponentId, TimeSpan windowOffset, TimeSpan windowSize) : base(columns, dataContext, inputDataType, jobInputType, uri, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { WindowOffset = windowOffset; WindowSize = windowSize; @@ -51,6 +63,11 @@ internal RollingInputData() { } +<<<<<<< HEAD +======= + /// Reference to the component asset used to preprocess the data. + public string PreprocessingComponentId { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] The time offset between the end of the data window and the monitor's current run time. public TimeSpan WindowOffset { get; set; } /// [Required] The size of the rolling data window. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.Serialization.cs new file mode 100644 index 000000000000..309ee71ea33a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class SecretExpiry : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecretExpiry)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ExpirableSecret)) + { + writer.WritePropertyName("expirableSecret"u8); + writer.WriteBooleanValue(ExpirableSecret.Value); + } + if (Optional.IsDefined(ExpireAfterHours)) + { + writer.WritePropertyName("expireAfterHours"u8); + writer.WriteNumberValue(ExpireAfterHours.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SecretExpiry IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SecretExpiry)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSecretExpiry(document.RootElement, options); + } + + internal static SecretExpiry DeserializeSecretExpiry(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? expirableSecret = default; + int? expireAfterHours = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expirableSecret"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirableSecret = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("expireAfterHours"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expireAfterHours = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SecretExpiry(expirableSecret, expireAfterHours, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SecretExpiry)} does not support writing '{options.Format}' format."); + } + } + + SecretExpiry IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSecretExpiry(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SecretExpiry)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs new file mode 100644 index 000000000000..0b10f2e612a7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs + /// The ServerlessComputeSettings. + public partial class ServerlessComputeSettings +======== + /// Secret expiration configuration. + public partial class SecretExpiry +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs + /// Initializes a new instance of . + public ServerlessComputeSettings() + { + } + + /// Initializes a new instance of . + /// The resource ID of an existing virtual network subnet in which serverless compute nodes should be deployed. + /// The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace with private endpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessComputeSettings(ResourceIdentifier serverlessComputeCustomSubnet, bool? hasNoPublicIP, IDictionary serializedAdditionalRawData) + { + ServerlessComputeCustomSubnet = serverlessComputeCustomSubnet; + HasNoPublicIP = hasNoPublicIP; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource ID of an existing virtual network subnet in which serverless compute nodes should be deployed. + public ResourceIdentifier ServerlessComputeCustomSubnet { get; set; } + /// The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace with private endpoint. + public bool? HasNoPublicIP { get; set; } +======== + /// Initializes a new instance of . + public SecretExpiry() + { + } + + /// Initializes a new instance of . + /// Indicates if the secret is expirable. + /// Number of hours after which the secret will expire. + /// Keeps track of any properties unknown to the library. + internal SecretExpiry(bool? expirableSecret, int? expireAfterHours, IDictionary serializedAdditionalRawData) + { + ExpirableSecret = expirableSecret; + ExpireAfterHours = expireAfterHours; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates if the secret is expirable. + public bool? ExpirableSecret { get; set; } + /// Number of hours after which the secret will expire. + public int? ExpireAfterHours { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs index 69489e0b57f7..0ca657195233 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs @@ -11,8 +11,9 @@ using System.Text.Json; using Azure.Core; -namespace Azure.ResourceManager.MachineLearning.Models +namespace Azure.ResourceManager.ComputeFleet.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs public partial class ServerlessComputeSettings : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -35,6 +36,27 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea { writer.WritePropertyName("serverlessComputeNoPublicIP"u8); writer.WriteBooleanValue(HasNoPublicIP.Value); +======== + public partial class ComputeFleetVmSizeProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Rank)) + { + writer.WritePropertyName("rank"u8); + writer.WriteNumberValue(Rank.Value); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -54,6 +76,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndObject(); } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs ServerlessComputeSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -67,6 +90,21 @@ ServerlessComputeSettings IJsonModel.Create(ref Utf8J } internal static ServerlessComputeSettings DeserializeServerlessComputeSettings(JsonElement element, ModelReaderWriterOptions options = null) +======== + ComputeFleetVmSizeProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmSizeProfile(document.RootElement, options); + } + + internal static ComputeFleetVmSizeProfile DeserializeComputeFleetVmSizeProfile(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs { options ??= ModelSerializationExtensions.WireOptions; @@ -74,18 +112,33 @@ internal static ServerlessComputeSettings DeserializeServerlessComputeSettings(J { return null; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs ResourceIdentifier serverlessComputeCustomSubnet = default; bool? serverlessComputeNoPublicIP = default; +======== + string name = default; + int? rank = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs if (property.NameEquals("serverlessComputeCustomSubnet"u8)) +======== + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("rank"u8)) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs serverlessComputeCustomSubnet = new ResourceIdentifier(property.Value.GetString()); continue; } @@ -96,6 +149,9 @@ internal static ServerlessComputeSettings DeserializeServerlessComputeSettings(J continue; } serverlessComputeNoPublicIP = property.Value.GetBoolean(); +======== + rank = property.Value.GetInt32(); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs continue; } if (options.Format != "W") @@ -104,18 +160,28 @@ internal static ServerlessComputeSettings DeserializeServerlessComputeSettings(J } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs return new ServerlessComputeSettings(serverlessComputeCustomSubnet, serverlessComputeNoPublicIP, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new ComputeFleetVmSizeProfile(name, rank, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs throw new FormatException($"The model {nameof(ServerlessComputeSettings)} does not support writing '{options.Format}' format."); } } @@ -123,12 +189,22 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO ServerlessComputeSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProfile)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmSizeProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.Serialization.cs return DeserializeServerlessComputeSettings(document.RootElement, options); } default: @@ -137,5 +213,15 @@ ServerlessComputeSettings IPersistableModel.Create(Bi } string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== + return DeserializeComputeFleetVmSizeProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmSizeProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmSizeProfile.Serialization.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs index d67ba3404645..0b10f2e612a7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs @@ -11,8 +11,13 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs /// The ServerlessComputeSettings. public partial class ServerlessComputeSettings +======== + /// Secret expiration configuration. + public partial class SecretExpiry +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs { /// /// Keeps track of any properties unknown to the library. @@ -46,6 +51,7 @@ public partial class ServerlessComputeSettings /// private IDictionary _serializedAdditionalRawData; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessComputeSettings.cs /// Initializes a new instance of . public ServerlessComputeSettings() { @@ -66,5 +72,27 @@ internal ServerlessComputeSettings(ResourceIdentifier serverlessComputeCustomSub public ResourceIdentifier ServerlessComputeCustomSubnet { get; set; } /// The flag to signal if serverless compute nodes deployed in custom vNet would have no public IP addresses for a workspace with private endpoint. public bool? HasNoPublicIP { get; set; } +======== + /// Initializes a new instance of . + public SecretExpiry() + { + } + + /// Initializes a new instance of . + /// Indicates if the secret is expirable. + /// Number of hours after which the secret will expire. + /// Keeps track of any properties unknown to the library. + internal SecretExpiry(bool? expirableSecret, int? expireAfterHours, IDictionary serializedAdditionalRawData) + { + ExpirableSecret = expirableSecret; + ExpireAfterHours = expireAfterHours; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates if the secret is expirable. + public bool? ExpirableSecret { get; set; } + /// Number of hours after which the secret will expire. + public int? ExpireAfterHours { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SecretExpiry.cs } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.Serialization.cs new file mode 100644 index 000000000000..554e4ef63965 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ServerlessEndpointCapacityReservation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("capacityReservationGroupId"u8); + writer.WriteStringValue(CapacityReservationGroupId); + if (Optional.IsDefined(EndpointReservedCapacity)) + { + writer.WritePropertyName("endpointReservedCapacity"u8); + writer.WriteNumberValue(EndpointReservedCapacity.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointCapacityReservation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointCapacityReservation(document.RootElement, options); + } + + internal static ServerlessEndpointCapacityReservation DeserializeServerlessEndpointCapacityReservation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string capacityReservationGroupId = default; + int? endpointReservedCapacity = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("capacityReservationGroupId"u8)) + { + capacityReservationGroupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpointReservedCapacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointReservedCapacity = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointCapacityReservation(capacityReservationGroupId, endpointReservedCapacity, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointCapacityReservation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointCapacityReservation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointCapacityReservation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.cs new file mode 100644 index 000000000000..98f81305c722 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointCapacityReservation.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessEndpointCapacityReservation. + public partial class ServerlessEndpointCapacityReservation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// is null. + public ServerlessEndpointCapacityReservation(string capacityReservationGroupId) + { + Argument.AssertNotNull(capacityReservationGroupId, nameof(capacityReservationGroupId)); + + CapacityReservationGroupId = capacityReservationGroupId; + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointCapacityReservation(string capacityReservationGroupId, int? endpointReservedCapacity, IDictionary serializedAdditionalRawData) + { + CapacityReservationGroupId = capacityReservationGroupId; + EndpointReservedCapacity = endpointReservedCapacity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointCapacityReservation() + { + } + + /// Gets or sets the capacity reservation group id. + public string CapacityReservationGroupId { get; set; } + /// Gets or sets the endpoint reserved capacity. + public int? EndpointReservedCapacity { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.Serialization.cs new file mode 100644 index 000000000000..4aa4b25d79b8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class ServerlessEndpointContentSafety : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("contentSafetyStatus"u8); + writer.WriteStringValue(ContentSafetyStatus.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointContentSafety IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointContentSafety(document.RootElement, options); + } + + internal static ServerlessEndpointContentSafety DeserializeServerlessEndpointContentSafety(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ContentSafetyStatus contentSafetyStatus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("contentSafetyStatus"u8)) + { + contentSafetyStatus = new ContentSafetyStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointContentSafety(contentSafetyStatus, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointContentSafety IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointContentSafety(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointContentSafety)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs new file mode 100644 index 000000000000..ab408c35eed2 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.cs + /// The Private Endpoint resource. + public partial class MachineLearningPrivateEndpoint +======== + /// The ServerlessEndpointContentSafety. + internal partial class ServerlessEndpointContentSafety +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Customized/Models/MachineLearningPrivateEndpoint.cs + /// Initializes a new instance of . + public MachineLearningPrivateEndpoint() + { + } + + /// Initializes a new instance of . + /// e.g. /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. + /// The subnetId that the private endpoint is connected to. + /// Keeps track of any properties unknown to the library. + internal MachineLearningPrivateEndpoint(ResourceIdentifier id, ResourceIdentifier subnetArmId, IDictionary serializedAdditionalRawData) + { + Id = id; + SubnetArmId = subnetArmId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// e.g. /subscriptions/{networkSubscriptionId}/resourceGroups/{rgName}/providers/Microsoft.Network/privateEndpoints/{privateEndpointName}. + public ResourceIdentifier Id { get; } + /// The subnetId that the private endpoint is connected to. + public ResourceIdentifier SubnetArmId { get; } +======== + /// Initializes a new instance of . + /// Specifies the status of content safety. + public ServerlessEndpointContentSafety(ContentSafetyStatus contentSafetyStatus) + { + ContentSafetyStatus = contentSafetyStatus; + } + + /// Initializes a new instance of . + /// Specifies the status of content safety. + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointContentSafety(ContentSafetyStatus contentSafetyStatus, IDictionary serializedAdditionalRawData) + { + ContentSafetyStatus = contentSafetyStatus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointContentSafety() + { + } + + /// Specifies the status of content safety. + public ContentSafetyStatus ContentSafetyStatus { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointContentSafety.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.Serialization.cs new file mode 100644 index 000000000000..a6b10fe0200f --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ServerlessEndpointInferenceEndpoint : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsCollectionDefined(Headers)) + { + writer.WritePropertyName("headers"u8); + writer.WriteStartObject(); + foreach (var item in Headers) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointInferenceEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointInferenceEndpoint(document.RootElement, options); + } + + internal static ServerlessEndpointInferenceEndpoint DeserializeServerlessEndpointInferenceEndpoint(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary headers = default; + Uri uri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("headers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + headers = dictionary; + continue; + } + if (property.NameEquals("uri"u8)) + { + uri = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointInferenceEndpoint(headers ?? new ChangeTrackingDictionary(), uri, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointInferenceEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointInferenceEndpoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointInferenceEndpoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.cs new file mode 100644 index 000000000000..eb530c9162ab --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointInferenceEndpoint.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessEndpointInferenceEndpoint. + public partial class ServerlessEndpointInferenceEndpoint + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// is null. + public ServerlessEndpointInferenceEndpoint(Uri uri) + { + Argument.AssertNotNull(uri, nameof(uri)); + + Headers = new ChangeTrackingDictionary(); + Uri = uri; + } + + /// Initializes a new instance of . + /// Dictionary of <string>. + /// + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointInferenceEndpoint(IReadOnlyDictionary headers, Uri uri, IDictionary serializedAdditionalRawData) + { + Headers = headers; + Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointInferenceEndpoint() + { + } + + /// Dictionary of <string>. + public IReadOnlyDictionary Headers { get; } + /// Gets or sets the uri. + public Uri Uri { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.Serialization.cs new file mode 100644 index 000000000000..33387b645913 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class ServerlessEndpointModelSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelId"u8); + writer.WriteStringValue(ModelId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointModelSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointModelSettings(document.RootElement, options); + } + + internal static ServerlessEndpointModelSettings DeserializeServerlessEndpointModelSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string modelId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelId"u8)) + { + modelId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointModelSettings(modelId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointModelSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointModelSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointModelSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs new file mode 100644 index 000000000000..c9cca4dbb1cd --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs + /// Publishing destination registry asset information. + public partial class DestinationAsset +======== + /// The ServerlessEndpointModelSettings. + internal partial class ServerlessEndpointModelSettings +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs + /// Initializes a new instance of . + public DestinationAsset() +======== + /// Initializes a new instance of . + /// + /// is null. + public ServerlessEndpointModelSettings(string modelId) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs + { + Argument.AssertNotNull(modelId, nameof(modelId)); + + ModelId = modelId; + } + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/DestinationAsset.cs + /// Initializes a new instance of . + /// Destination registry name. + /// Destination asset name. + /// Destination asset version. + /// Keeps track of any properties unknown to the library. + internal DestinationAsset(string registryName, string destinationName, string destinationVersion, IDictionary serializedAdditionalRawData) + { + RegistryName = registryName; + DestinationName = destinationName; + DestinationVersion = destinationVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Destination registry name. + public string RegistryName { get; set; } + /// Destination asset name. + public string DestinationName { get; set; } + /// Destination asset version. + public string DestinationVersion { get; set; } +======== + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointModelSettings(string modelId, IDictionary serializedAdditionalRawData) + { + ModelId = modelId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessEndpointModelSettings() + { + } + + /// Gets or sets the model id. + public string ModelId { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointModelSettings.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.Serialization.cs index fff983b42e84..66aa2aa63ea9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.Serialization.cs @@ -26,6 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteStartObject(); +<<<<<<< HEAD if (Optional.IsDefined(Sku)) { writer.WritePropertyName("sku"u8); @@ -35,6 +36,17 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade { writer.WritePropertyName("identity"u8); writer.WriteObjectValue(Identity, options); +======= + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsCollectionDefined(Tags)) { @@ -85,29 +97,49 @@ internal static ServerlessEndpointPatch DeserializeServerlessEndpointPatch(JsonE { return null; } +<<<<<<< HEAD MachineLearningSkuPatch sku = default; MachineLearningPartialManagedServiceIdentity identity = default; +======= + MachineLearningPartialManagedServiceIdentity identity = default; + MachineLearningSkuPatch sku = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary tags = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("sku"u8)) +======= + if (property.NameEquals("identity"u8)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } +<<<<<<< HEAD sku = MachineLearningSkuPatch.DeserializeMachineLearningSkuPatch(property.Value, options); continue; } if (property.NameEquals("identity"u8)) +======= + identity = MachineLearningPartialManagedServiceIdentity.DeserializeMachineLearningPartialManagedServiceIdentity(property.Value, options); + continue; + } + if (property.NameEquals("sku"u8)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } +<<<<<<< HEAD identity = MachineLearningPartialManagedServiceIdentity.DeserializeMachineLearningPartialManagedServiceIdentity(property.Value, options); +======= + sku = MachineLearningSkuPatch.DeserializeMachineLearningSkuPatch(property.Value, options); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("tags"u8)) @@ -130,7 +162,11 @@ internal static ServerlessEndpointPatch DeserializeServerlessEndpointPatch(JsonE } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new ServerlessEndpointPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, sku, identity); +======= + return new ServerlessEndpointPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, identity, sku); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs index a37be451cc5b..467866637728 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointPatch.cs @@ -21,6 +21,7 @@ public ServerlessEndpointPatch() /// Initializes a new instance of . /// Resource tags. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Sku details required for ARM contract for Autoscaling. /// Managed service identity (system assigned and/or user assigned identities). internal ServerlessEndpointPatch(IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningSkuPatch sku, MachineLearningPartialManagedServiceIdentity identity) : base(tags, serializedAdditionalRawData) @@ -33,5 +34,19 @@ internal ServerlessEndpointPatch(IDictionary tags, IDictionary Managed service identity (system assigned and/or user assigned identities). public MachineLearningPartialManagedServiceIdentity Identity { get; set; } +======= + /// Managed service identity (system assigned and/or user assigned identities). + /// Sku details required for ARM contract for Autoscaling. + internal ServerlessEndpointPatch(IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningPartialManagedServiceIdentity identity, MachineLearningSkuPatch sku) : base(tags, serializedAdditionalRawData) + { + Identity = identity; + Sku = sku; + } + + /// Managed service identity (system assigned and/or user assigned identities). + public MachineLearningPartialManagedServiceIdentity Identity { get; set; } + /// Sku details required for ARM contract for Autoscaling. + public MachineLearningSkuPatch Sku { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs index 364e09f1104c..dde6baaf8d07 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.Serialization.cs @@ -26,6 +26,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); +<<<<<<< HEAD if (Optional.IsDefined(ModelSettings)) { if (ModelSettings != null) @@ -40,6 +41,27 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WritePropertyName("authMode"u8); writer.WriteStringValue(AuthMode.ToString()); +======= + writer.WritePropertyName("authMode"u8); + writer.WriteStringValue(AuthMode.ToString()); + if (Optional.IsDefined(ContentSafety)) + { + if (ContentSafety != null) + { + writer.WritePropertyName("contentSafety"u8); + writer.WriteObjectValue(ContentSafety, options); + } + else + { + writer.WriteNull("contentSafety"); + } + } + if (options.Format != "W" && Optional.IsDefined(EndpointState)) + { + writer.WritePropertyName("endpointState"u8); + writer.WriteStringValue(EndpointState.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && Optional.IsDefined(InferenceEndpoint)) { if (InferenceEndpoint != null) @@ -52,6 +74,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("inferenceEndpoint"); } } +<<<<<<< HEAD if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -62,6 +85,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("endpointState"u8); writer.WriteStringValue(EndpointState.Value.ToString()); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && Optional.IsDefined(MarketplaceSubscriptionId)) { if (MarketplaceSubscriptionId != null) @@ -74,6 +99,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("marketplaceSubscriptionId"); } } +<<<<<<< HEAD if (Optional.IsDefined(ContentSafety)) { if (ContentSafety != null) @@ -86,6 +112,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("contentSafety"); } } +======= + if (Optional.IsDefined(ModelSettings)) + { + if (ModelSettings != null) + { + writer.WritePropertyName("modelSettings"u8); + writer.WriteObjectValue(ModelSettings, options); + } + else + { + writer.WriteNull("modelSettings"); + } + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -124,6 +169,7 @@ internal static ServerlessEndpointProperties DeserializeServerlessEndpointProper { return null; } +<<<<<<< HEAD ModelSettings modelSettings = default; ServerlessInferenceEndpointAuthMode authMode = default; ServerlessInferenceEndpoint inferenceEndpoint = default; @@ -131,10 +177,20 @@ internal static ServerlessEndpointProperties DeserializeServerlessEndpointProper ServerlessEndpointState? endpointState = default; string marketplaceSubscriptionId = default; ContentSafety contentSafety = default; +======= + ServerlessInferenceEndpointAuthMode authMode = default; + ContentSafety contentSafety = default; + ServerlessEndpointState? endpointState = default; + ServerlessInferenceEndpoint inferenceEndpoint = default; + string marketplaceSubscriptionId = default; + ModelSettings modelSettings = default; + MachineLearningEndpointProvisioningState? provisioningState = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("modelSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -145,11 +201,14 @@ internal static ServerlessEndpointProperties DeserializeServerlessEndpointProper modelSettings = ModelSettings.DeserializeModelSettings(property.Value, options); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("authMode"u8)) { authMode = new ServerlessInferenceEndpointAuthMode(property.Value.GetString()); continue; } +<<<<<<< HEAD if (property.NameEquals("inferenceEndpoint"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -188,6 +247,8 @@ internal static ServerlessEndpointProperties DeserializeServerlessEndpointProper marketplaceSubscriptionId = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("contentSafety"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -198,6 +259,57 @@ internal static ServerlessEndpointProperties DeserializeServerlessEndpointProper contentSafety = ContentSafety.DeserializeContentSafety(property.Value, options); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("endpointState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointState = new ServerlessEndpointState(property.Value.GetString()); + continue; + } + if (property.NameEquals("inferenceEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + inferenceEndpoint = null; + continue; + } + inferenceEndpoint = ServerlessInferenceEndpoint.DeserializeServerlessInferenceEndpoint(property.Value, options); + continue; + } + if (property.NameEquals("marketplaceSubscriptionId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + marketplaceSubscriptionId = null; + continue; + } + marketplaceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("modelSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + modelSettings = null; + continue; + } + modelSettings = ModelSettings.DeserializeModelSettings(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MachineLearningEndpointProvisioningState(property.Value.GetString()); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -205,6 +317,7 @@ internal static ServerlessEndpointProperties DeserializeServerlessEndpointProper } serializedAdditionalRawData = rawDataDictionary; return new ServerlessEndpointProperties( +<<<<<<< HEAD modelSettings, authMode, inferenceEndpoint, @@ -212,6 +325,15 @@ internal static ServerlessEndpointProperties DeserializeServerlessEndpointProper endpointState, marketplaceSubscriptionId, contentSafety, +======= + authMode, + contentSafety, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + modelSettings, + provisioningState, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs index 749efb075a19..abbbe256dccc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointProperties.cs @@ -53,6 +53,7 @@ public ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode authMode } /// Initializes a new instance of . +<<<<<<< HEAD /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. /// [Required] Specifies the authentication mode for the Serverless endpoint. /// The inference uri to target when making requests against the serverless endpoint. @@ -70,6 +71,25 @@ internal ServerlessEndpointProperties(ModelSettings modelSettings, ServerlessInf EndpointState = endpointState; MarketplaceSubscriptionId = marketplaceSubscriptionId; ContentSafety = contentSafety; +======= + /// [Required] Specifies the authentication mode for the Serverless endpoint. + /// Specifies the content safety options. If omitted, the default content safety settings will be configured. + /// The current state of the ServerlessEndpoint. + /// The inference uri to target when making requests against the serverless endpoint. + /// The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. + /// Provisioning state for the endpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointProperties(ServerlessInferenceEndpointAuthMode authMode, ContentSafety contentSafety, ServerlessEndpointState? endpointState, ServerlessInferenceEndpoint inferenceEndpoint, string marketplaceSubscriptionId, ModelSettings modelSettings, MachineLearningEndpointProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + AuthMode = authMode; + ContentSafety = contentSafety; + EndpointState = endpointState; + InferenceEndpoint = inferenceEndpoint; + MarketplaceSubscriptionId = marketplaceSubscriptionId; + ModelSettings = modelSettings; + ProvisioningState = provisioningState; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -78,6 +98,29 @@ internal ServerlessEndpointProperties() { } +<<<<<<< HEAD +======= + /// [Required] Specifies the authentication mode for the Serverless endpoint. + public ServerlessInferenceEndpointAuthMode AuthMode { get; set; } + /// Specifies the content safety options. If omitted, the default content safety settings will be configured. + internal ContentSafety ContentSafety { get; set; } + /// [Required] Specifies the status of content safety. + public ContentSafetyStatus? ContentSafetyStatus + { + get => ContentSafety is null ? default(ContentSafetyStatus?) : ContentSafety.ContentSafetyStatus; + set + { + ContentSafety = value.HasValue ? new ContentSafety(value.Value) : null; + } + } + + /// The current state of the ServerlessEndpoint. + public ServerlessEndpointState? EndpointState { get; } + /// The inference uri to target when making requests against the serverless endpoint. + public ServerlessInferenceEndpoint InferenceEndpoint { get; } + /// The MarketplaceSubscription Azure ID associated to this ServerlessEndpoint. + public string MarketplaceSubscriptionId { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The model settings (model id) for the model being serviced on the ServerlessEndpoint. internal ModelSettings ModelSettings { get; set; } /// The unique model identifier that this ServerlessEndpoint should provision. @@ -92,6 +135,7 @@ public string ModelId } } +<<<<<<< HEAD /// [Required] Specifies the authentication mode for the Serverless endpoint. public ServerlessInferenceEndpointAuthMode AuthMode { get; set; } /// The inference uri to target when making requests against the serverless endpoint. @@ -113,5 +157,9 @@ public ContentSafetyStatus? ContentSafetyStatus ContentSafety = value.HasValue ? new ContentSafety(value.Value) : null; } } +======= + /// Provisioning state for the endpoint. + public MachineLearningEndpointProvisioningState? ProvisioningState { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.Serialization.cs new file mode 100644 index 000000000000..52b5229b2826 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.Serialization.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ServerlessEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AuthMode)) + { + writer.WritePropertyName("authMode"u8); + writer.WriteStringValue(AuthMode.Value.ToString()); + } + if (Optional.IsDefined(CapacityReservation)) + { + writer.WritePropertyName("capacityReservation"u8); + writer.WriteObjectValue(CapacityReservation, options); + } + if (Optional.IsDefined(ContentSafety)) + { + writer.WritePropertyName("contentSafety"u8); + writer.WriteObjectValue(ContentSafety, options); + } + if (Optional.IsDefined(EndpointState)) + { + writer.WritePropertyName("endpointState"u8); + writer.WriteStringValue(EndpointState.Value.ToString()); + } + if (Optional.IsDefined(InferenceEndpoint)) + { + writer.WritePropertyName("inferenceEndpoint"u8); + writer.WriteObjectValue(InferenceEndpoint, options); + } + if (Optional.IsDefined(MarketplaceSubscriptionId)) + { + writer.WritePropertyName("marketplaceSubscriptionId"u8); + writer.WriteStringValue(MarketplaceSubscriptionId); + } + if (Optional.IsDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Metadata); +#else + using (JsonDocument document = JsonDocument.Parse(Metadata)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (Optional.IsDefined(ModelSettings)) + { + writer.WritePropertyName("modelSettings"u8); + writer.WriteObjectValue(ModelSettings, options); + } + if (Optional.IsDefined(Offer)) + { + writer.WritePropertyName("offer"u8); + writer.WriteObjectValue(Offer, options); + } + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessEndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessEndpointResourceProperties(document.RootElement, options); + } + + internal static ServerlessEndpointResourceProperties DeserializeServerlessEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ServerlessInferenceEndpointAuthMode? authMode = default; + ServerlessEndpointCapacityReservation capacityReservation = default; + ServerlessEndpointContentSafety contentSafety = default; + ServerlessEndpointState? endpointState = default; + ServerlessEndpointInferenceEndpoint inferenceEndpoint = default; + string marketplaceSubscriptionId = default; + BinaryData metadata = default; + ServerlessEndpointModelSettings modelSettings = default; + ServerlessOffer offer = default; + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + authMode = new ServerlessInferenceEndpointAuthMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("capacityReservation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityReservation = ServerlessEndpointCapacityReservation.DeserializeServerlessEndpointCapacityReservation(property.Value, options); + continue; + } + if (property.NameEquals("contentSafety"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + contentSafety = ServerlessEndpointContentSafety.DeserializeServerlessEndpointContentSafety(property.Value, options); + continue; + } + if (property.NameEquals("endpointState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointState = new ServerlessEndpointState(property.Value.GetString()); + continue; + } + if (property.NameEquals("inferenceEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + inferenceEndpoint = ServerlessEndpointInferenceEndpoint.DeserializeServerlessEndpointInferenceEndpoint(property.Value, options); + continue; + } + if (property.NameEquals("marketplaceSubscriptionId"u8)) + { + marketplaceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("metadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metadata = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("modelSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + modelSettings = ServerlessEndpointModelSettings.DeserializeServerlessEndpointModelSettings(property.Value, options); + continue; + } + if (property.NameEquals("offer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + offer = ServerlessOffer.DeserializeServerlessOffer(property.Value, options); + continue; + } + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData, + authMode, + capacityReservation, + contentSafety, + endpointState, + inferenceEndpoint, + marketplaceSubscriptionId, + metadata, + modelSettings, + offer); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + ServerlessEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.cs new file mode 100644 index 000000000000..3a4142dae258 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointResourceProperties.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServerlessEndpointResourceProperties. + public partial class ServerlessEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public ServerlessEndpointResourceProperties() + { + EndpointType = EndpointType.ServerlessEndpoint; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + /// + /// + /// + /// State of the Serverless Endpoint. + /// + /// + /// Anything. + /// + /// + internal ServerlessEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData, ServerlessInferenceEndpointAuthMode? authMode, ServerlessEndpointCapacityReservation capacityReservation, ServerlessEndpointContentSafety contentSafety, ServerlessEndpointState? endpointState, ServerlessEndpointInferenceEndpoint inferenceEndpoint, string marketplaceSubscriptionId, BinaryData metadata, ServerlessEndpointModelSettings modelSettings, ServerlessOffer offer) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + AuthMode = authMode; + CapacityReservation = capacityReservation; + ContentSafety = contentSafety; + EndpointState = endpointState; + InferenceEndpoint = inferenceEndpoint; + MarketplaceSubscriptionId = marketplaceSubscriptionId; + Metadata = metadata; + ModelSettings = modelSettings; + Offer = offer; + EndpointType = endpointType; + } + + /// Gets or sets the auth mode. + public ServerlessInferenceEndpointAuthMode? AuthMode { get; set; } + /// Gets or sets the capacity reservation. + public ServerlessEndpointCapacityReservation CapacityReservation { get; set; } + /// Gets or sets the content safety. + internal ServerlessEndpointContentSafety ContentSafety { get; set; } + /// Specifies the status of content safety. + public ContentSafetyStatus? ContentSafetyStatus + { + get => ContentSafety is null ? default(ContentSafetyStatus?) : ContentSafety.ContentSafetyStatus; + set + { + ContentSafety = value.HasValue ? new ServerlessEndpointContentSafety(value.Value) : null; + } + } + + /// State of the Serverless Endpoint. + public ServerlessEndpointState? EndpointState { get; set; } + /// Gets or sets the inference endpoint. + public ServerlessEndpointInferenceEndpoint InferenceEndpoint { get; set; } + /// Gets or sets the marketplace subscription id. + public string MarketplaceSubscriptionId { get; set; } + /// + /// Anything + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Metadata { get; set; } + /// Gets or sets the model settings. + internal ServerlessEndpointModelSettings ModelSettings { get; set; } + /// Gets or sets the model id. + public string ModelId + { + get => ModelSettings is null ? default : ModelSettings.ModelId; + set => ModelSettings = new ServerlessEndpointModelSettings(value); + } + + /// Gets or sets the offer. + public ServerlessOffer Offer { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs index 546606ccbf7b..4984fec38247 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs @@ -13,6 +13,10 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 internal partial class ServerlessEndpointTrackedResourceArmPaginatedResult : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -23,9 +27,32 @@ void IJsonModel.Write(Utf8J if (format != "J") { throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support writing '{format}' format."); +<<<<<<< HEAD +======== + internal partial class EndpointModels : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModels)} does not support writing '{format}' format."); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs } writer.WriteStartObject(); +======= + } + + writer.WriteStartObject(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -36,11 +63,14 @@ void IJsonModel.Write(Utf8J } writer.WriteEndArray(); } +<<<<<<< HEAD if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); writer.WriteStringValue(NextLink); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -59,6 +89,10 @@ void IJsonModel.Write(Utf8J writer.WriteEndObject(); } +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ServerlessEndpointTrackedResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -72,6 +106,24 @@ ServerlessEndpointTrackedResourceArmPaginatedResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointModels)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointModels(document.RootElement, options); + } + + internal static EndpointModels DeserializeEndpointModels(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { options ??= ModelSerializationExtensions.WireOptions; @@ -79,49 +131,102 @@ internal static ServerlessEndpointTrackedResourceArmPaginatedResult DeserializeS { return null; } +<<<<<<< HEAD IReadOnlyList value = default; string nextLink = default; +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs +======== + IReadOnlyList value = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs +======= + string nextLink = default; + IReadOnlyList value = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD +======= + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("value"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 List array = new List(); foreach (var item in property.Value.EnumerateArray()) { array.Add(ServerlessEndpointData.DeserializeServerlessEndpointData(item, options)); +<<<<<<< HEAD +======== + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointModelProperties.DeserializeEndpointModelProperties(item, options)); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } value = array; continue; } +<<<<<<< HEAD if (property.NameEquals("nextLink"u8)) { nextLink = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs return new ServerlessEndpointTrackedResourceArmPaginatedResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); +======= + return new ServerlessEndpointTrackedResourceArmPaginatedResult(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +<<<<<<< HEAD +======== + return new EndpointModels(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 throw new FormatException($"The model {nameof(ServerlessEndpointTrackedResourceArmPaginatedResult)} does not support writing '{options.Format}' format."); } } @@ -129,12 +234,28 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +<<<<<<< HEAD +======== + throw new FormatException($"The model {nameof(EndpointModels)} does not support writing '{options.Format}' format."); + } + } + + EndpointModels IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 return DeserializeServerlessEndpointTrackedResourceArmPaginatedResult(document.RootElement, options); } default: @@ -143,5 +264,18 @@ ServerlessEndpointTrackedResourceArmPaginatedResult IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +<<<<<<< HEAD +======== + return DeserializeEndpointModels(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointModels)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/EndpointModels.Serialization.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.cs index 6e55852b19d3..73c87f766e76 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessEndpointTrackedResourceArmPaginatedResult.cs @@ -52,19 +52,33 @@ internal ServerlessEndpointTrackedResourceArmPaginatedResult() } /// Initializes a new instance of . +<<<<<<< HEAD /// An array of objects of type ServerlessEndpoint. /// The link to the next page of ServerlessEndpoint objects. If null, there are no additional pages. /// Keeps track of any properties unknown to the library. internal ServerlessEndpointTrackedResourceArmPaginatedResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) +======= + /// The link to the next page of ServerlessEndpoint objects. If null, there are no additional pages. + /// An array of objects of type ServerlessEndpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointTrackedResourceArmPaginatedResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } +<<<<<<< HEAD /// An array of objects of type ServerlessEndpoint. public IReadOnlyList Value { get; } /// The link to the next page of ServerlessEndpoint objects. If null, there are no additional pages. public string NextLink { get; } +======= + /// The link to the next page of ServerlessEndpoint objects. If null, there are no additional pages. + public string NextLink { get; } + /// An array of objects of type ServerlessEndpoint. + public IReadOnlyList Value { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs index 4c4c45df0683..a55a40d48e67 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs @@ -13,6 +13,59 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +======= +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs + public partial class MarketplacePlan : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(PublisherId)) + { + if (PublisherId != null) + { + writer.WritePropertyName("publisherId"u8); + writer.WriteStringValue(PublisherId); + } + else + { + writer.WriteNull("publisherId"); + } + } + if (options.Format != "W" && Optional.IsDefined(OfferId)) + { + if (OfferId != null) + { + writer.WritePropertyName("offerId"u8); + writer.WriteStringValue(OfferId); + } + else + { + writer.WriteNull("offerId"); + } + } + if (options.Format != "W" && Optional.IsDefined(PlanId)) + { + if (PlanId != null) + { + writer.WritePropertyName("planId"u8); + writer.WriteStringValue(PlanId); + } + else + { + writer.WriteNull("planId"); +======== +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 public partial class ServerlessInferenceEndpoint : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -26,8 +79,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } writer.WriteStartObject(); +<<<<<<< HEAD writer.WritePropertyName("uri"u8); writer.WriteStringValue(Uri.AbsoluteUri); +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && Optional.IsCollectionDefined(Headers)) { if (Headers != null) @@ -44,8 +100,50 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR else { writer.WriteNull("headers"); +<<<<<<< HEAD } +======== + public partial class JupyterKernelConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support writing '{format}' format."); } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Argv)) + { + writer.WritePropertyName("argv"u8); + writer.WriteStartArray(); + foreach (var item in Argv) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (Optional.IsDefined(Language)) + { + writer.WritePropertyName("language"u8); + writer.WriteStringValue(Language); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs + } +======= +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs + } + } + writer.WritePropertyName("uri"u8); + writer.WriteStringValue(Uri.AbsoluteUri); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -64,6 +162,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteEndObject(); } +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +======= +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs + MarketplacePlan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMarketplacePlan(document.RootElement, options); + } + + internal static MarketplacePlan DeserializeMarketplacePlan(JsonElement element, ModelReaderWriterOptions options = null) +======== +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ServerlessInferenceEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -77,6 +194,25 @@ ServerlessInferenceEndpoint IJsonModel.Create(ref U } internal static ServerlessInferenceEndpoint DeserializeServerlessInferenceEndpoint(JsonElement element, ModelReaderWriterOptions options = null) +<<<<<<< HEAD +======== + JupyterKernelConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJupyterKernelConfig(document.RootElement, options); + } + + internal static JupyterKernelConfig DeserializeJupyterKernelConfig(JsonElement element, ModelReaderWriterOptions options = null) +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs +======= +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { options ??= ModelSerializationExtensions.WireOptions; @@ -84,17 +220,68 @@ internal static ServerlessInferenceEndpoint DeserializeServerlessInferenceEndpoi { return null; } +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs Uri uri = default; IReadOnlyDictionary headers = default; +======== + IList argv = default; + string displayName = default; + string language = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs +======= +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs + string publisherId = default; + string offerId = default; + string planId = default; +======== + IReadOnlyDictionary headers = default; + Uri uri = default; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("uri"u8)) +<<<<<<< HEAD + if (property.NameEquals("argv"u8)) { +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs uri = new Uri(property.Value.GetString()); continue; } +======= +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs + if (property.NameEquals("publisherId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + publisherId = null; + continue; + } + publisherId = property.Value.GetString(); + continue; + } + if (property.NameEquals("offerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + offerId = null; + continue; + } + offerId = property.Value.GetString(); + continue; + } + if (property.NameEquals("planId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + planId = null; + continue; + } + planId = property.Value.GetString(); +======== +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("headers"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -108,6 +295,37 @@ internal static ServerlessInferenceEndpoint DeserializeServerlessInferenceEndpoi dictionary.Add(property0.Name, property0.Value.GetString()); } headers = dictionary; +<<<<<<< HEAD +======== + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + argv = array; + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("language"u8)) + { + language = property.Value.GetString(); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs +======= + continue; + } + if (property.NameEquals("uri"u8)) + { + uri = new Uri(property.Value.GetString()); +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (options.Format != "W") @@ -116,18 +334,56 @@ internal static ServerlessInferenceEndpoint DeserializeServerlessInferenceEndpoi } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs return new ServerlessInferenceEndpoint(uri, headers ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); +======= +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs + return new MarketplacePlan(publisherId, offerId, planId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== + return new ServerlessInferenceEndpoint(headers ?? new ChangeTrackingDictionary(), uri, serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +<<<<<<< HEAD +======== + return new JupyterKernelConfig(argv ?? new ChangeTrackingList(), displayName, language, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs +======= +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +======= +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support writing '{options.Format}' format."); + } + } + + MarketplacePlan IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +======== +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 throw new FormatException($"The model {nameof(ServerlessInferenceEndpoint)} does not support writing '{options.Format}' format."); } } @@ -135,12 +391,39 @@ BinaryData IPersistableModel.Write(ModelReaderWrite ServerlessInferenceEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +<<<<<<< HEAD +======== + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support writing '{options.Format}' format."); + } + } + + JupyterKernelConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs +======= +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +======= +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/MarketplacePlan.Serialization.cs + return DeserializeMarketplacePlan(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MarketplacePlan)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +======== +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 return DeserializeServerlessInferenceEndpoint(document.RootElement, options); } default: @@ -149,5 +432,19 @@ ServerlessInferenceEndpoint IPersistableModel.Creat } string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +<<<<<<< HEAD +======== + return DeserializeJupyterKernelConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JupyterKernelConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/JupyterKernelConfig.Serialization.cs +======= +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.Serialization.cs +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs index 3767d8385867..8d6e20b967f6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs @@ -10,8 +10,18 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs /// The ServerlessInferenceEndpoint. public partial class ServerlessInferenceEndpoint +======== + /// The ServerlessOffer. + public partial class ServerlessOffer +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs +======= + /// The ServerlessInferenceEndpoint. + public partial class ServerlessInferenceEndpoint +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { /// /// Keeps track of any properties unknown to the library. @@ -45,6 +55,10 @@ public partial class ServerlessInferenceEndpoint /// private IDictionary _serializedAdditionalRawData; +<<<<<<< HEAD +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Initializes a new instance of . /// [Required] The inference uri to target when making requests against the Serverless Endpoint. /// is null. @@ -52,6 +66,7 @@ internal ServerlessInferenceEndpoint(Uri uri) { Argument.AssertNotNull(uri, nameof(uri)); +<<<<<<< HEAD Uri = uri; Headers = new ChangeTrackingDictionary(); } @@ -64,6 +79,20 @@ internal ServerlessInferenceEndpoint(Uri uri, IReadOnlyDictionary(); + Uri = uri; + } + + /// Initializes a new instance of . + /// Specifies any required headers to target this serverless endpoint. + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessInferenceEndpoint(IReadOnlyDictionary headers, Uri uri, IDictionary serializedAdditionalRawData) + { + Headers = headers; + Uri = uri; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -72,9 +101,51 @@ internal ServerlessInferenceEndpoint() { } +<<<<<<< HEAD /// [Required] The inference uri to target when making requests against the Serverless Endpoint. public Uri Uri { get; } /// Specifies any required headers to target this serverless endpoint. public IReadOnlyDictionary Headers { get; } +======== + /// Initializes a new instance of . + /// + /// + /// or is null. + public ServerlessOffer(string offerName, string publisher) + { + Argument.AssertNotNull(offerName, nameof(offerName)); + Argument.AssertNotNull(publisher, nameof(publisher)); + + OfferName = offerName; + Publisher = publisher; + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal ServerlessOffer(string offerName, string publisher, IDictionary serializedAdditionalRawData) + { + OfferName = offerName; + Publisher = publisher; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessOffer() + { + } + + /// Gets or sets the offer name. + public string OfferName { get; set; } + /// Gets or sets the publisher. + public string Publisher { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs +======= + /// Specifies any required headers to target this serverless endpoint. + public IReadOnlyDictionary Headers { get; } + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + public Uri Uri { get; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.Serialization.cs new file mode 100644 index 000000000000..3d5ffbd62a5d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class ServerlessOffer : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("offerName"u8); + writer.WriteStringValue(OfferName); + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ServerlessOffer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServerlessOffer(document.RootElement, options); + } + + internal static ServerlessOffer DeserializeServerlessOffer(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string offerName = default; + string publisher = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("offerName"u8)) + { + offerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServerlessOffer(offerName, publisher, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support writing '{options.Format}' format."); + } + } + + ServerlessOffer IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeServerlessOffer(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServerlessOffer)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs new file mode 100644 index 000000000000..d7a444343303 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs + /// The ServerlessInferenceEndpoint. + public partial class ServerlessInferenceEndpoint +======== + /// The ServerlessOffer. + public partial class ServerlessOffer +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + +<<<<<<<< HEAD:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessInferenceEndpoint.cs + /// Initializes a new instance of . + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + /// is null. + internal ServerlessInferenceEndpoint(Uri uri) + { + Argument.AssertNotNull(uri, nameof(uri)); + + Uri = uri; + Headers = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + /// Specifies any required headers to target this serverless endpoint. + /// Keeps track of any properties unknown to the library. + internal ServerlessInferenceEndpoint(Uri uri, IReadOnlyDictionary headers, IDictionary serializedAdditionalRawData) + { + Uri = uri; + Headers = headers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessInferenceEndpoint() + { + } + + /// [Required] The inference uri to target when making requests against the Serverless Endpoint. + public Uri Uri { get; } + /// Specifies any required headers to target this serverless endpoint. + public IReadOnlyDictionary Headers { get; } +======== + /// Initializes a new instance of . + /// + /// + /// or is null. + public ServerlessOffer(string offerName, string publisher) + { + Argument.AssertNotNull(offerName, nameof(offerName)); + Argument.AssertNotNull(publisher, nameof(publisher)); + + OfferName = offerName; + Publisher = publisher; + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal ServerlessOffer(string offerName, string publisher, IDictionary serializedAdditionalRawData) + { + OfferName = offerName; + Publisher = publisher; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ServerlessOffer() + { + } + + /// Gets or sets the offer name. + public string OfferName { get; set; } + /// Gets or sets the publisher. + public string Publisher { get; set; } +>>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7:sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServerlessOffer.cs + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceAccountKeyName.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceAccountKeyName.cs new file mode 100644 index 000000000000..651f2dd032cf --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceAccountKeyName.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The ServiceAccountKeyName. + public readonly partial struct ServiceAccountKeyName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ServiceAccountKeyName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Key1Value = "Key1"; + private const string Key2Value = "Key2"; + + /// Key1. + public static ServiceAccountKeyName Key1 { get; } = new ServiceAccountKeyName(Key1Value); + /// Key2. + public static ServiceAccountKeyName Key2 { get; } = new ServiceAccountKeyName(Key2Value); + /// Determines if two values are the same. + public static bool operator ==(ServiceAccountKeyName left, ServiceAccountKeyName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ServiceAccountKeyName left, ServiceAccountKeyName right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ServiceAccountKeyName(string value) => new ServiceAccountKeyName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ServiceAccountKeyName other && Equals(other); + /// + public bool Equals(ServiceAccountKeyName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs index 9737ff18d77e..114e4d0664e7 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.Serialization.cs @@ -43,12 +43,21 @@ void IJsonModel.Write(Utf writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -57,12 +66,54 @@ void IJsonModel.Write(Utf { writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); +======= + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -93,6 +144,12 @@ void IJsonModel.Write(Utf { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -136,6 +193,7 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ MachineLearningConnectionAuthType authType = default; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -144,6 +202,18 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -180,6 +250,14 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -207,11 +285,14 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -224,6 +305,41 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ dictionary.Add(property0.Name, property0.Value.GetString()); } metadata = dictionary; +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("sharedUserList"u8)) @@ -254,6 +370,15 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ valueFormat = new MachineLearningValueFormat(property.Value.GetString()); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -264,6 +389,7 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -272,6 +398,18 @@ internal static ServicePrincipalAuthTypeWorkspaceConnectionProperties Deserializ sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData, credentials); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs index 10b02ab4620d..da22a45cda32 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServicePrincipalAuthTypeWorkspaceConnectionProperties.cs @@ -24,6 +24,7 @@ public ServicePrincipalAuthTypeWorkspaceConnectionProperties() /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -35,6 +36,21 @@ public ServicePrincipalAuthTypeWorkspaceConnectionProperties() /// Keeps track of any properties unknown to the library. /// internal ServicePrincipalAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData, WorkspaceConnectionServicePrincipal credentials) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + /// + internal ServicePrincipalAuthTypeWorkspaceConnectionProperties(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData, WorkspaceConnectionServicePrincipal credentials) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Credentials = credentials; AuthType = authType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs index e3e25ed2f533..899a9cd60241 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.Serialization.cs @@ -36,6 +36,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -83,6 +93,7 @@ internal static ServiceTagOutboundRule DeserializeServiceTagOutboundRule(JsonEle } ServiceTagDestination destination = default; OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = default; IDictionary serializedAdditionalRawData = default; @@ -107,6 +118,20 @@ internal static ServiceTagOutboundRule DeserializeServiceTagOutboundRule(JsonEle category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -127,7 +152,13 @@ internal static ServiceTagOutboundRule DeserializeServiceTagOutboundRule(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new ServiceTagOutboundRule(category, status, type, serializedAdditionalRawData, destination); + return new ServiceTagOutboundRule( + category, + parentRuleNames ?? new ChangeTrackingList(), + status, + type, + serializedAdditionalRawData, + destination); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs index 3044028f3dbf..91e02ffc49d2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/ServiceTagOutboundRule.cs @@ -21,11 +21,12 @@ public ServiceTagOutboundRule() /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. /// Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - internal ServiceTagOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, ServiceTagDestination destination) : base(category, status, outboundRuleType, serializedAdditionalRawData) + internal ServiceTagOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData, ServiceTagDestination destination) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { Destination = destination; OutboundRuleType = outboundRuleType; diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs index 5e6cdf43e6c7..2ecad6da8f99 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.Serialization.cs @@ -66,6 +66,44 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions writer.WriteNull("environmentId"); } } +<<<<<<< HEAD +======= + if (Optional.IsCollectionDefined(EnvironmentVariables)) + { + if (EnvironmentVariables != null) + { + writer.WritePropertyName("environmentVariables"u8); + writer.WriteStartObject(); + foreach (var item in EnvironmentVariables) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + else + { + writer.WriteNull("environmentVariables"); + } + } + if (Optional.IsCollectionDefined(Files)) + { + if (Files != null) + { + writer.WritePropertyName("files"u8); + writer.WriteStartArray(); + foreach (var item in Files) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull("files"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Inputs)) { if (Inputs != null) @@ -242,6 +280,40 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions writer.WritePropertyName("experimentName"u8); writer.WriteStringValue(ExperimentName); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Identity)) + { + if (Identity != null) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + else + { + writer.WriteNull("identity"); + } + } + if (Optional.IsDefined(IsArchived)) + { + writer.WritePropertyName("isArchived"u8); + writer.WriteBooleanValue(IsArchived.Value); + } + writer.WritePropertyName("jobType"u8); + writer.WriteStringValue(JobType.ToString()); + if (Optional.IsDefined(NotificationSetting)) + { + if (NotificationSetting != null) + { + writer.WritePropertyName("notificationSetting"u8); + writer.WriteObjectValue(NotificationSetting, options); + } + else + { + writer.WriteNull("notificationSetting"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -402,8 +474,16 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri SparkResourceConfiguration resources = default; string args = default; ResourceIdentifier codeId = default; +<<<<<<< HEAD + SparkJobEntry entry = default; + ResourceIdentifier environmentId = default; +======= + IDictionary conf = default; SparkJobEntry entry = default; ResourceIdentifier environmentId = default; + IDictionary environmentVariables = default; + IList files = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary inputs = default; IDictionary outputs = default; IList pyFiles = default; @@ -414,7 +494,12 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri JobQueueSettings queueSettings = default; IDictionary environmentVariables = default; JobType jobType = default; +<<<<<<< HEAD string displayName = default; +======= + NotificationSetting notificationSetting = default; + IDictionary services = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningJobStatus? status = default; string experimentName = default; IDictionary services = default; @@ -453,6 +538,24 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri if (property.NameEquals("codeId"u8)) { codeId = new ResourceIdentifier(property.Value.GetString()); +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("conf"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + conf = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + conf = dictionary; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("entry"u8)) @@ -468,6 +571,39 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri continue; } environmentId = new ResourceIdentifier(property.Value.GetString()); +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("environmentVariables"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + environmentVariables = null; + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + environmentVariables = dictionary; + continue; + } + if (property.NameEquals("files"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + files = null; + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + files = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("inputs"u8)) @@ -629,6 +765,43 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri experimentName = property.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + identity = null; + continue; + } + identity = MachineLearningIdentityConfiguration.DeserializeMachineLearningIdentityConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("isArchived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isArchived = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new JobType(property.Value.GetString()); + continue; + } + if (property.NameEquals("notificationSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationSetting = null; + continue; + } + notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -745,7 +918,12 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, jobType, +<<<<<<< HEAD displayName, +======= + notificationSetting, + services ?? new ChangeTrackingDictionary(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 status, experimentName, services ?? new ChangeTrackingDictionary(), @@ -759,6 +937,11 @@ internal static SparkJob DeserializeSparkJob(JsonElement element, ModelReaderWri codeId, entry, environmentId, +<<<<<<< HEAD +======= + environmentVariables ?? new ChangeTrackingDictionary(), + files ?? new ChangeTrackingList(), +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 inputs ?? new ChangeTrackingDictionary(), outputs ?? new ChangeTrackingDictionary(), pyFiles ?? new ChangeTrackingList(), diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs index ae0f1093ac9f..6f5888f0e96f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SparkJob.cs @@ -29,6 +29,11 @@ public SparkJob(ResourceIdentifier codeId, SparkJobEntry entry) CodeId = codeId; Entry = entry; +<<<<<<< HEAD +======= + EnvironmentVariables = new ChangeTrackingDictionary(); + Files = new ChangeTrackingList(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Inputs = new ChangeTrackingDictionary(); Outputs = new ChangeTrackingDictionary(); PyFiles = new ChangeTrackingList(); @@ -63,15 +68,32 @@ public SparkJob(ResourceIdentifier codeId, SparkJobEntry entry) /// /// ARM resource ID of the component resource. /// Notification setting for the job. +<<<<<<< HEAD /// Compute Resource configuration for the job. /// Arguments for the job. /// [Required] arm-id of the code asset. +======= + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + /// Archive files used in the job. + /// Arguments for the job. + /// [Required] arm-id of the code asset. + /// Spark configured properties. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// [Required] The entry to execute on startup of the job. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// /// The ARM resource ID of the Environment specification for the job. +<<<<<<< HEAD +======= + /// Environment variables included in the job. + /// Files used in the job. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Mapping of input data bindings used in the job. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -88,14 +110,24 @@ public SparkJob(ResourceIdentifier codeId, SparkJobEntry entry) /// Archive files used in the job. /// Spark configured properties. /// Queue settings for the job. +<<<<<<< HEAD /// Environment variables included in the job. internal SparkJob(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, JobType jobType, string displayName, MachineLearningJobStatus? status, string experimentName, IDictionary services, ResourceIdentifier computeId, bool? isArchived, MachineLearningIdentityConfiguration identity, ResourceIdentifier componentId, NotificationSetting notificationSetting, SparkResourceConfiguration resources, string args, ResourceIdentifier codeId, SparkJobEntry entry, ResourceIdentifier environmentId, IDictionary inputs, IDictionary outputs, IList pyFiles, IList jars, IList files, IList archives, IDictionary conf, JobQueueSettings queueSettings, IDictionary environmentVariables) : base(description, tags, properties, serializedAdditionalRawData, jobType, displayName, status, experimentName, services, computeId, isArchived, identity, componentId, notificationSetting) +======= + /// Compute Resource configuration for the job. + internal SparkJob(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status, IList archives, string args, ResourceIdentifier codeId, IDictionary conf, SparkJobEntry entry, ResourceIdentifier environmentId, IDictionary environmentVariables, IList files, IDictionary inputs, IList jars, IDictionary outputs, IList pyFiles, JobQueueSettings queueSettings, SparkResourceConfiguration resources) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Resources = resources; Args = args; CodeId = codeId; Entry = entry; EnvironmentId = environmentId; +<<<<<<< HEAD +======= + EnvironmentVariables = environmentVariables; + Files = files; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Inputs = inputs; Outputs = outputs; PyFiles = pyFiles; @@ -119,6 +151,11 @@ internal SparkJob() public string Args { get; set; } /// [Required] arm-id of the code asset. public ResourceIdentifier CodeId { get; set; } +<<<<<<< HEAD +======= + /// Spark configured properties. + public IDictionary Conf { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// [Required] The entry to execute on startup of the job. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -127,6 +164,13 @@ internal SparkJob() public SparkJobEntry Entry { get; set; } /// The ARM resource ID of the Environment specification for the job. public ResourceIdentifier EnvironmentId { get; set; } +<<<<<<< HEAD +======= + /// Environment variables included in the job. + public IDictionary EnvironmentVariables { get; set; } + /// Files used in the job. + public IList Files { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// Mapping of input data bindings used in the job. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. @@ -163,7 +207,12 @@ public JobTier? QueueJobTier } } +<<<<<<< HEAD /// Environment variables included in the job. public IDictionary EnvironmentVariables { get; set; } +======= + /// Compute Resource configuration for the job. + public SparkResourceConfiguration Resources { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 000000000000..2ef1472d3ea1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class SpeechEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (Optional.IsDefined(RaiPolicyName)) + { + writer.WritePropertyName("raiPolicyName"u8); + writer.WriteStringValue(RaiPolicyName); + } + if (Optional.IsDefined(VersionUpgradeOption)) + { + writer.WritePropertyName("versionUpgradeOption"u8); + writer.WriteStringValue(VersionUpgradeOption.Value.ToString()); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SpeechEndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpeechEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static SpeechEndpointDeploymentResourceProperties DeserializeSpeechEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EndpointDeploymentModel model = default; + string raiPolicyName = default; + DeploymentModelVersionUpgradeOption? versionUpgradeOption = default; + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("model"u8)) + { + model = EndpointDeploymentModel.DeserializeEndpointDeploymentModel(property.Value, options); + continue; + } + if (property.NameEquals("raiPolicyName"u8)) + { + raiPolicyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("versionUpgradeOption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + versionUpgradeOption = new DeploymentModelVersionUpgradeOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpeechEndpointDeploymentResourceProperties( + failureReason, + provisioningState, + type, + serializedAdditionalRawData, + model, + raiPolicyName, + versionUpgradeOption); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + SpeechEndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpeechEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpeechEndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.cs new file mode 100644 index 000000000000..a683fbee428d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointDeploymentResourceProperties.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The SpeechEndpointDeploymentResourceProperties. + public partial class SpeechEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// Model used for the endpoint deployment. + /// is null. + public SpeechEndpointDeploymentResourceProperties(EndpointDeploymentModel model) + { + Argument.AssertNotNull(model, nameof(model)); + + Model = model; + EndpointDeploymentResourcePropertiesType = "Azure.Speech"; + } + + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + /// Model used for the endpoint deployment. + /// The name of RAI policy. + /// Deployment model version upgrade option. + internal SpeechEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData, EndpointDeploymentModel model, string raiPolicyName, DeploymentModelVersionUpgradeOption? versionUpgradeOption) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + Model = model; + RaiPolicyName = raiPolicyName; + VersionUpgradeOption = versionUpgradeOption; + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Azure.Speech"; + } + + /// Initializes a new instance of for deserialization. + internal SpeechEndpointDeploymentResourceProperties() + { + } + + /// Model used for the endpoint deployment. + public EndpointDeploymentModel Model { get; set; } + /// The name of RAI policy. + public string RaiPolicyName { get; set; } + /// Deployment model version upgrade option. + public DeploymentModelVersionUpgradeOption? VersionUpgradeOption { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.Serialization.cs new file mode 100644 index 000000000000..82b4200464e1 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + public partial class SpeechEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SpeechEndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSpeechEndpointResourceProperties(document.RootElement, options); + } + + internal static SpeechEndpointResourceProperties DeserializeSpeechEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = default; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SpeechEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + SpeechEndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSpeechEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SpeechEndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.cs new file mode 100644 index 000000000000..7270ce4db5af --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/SpeechEndpointResourceProperties.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// The SpeechEndpointResourceProperties. + public partial class SpeechEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + public SpeechEndpointResourceProperties() + { + EndpointType = EndpointType.AzureSpeech; + } + + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal SpeechEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs index 01ce31675f00..4e93fbd7696b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/StaticInputData.cs @@ -35,6 +35,11 @@ public StaticInputData(JobInputType jobInputType, Uri uri, DateTimeOffset window /// [Required] Input Asset URI. /// Mapping of column names to special uses. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD +======= + /// Reference to the component asset used to preprocess the data. + /// [Required] The end date of the data window. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] The start date of the data window. /// [Required] The end date of the data window. /// Reference to the component asset used to preprocess the data. @@ -51,6 +56,13 @@ internal StaticInputData() { } +<<<<<<< HEAD +======= + /// Reference to the component asset used to preprocess the data. + public string PreprocessingComponentId { get; set; } + /// [Required] The end date of the data window. + public DateTimeOffset WindowEnd { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] The start date of the data window. public DateTimeOffset WindowStart { get; set; } /// [Required] The end date of the data window. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs index e63f04611ab4..e072b15d1096 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.Serialization.cs @@ -65,8 +65,33 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } if (Optional.IsDefined(EnableEarlyTermination)) { +<<<<<<< HEAD writer.WritePropertyName("enableEarlyTermination"u8); writer.WriteBooleanValue(EnableEarlyTermination.Value); +======= + writer.WritePropertyName("maxConcurrentTrials"u8); + writer.WriteNumberValue(MaxConcurrentTrials.Value); + } + if (Optional.IsDefined(MaxCoresPerTrial)) + { + writer.WritePropertyName("maxCoresPerTrial"u8); + writer.WriteNumberValue(MaxCoresPerTrial.Value); + } + if (Optional.IsDefined(MaxTrials)) + { + writer.WritePropertyName("maxTrials"u8); + writer.WriteNumberValue(MaxTrials.Value); + } + if (Optional.IsDefined(Timeout)) + { + writer.WritePropertyName("timeout"u8); + writer.WriteStringValue(Timeout.Value, "P"); + } + if (Optional.IsDefined(TrialTimeout)) + { + writer.WritePropertyName("trialTimeout"u8); + writer.WriteStringValue(TrialTimeout.Value, "P"); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -111,8 +136,14 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings TimeSpan? timeout = default; int? maxConcurrentTrials = default; int? maxCoresPerTrial = default; +<<<<<<< HEAD double? exitScore = default; bool? enableEarlyTermination = default; +======= + int? maxTrials = default; + TimeSpan? timeout = default; + TimeSpan? trialTimeout = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -162,6 +193,7 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings maxCoresPerTrial = property.Value.GetInt32(); continue; } +<<<<<<< HEAD if (property.NameEquals("exitScore"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -173,12 +205,37 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings continue; } if (property.NameEquals("enableEarlyTermination"u8)) +======= + if (property.NameEquals("maxTrials"u8)) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } +<<<<<<< HEAD enableEarlyTermination = property.Value.GetBoolean(); +======= + maxTrials = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeout"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeout = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("trialTimeout"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + trialTimeout = property.Value.GetTimeSpan("P"); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (options.Format != "W") @@ -193,8 +250,14 @@ internal static TableVerticalLimitSettings DeserializeTableVerticalLimitSettings timeout, maxConcurrentTrials, maxCoresPerTrial, +<<<<<<< HEAD exitScore, enableEarlyTermination, +======= + maxTrials, + timeout, + trialTimeout, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs index 5bcabfae5375..fab4816e02cf 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TableVerticalLimitSettings.cs @@ -56,18 +56,32 @@ public TableVerticalLimitSettings() /// AutoML job timeout. /// Maximum Concurrent iterations. /// Max cores per iteration. +<<<<<<< HEAD /// Exit score for the AutoML job. /// Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations. /// Keeps track of any properties unknown to the library. internal TableVerticalLimitSettings(int? maxTrials, TimeSpan? trialTimeout, TimeSpan? timeout, int? maxConcurrentTrials, int? maxCoresPerTrial, double? exitScore, bool? enableEarlyTermination, IDictionary serializedAdditionalRawData) +======= + /// Number of iterations. + /// AutoML job timeout. + /// Iteration timeout. + /// Keeps track of any properties unknown to the library. + internal TableVerticalLimitSettings(bool? enableEarlyTermination, double? exitScore, int? maxConcurrentTrials, int? maxCoresPerTrial, int? maxTrials, TimeSpan? timeout, TimeSpan? trialTimeout, IDictionary serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { MaxTrials = maxTrials; TrialTimeout = trialTimeout; Timeout = timeout; MaxConcurrentTrials = maxConcurrentTrials; MaxCoresPerTrial = maxCoresPerTrial; +<<<<<<< HEAD ExitScore = exitScore; EnableEarlyTermination = enableEarlyTermination; +======= + MaxTrials = maxTrials; + Timeout = timeout; + TrialTimeout = trialTimeout; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -81,9 +95,18 @@ internal TableVerticalLimitSettings(int? maxTrials, TimeSpan? trialTimeout, Time public int? MaxConcurrentTrials { get; set; } /// Max cores per iteration. public int? MaxCoresPerTrial { get; set; } +<<<<<<< HEAD /// Exit score for the AutoML job. public double? ExitScore { get; set; } /// Enable early termination, determines whether or not if AutoMLJob will terminate early if there is no score improvement in last 20 iterations. public bool? EnableEarlyTermination { get; set; } +======= + /// Number of iterations. + public int? MaxTrials { get; set; } + /// AutoML job timeout. + public TimeSpan? Timeout { get; set; } + /// Iteration timeout. + public TimeSpan? TrialTimeout { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs index 75695c754769..f395dd17e97d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.Serialization.cs @@ -31,6 +31,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("primaryMetric"u8); writer.WriteStringValue(PrimaryMetric.Value.ToString()); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(FeaturizationSettings)) + { + if (FeaturizationSettings != null) + { + writer.WritePropertyName("featurizationSettings"u8); + writer.WriteObjectValue(FeaturizationSettings, options); + } + else + { + writer.WriteNull("featurizationSettings"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -43,6 +58,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("limitSettings"); } } +<<<<<<< HEAD if (Optional.IsDefined(FeaturizationSettings)) { if (FeaturizationSettings != null) @@ -55,6 +71,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("featurizationSettings"); } } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ValidationData)) { if (ValidationData != null) @@ -127,8 +145,13 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele return null; } ClassificationPrimaryMetric? primaryMetric = default; +<<<<<<< HEAD NlpVerticalLimitSettings limitSettings = default; NlpVerticalFeaturizationSettings featurizationSettings = default; +======= + NlpVerticalFeaturizationSettings featurizationSettings = default; + NlpVerticalLimitSettings limitSettings = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningTableJobInput validationData = default; TaskType taskType = default; MachineLearningLogVerbosity? logVerbosity = default; @@ -147,6 +170,19 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele primaryMetric = new ClassificationPrimaryMetric(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("featurizationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featurizationSettings = null; + continue; + } + featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -157,6 +193,7 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele limitSettings = NlpVerticalLimitSettings.DeserializeNlpVerticalLimitSettings(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("featurizationSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -167,6 +204,8 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("validationData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -219,8 +258,13 @@ internal static TextClassification DeserializeTextClassification(JsonElement ele targetColumnName, serializedAdditionalRawData, primaryMetric, +<<<<<<< HEAD limitSettings, featurizationSettings, +======= + featurizationSettings, + limitSettings, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 validationData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs index fdb405d8ad8f..0db9b25ab2b5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassification.cs @@ -36,6 +36,7 @@ public TextClassification(MachineLearningTableJobInput trainingData) : base(trai /// /// Keeps track of any properties unknown to the library. /// Primary metric for Text-Classification task. +<<<<<<< HEAD /// Execution constraints for AutoMLJob. /// Featurization inputs needed for AutoML job. /// Validation data inputs. @@ -44,6 +45,16 @@ internal TextClassification(TaskType taskType, MachineLearningLogVerbosity? logV PrimaryMetric = primaryMetric; LimitSettings = limitSettings; FeaturizationSettings = featurizationSettings; +======= + /// Featurization inputs needed for AutoML job. + /// Execution constraints for AutoMLJob. + /// Validation data inputs. + internal TextClassification(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpVerticalLimitSettings limitSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + { + PrimaryMetric = primaryMetric; + FeaturizationSettings = featurizationSettings; + LimitSettings = limitSettings; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ValidationData = validationData; TaskType = taskType; } @@ -71,6 +82,11 @@ public string FeaturizationDatasetLanguage } } +<<<<<<< HEAD +======= + /// Execution constraints for AutoMLJob. + public NlpVerticalLimitSettings LimitSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs index 48f1de488465..19373812b385 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.Serialization.cs @@ -31,6 +31,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("primaryMetric"u8); writer.WriteStringValue(PrimaryMetric.Value.ToString()); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(FeaturizationSettings)) + { + if (FeaturizationSettings != null) + { + writer.WritePropertyName("featurizationSettings"u8); + writer.WriteObjectValue(FeaturizationSettings, options); + } + else + { + writer.WriteNull("featurizationSettings"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -43,6 +58,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("limitSettings"); } } +<<<<<<< HEAD if (Optional.IsDefined(FeaturizationSettings)) { if (FeaturizationSettings != null) @@ -55,6 +71,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteNull("featurizationSettings"); } } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ValidationData)) { if (ValidationData != null) @@ -127,8 +145,13 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil return null; } ClassificationMultilabelPrimaryMetric? primaryMetric = default; +<<<<<<< HEAD NlpVerticalLimitSettings limitSettings = default; NlpVerticalFeaturizationSettings featurizationSettings = default; +======= + NlpVerticalFeaturizationSettings featurizationSettings = default; + NlpVerticalLimitSettings limitSettings = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningTableJobInput validationData = default; TaskType taskType = default; MachineLearningLogVerbosity? logVerbosity = default; @@ -147,6 +170,19 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil primaryMetric = new ClassificationMultilabelPrimaryMetric(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("featurizationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featurizationSettings = null; + continue; + } + featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -157,6 +193,7 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil limitSettings = NlpVerticalLimitSettings.DeserializeNlpVerticalLimitSettings(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("featurizationSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -167,6 +204,8 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("validationData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -219,8 +258,13 @@ internal static TextClassificationMultilabel DeserializeTextClassificationMultil targetColumnName, serializedAdditionalRawData, primaryMetric, +<<<<<<< HEAD limitSettings, featurizationSettings, +======= + featurizationSettings, + limitSettings, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 validationData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs index a9d41d0ad8e4..acce470be08d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextClassificationMultilabel.cs @@ -39,6 +39,7 @@ public TextClassificationMultilabel(MachineLearningTableJobInput trainingData) : /// Primary metric for Text-Classification-Multilabel task. /// Currently only Accuracy is supported as primary metric, hence user need not set it explicitly. /// +<<<<<<< HEAD /// Execution constraints for AutoMLJob. /// Featurization inputs needed for AutoML job. /// Validation data inputs. @@ -47,6 +48,16 @@ internal TextClassificationMultilabel(TaskType taskType, MachineLearningLogVerbo PrimaryMetric = primaryMetric; LimitSettings = limitSettings; FeaturizationSettings = featurizationSettings; +======= + /// Featurization inputs needed for AutoML job. + /// Execution constraints for AutoMLJob. + /// Validation data inputs. + internal TextClassificationMultilabel(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationMultilabelPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpVerticalLimitSettings limitSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + { + PrimaryMetric = primaryMetric; + FeaturizationSettings = featurizationSettings; + LimitSettings = limitSettings; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ValidationData = validationData; TaskType = taskType; } @@ -77,6 +88,11 @@ public string FeaturizationDatasetLanguage } } +<<<<<<< HEAD +======= + /// Execution constraints for AutoMLJob. + public NlpVerticalLimitSettings LimitSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs index 4eacedae5bcc..e76f26873214 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.Serialization.cs @@ -31,6 +31,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o writer.WritePropertyName("primaryMetric"u8); writer.WriteStringValue(PrimaryMetric.Value.ToString()); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(FeaturizationSettings)) + { + if (FeaturizationSettings != null) + { + writer.WritePropertyName("featurizationSettings"u8); + writer.WriteObjectValue(FeaturizationSettings, options); + } + else + { + writer.WriteNull("featurizationSettings"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(LimitSettings)) { if (LimitSettings != null) @@ -43,6 +58,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o writer.WriteNull("limitSettings"); } } +<<<<<<< HEAD if (Optional.IsDefined(FeaturizationSettings)) { if (FeaturizationSettings != null) @@ -55,6 +71,8 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o writer.WriteNull("featurizationSettings"); } } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ValidationData)) { if (ValidationData != null) @@ -127,8 +145,13 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite return null; } ClassificationPrimaryMetric? primaryMetric = default; +<<<<<<< HEAD NlpVerticalLimitSettings limitSettings = default; NlpVerticalFeaturizationSettings featurizationSettings = default; +======= + NlpVerticalFeaturizationSettings featurizationSettings = default; + NlpVerticalLimitSettings limitSettings = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningTableJobInput validationData = default; TaskType taskType = default; MachineLearningLogVerbosity? logVerbosity = default; @@ -147,6 +170,19 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite primaryMetric = new ClassificationPrimaryMetric(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("featurizationSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + featurizationSettings = null; + continue; + } + featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("limitSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -157,6 +193,7 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite limitSettings = NlpVerticalLimitSettings.DeserializeNlpVerticalLimitSettings(property.Value, options); continue; } +<<<<<<< HEAD if (property.NameEquals("featurizationSettings"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -167,6 +204,8 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite featurizationSettings = NlpVerticalFeaturizationSettings.DeserializeNlpVerticalFeaturizationSettings(property.Value, options); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("validationData"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -219,8 +258,13 @@ internal static TextNer DeserializeTextNer(JsonElement element, ModelReaderWrite targetColumnName, serializedAdditionalRawData, primaryMetric, +<<<<<<< HEAD limitSettings, featurizationSettings, +======= + featurizationSettings, + limitSettings, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 validationData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs index 608e148911de..8cf0c7b9bb46 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/TextNer.cs @@ -40,6 +40,7 @@ public TextNer(MachineLearningTableJobInput trainingData) : base(trainingData) /// Primary metric for Text-NER task. /// Only 'Accuracy' is supported for Text-NER, so user need not set this explicitly. /// +<<<<<<< HEAD /// Execution constraints for AutoMLJob. /// Featurization inputs needed for AutoML job. /// Validation data inputs. @@ -48,6 +49,16 @@ internal TextNer(TaskType taskType, MachineLearningLogVerbosity? logVerbosity, M PrimaryMetric = primaryMetric; LimitSettings = limitSettings; FeaturizationSettings = featurizationSettings; +======= + /// Featurization inputs needed for AutoML job. + /// Execution constraints for AutoMLJob. + /// Validation data inputs. + internal TextNer(MachineLearningLogVerbosity? logVerbosity, string targetColumnName, TaskType taskType, MachineLearningTableJobInput trainingData, IDictionary serializedAdditionalRawData, ClassificationPrimaryMetric? primaryMetric, NlpVerticalFeaturizationSettings featurizationSettings, NlpVerticalLimitSettings limitSettings, MachineLearningTableJobInput validationData) : base(logVerbosity, targetColumnName, taskType, trainingData, serializedAdditionalRawData) + { + PrimaryMetric = primaryMetric; + FeaturizationSettings = featurizationSettings; + LimitSettings = limitSettings; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 ValidationData = validationData; TaskType = taskType; } @@ -78,6 +89,11 @@ public string FeaturizationDatasetLanguage } } +<<<<<<< HEAD +======= + /// Execution constraints for AutoMLJob. + public NlpVerticalLimitSettings LimitSettings { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Validation data inputs. public MachineLearningTableJobInput ValidationData { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs index 264424615e97..33199729392d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.Serialization.cs @@ -30,11 +30,14 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteStringValue(DataType.ToString()); writer.WritePropertyName("dataUri"u8); writer.WriteStringValue(DataUri.AbsoluteUri); +<<<<<<< HEAD if (Optional.IsDefined(IsArchived)) { writer.WritePropertyName("isArchived"u8); writer.WriteBooleanValue(IsArchived.Value); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(IsAnonymous)) { writer.WritePropertyName("isAnonymous"u8); @@ -128,6 +131,10 @@ internal static UnknownDataVersionBase DeserializeUnknownDataVersionBase(JsonEle } MachineLearningDataType dataType = "Unknown"; Uri dataUri = default; +<<<<<<< HEAD +======= + bool? isAnonymous = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 bool? isArchived = default; bool? isAnonymous = default; string description = default; @@ -147,6 +154,7 @@ internal static UnknownDataVersionBase DeserializeUnknownDataVersionBase(JsonEle dataUri = new Uri(property.Value.GetString()); continue; } +<<<<<<< HEAD if (property.NameEquals("isArchived"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -156,6 +164,8 @@ internal static UnknownDataVersionBase DeserializeUnknownDataVersionBase(JsonEle isArchived = property.Value.GetBoolean(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("isAnonymous"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -216,6 +226,10 @@ internal static UnknownDataVersionBase DeserializeUnknownDataVersionBase(JsonEle tags ?? new ChangeTrackingDictionary(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, +<<<<<<< HEAD +======= + isAnonymous, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 isArchived, isAnonymous, dataType, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs index ecac608a1f53..89ff9a4c4a06 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDataVersionBase.cs @@ -18,11 +18,19 @@ internal partial class UnknownDataVersionBase : MachineLearningDataVersionProper /// Tag dictionary. Tags can be added, removed, and updated. /// The asset property dictionary. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD /// Is the asset archived?. /// If the name version are system generated (anonymous registration). /// [Required] Specifies the type of data. /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. internal UnknownDataVersionBase(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, bool? isArchived, bool? isAnonymous, MachineLearningDataType dataType, Uri dataUri) : base(description, tags, properties, serializedAdditionalRawData, isArchived, isAnonymous, dataType, dataUri) +======= + /// If the name version are system generated (anonymous registration). + /// Is the asset archived?. + /// [Required] Specifies the type of data. + /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. + internal UnknownDataVersionBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, bool? isAnonymous, bool? isArchived, MachineLearningDataType dataType, Uri dataUri) : base(description, properties, tags, serializedAdditionalRawData, isAnonymous, isArchived, dataType, dataUri) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { DataType = dataType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs index ebc160f1029b..d9253ebce92e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.Serialization.cs @@ -202,8 +202,12 @@ internal static UnknownDatastore DeserializeUnknownDatastore(JsonElement element properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, datastoreType, +<<<<<<< HEAD isDefault, credentials); +======= + isDefault); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs index e88ecbd7ffce..b7e12d67e3e4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownDatastore.cs @@ -25,7 +25,13 @@ internal partial class UnknownDatastore : MachineLearningDatastoreProperties /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , and . /// +<<<<<<< HEAD internal UnknownDatastore(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, DatastoreType datastoreType, bool? isDefault, MachineLearningDatastoreCredentials credentials) : base(description, tags, properties, serializedAdditionalRawData, datastoreType, isDefault, credentials) +======= + /// [Required] Storage type backing the datastore. + /// Readonly property to indicate if datastore is the workspace default datastore. + internal UnknownDatastore(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, MachineLearningDatastoreCredentials credentials, DatastoreType datastoreType, bool? isDefault) : base(description, properties, tags, serializedAdditionalRawData, credentials, datastoreType, isDefault) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { DatastoreType = datastoreType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.Serialization.cs new file mode 100644 index 000000000000..559203e2f1ed --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class UnknownEndpointDeploymentResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("type"u8); + writer.WriteStringValue(EndpointDeploymentResourcePropertiesType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointDeploymentResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + + internal static UnknownEndpointDeploymentResourceProperties DeserializeUnknownEndpointDeploymentResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string failureReason = default; + DefaultResourceProvisioningState? provisioningState = default; + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownEndpointDeploymentResourceProperties(failureReason, provisioningState, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointDeploymentResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointDeploymentResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointDeploymentResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.cs new file mode 100644 index 000000000000..24651ee23ad7 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointDeploymentResourceProperties.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of EndpointDeploymentResourceProperties. + internal partial class UnknownEndpointDeploymentResourceProperties : EndpointDeploymentResourceProperties + { + /// Initializes a new instance of . + /// The failure reason if the creation failed. + /// Read-only provision state status property. + /// Kind of the deployment. + /// Keeps track of any properties unknown to the library. + internal UnknownEndpointDeploymentResourceProperties(string failureReason, DefaultResourceProvisioningState? provisioningState, string endpointDeploymentResourcePropertiesType, IDictionary serializedAdditionalRawData) : base(failureReason, provisioningState, endpointDeploymentResourcePropertiesType, serializedAdditionalRawData) + { + EndpointDeploymentResourcePropertiesType = endpointDeploymentResourcePropertiesType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownEndpointDeploymentResourceProperties() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.Serialization.cs new file mode 100644 index 000000000000..83517db80a0a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class UnknownEndpointResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(AssociatedResourceId)) + { + writer.WritePropertyName("associatedResourceId"u8); + writer.WriteStringValue(AssociatedResourceId); + } + if (Optional.IsCollectionDefined(Deployments)) + { + writer.WritePropertyName("deployments"u8); + writer.WriteStartArray(); + foreach (var item in Deployments) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.ToString()); + if (Optional.IsDefined(EndpointUri)) + { + writer.WritePropertyName("endpointUri"u8); + writer.WriteStringValue(EndpointUri.AbsoluteUri); + } + if (Optional.IsDefined(FailureReason)) + { + writer.WritePropertyName("failureReason"u8); + writer.WriteStringValue(FailureReason); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(ShouldCreateAiServicesEndpoint)) + { + writer.WritePropertyName("shouldCreateAiServicesEndpoint"u8); + writer.WriteBooleanValue(ShouldCreateAiServicesEndpoint.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + EndpointResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + + internal static UnknownEndpointResourceProperties DeserializeUnknownEndpointResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier associatedResourceId = default; + IList deployments = default; + EndpointType endpointType = "Unknown"; + Uri endpointUri = default; + string failureReason = default; + AzureLocation? location = default; + string name = default; + DefaultResourceProvisioningState? provisioningState = default; + bool? shouldCreateAiServicesEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("associatedResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + associatedResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("deployments"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(item, options)); + } + deployments = array; + continue; + } + if (property.NameEquals("endpointType"u8)) + { + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("endpointUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("failureReason"u8)) + { + failureReason = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DefaultResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("shouldCreateAiServicesEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shouldCreateAiServicesEndpoint = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownEndpointResourceProperties( + associatedResourceId, + deployments ?? new ChangeTrackingList(), + endpointType, + endpointUri, + failureReason, + location, + name, + provisioningState, + shouldCreateAiServicesEndpoint, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + EndpointResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEndpointResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.cs new file mode 100644 index 000000000000..834f1d27d801 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownEndpointResourceProperties.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of EndpointResourceProperties. + internal partial class UnknownEndpointResourceProperties : EndpointResourceProperties + { + /// Initializes a new instance of . + /// Byo resource id for creating the built-in model service endpoints. + /// Deployments info. + /// Type of the endpoint. + /// Uri of the endpoint. + /// The failure reason if the creation failed. + /// + /// Location of the endpoint. + /// Since input dto and when parse endpoint resource share the same contract + /// this Location field is just for parse the endpoint resource info + /// we won't let customer specify the endpoint resource location since we will create it the same location as workspace + /// + /// Name of the endpoint. + /// Read-only provision state status property. + /// Whether the proxy (non-byo) endpoint is a regular endpoint or a OneKeyV2 AI services account endpoint. + /// Keeps track of any properties unknown to the library. + internal UnknownEndpointResourceProperties(ResourceIdentifier associatedResourceId, IList deployments, EndpointType endpointType, Uri endpointUri, string failureReason, AzureLocation? location, string name, DefaultResourceProvisioningState? provisioningState, bool? shouldCreateAiServicesEndpoint, IDictionary serializedAdditionalRawData) : base(associatedResourceId, deployments, endpointType, endpointUri, failureReason, location, name, provisioningState, shouldCreateAiServicesEndpoint, serializedAdditionalRawData) + { + EndpointType = endpointType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownEndpointResourceProperties() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.Serialization.cs new file mode 100644 index 000000000000..ab85d7c1c6d8 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + internal partial class UnknownFineTuningVertical : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("modelProvider"u8); + writer.WriteStringValue(ModelProvider.ToString()); + writer.WritePropertyName("taskType"u8); + writer.WriteStringValue(TaskType.ToString()); + writer.WritePropertyName("trainingData"u8); + writer.WriteObjectValue(TrainingData, options); + if (Optional.IsDefined(ValidationData)) + { + if (ValidationData != null) + { + writer.WritePropertyName("validationData"u8); + writer.WriteObjectValue(ValidationData, options); + } + else + { + writer.WriteNull("validationData"); + } + } + writer.WritePropertyName("model"u8); + writer.WriteObjectValue(Model, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FineTuningVertical IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFineTuningVertical(document.RootElement, options); + } + + internal static UnknownFineTuningVertical DeserializeUnknownFineTuningVertical(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ModelProvider modelProvider = "Unknown"; + FineTuningTaskType taskType = default; + MachineLearningJobInput trainingData = default; + MachineLearningJobInput validationData = default; + MachineLearningFlowModelJobInput model = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("modelProvider"u8)) + { + modelProvider = new ModelProvider(property.Value.GetString()); + continue; + } + if (property.NameEquals("taskType"u8)) + { + taskType = new FineTuningTaskType(property.Value.GetString()); + continue; + } + if (property.NameEquals("trainingData"u8)) + { + trainingData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("validationData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + validationData = null; + continue; + } + validationData = MachineLearningJobInput.DeserializeMachineLearningJobInput(property.Value, options); + continue; + } + if (property.NameEquals("model"u8)) + { + model = MachineLearningFlowModelJobInput.DeserializeMachineLearningFlowModelJobInput(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownFineTuningVertical( + modelProvider, + taskType, + trainingData, + validationData, + model, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support writing '{options.Format}' format."); + } + } + + FineTuningVertical IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFineTuningVertical(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FineTuningVertical)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.cs new file mode 100644 index 000000000000..e33e8b3ad11a --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownFineTuningVertical.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.MachineLearning.Models +{ + /// Unknown version of FineTuningVertical. + internal partial class UnknownFineTuningVertical : FineTuningVertical + { + /// Initializes a new instance of . + /// [Required] Enum to determine the type of fine tuning. + /// [Required] Fine tuning task type. + /// + /// [Required] Training data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// + /// Validation data for fine tuning. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , and . + /// + /// [Required] Input model for fine tuning. + /// Keeps track of any properties unknown to the library. + internal UnknownFineTuningVertical(ModelProvider modelProvider, FineTuningTaskType taskType, MachineLearningJobInput trainingData, MachineLearningJobInput validationData, MachineLearningFlowModelJobInput model, IDictionary serializedAdditionalRawData) : base(modelProvider, taskType, trainingData, validationData, model, serializedAdditionalRawData) + { + ModelProvider = modelProvider; + } + + /// Initializes a new instance of for deserialization. + internal UnknownFineTuningVertical() + { + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs index 2783c1d078f9..863b552dbc0a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.Serialization.cs @@ -50,6 +50,40 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("experimentName"u8); writer.WriteStringValue(ExperimentName); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Identity)) + { + if (Identity != null) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + else + { + writer.WriteNull("identity"); + } + } + if (Optional.IsDefined(IsArchived)) + { + writer.WritePropertyName("isArchived"u8); + writer.WriteBooleanValue(IsArchived.Value); + } + writer.WritePropertyName("jobType"u8); + writer.WriteStringValue(JobType.ToString()); + if (Optional.IsDefined(NotificationSetting)) + { + if (NotificationSetting != null) + { + writer.WritePropertyName("notificationSetting"u8); + writer.WriteObjectValue(NotificationSetting, options); + } + else + { + writer.WriteNull("notificationSetting"); + } + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(Services)) { if (Services != null) @@ -208,7 +242,12 @@ internal static UnknownJobBase DeserializeUnknownJobBase(JsonElement element, Mo return null; } JobType jobType = "Unknown"; +<<<<<<< HEAD string displayName = default; +======= + NotificationSetting notificationSetting = default; + IDictionary services = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningJobStatus? status = default; string experimentName = default; IDictionary services = default; @@ -253,6 +292,43 @@ internal static UnknownJobBase DeserializeUnknownJobBase(JsonElement element, Mo experimentName = property.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + identity = null; + continue; + } + identity = MachineLearningIdentityConfiguration.DeserializeMachineLearningIdentityConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("isArchived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isArchived = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("jobType"u8)) + { + jobType = new JobType(property.Value.GetString()); + continue; + } + if (property.NameEquals("notificationSetting"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + notificationSetting = null; + continue; + } + notificationSetting = NotificationSetting.DeserializeNotificationSetting(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("services"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -369,9 +445,13 @@ internal static UnknownJobBase DeserializeUnknownJobBase(JsonElement element, Mo properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, jobType, +<<<<<<< HEAD displayName, status, experimentName, +======= + notificationSetting, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 services ?? new ChangeTrackingDictionary(), computeId, isArchived, diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs index 620b6cfddf63..1c9d699e3ddc 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownJobBase.cs @@ -37,7 +37,16 @@ internal partial class UnknownJobBase : MachineLearningJobProperties /// /// ARM resource ID of the component resource. /// Notification setting for the job. +<<<<<<< HEAD internal UnknownJobBase(string description, IDictionary tags, IDictionary properties, IDictionary serializedAdditionalRawData, JobType jobType, string displayName, MachineLearningJobStatus? status, string experimentName, IDictionary services, ResourceIdentifier computeId, bool? isArchived, MachineLearningIdentityConfiguration identity, ResourceIdentifier componentId, NotificationSetting notificationSetting) : base(description, tags, properties, serializedAdditionalRawData, jobType, displayName, status, experimentName, services, computeId, isArchived, identity, componentId, notificationSetting) +======= + /// + /// List of JobEndpoints. + /// For local jobs, a job endpoint will have an endpoint value of FileStreamObject. + /// + /// Status of the job. + internal UnknownJobBase(string description, IDictionary properties, IDictionary tags, IDictionary serializedAdditionalRawData, ResourceIdentifier componentId, ResourceIdentifier computeId, string displayName, string experimentName, MachineLearningIdentityConfiguration identity, bool? isArchived, JobType jobType, NotificationSetting notificationSetting, IDictionary services, MachineLearningJobStatus? status) : base(description, properties, tags, serializedAdditionalRawData, componentId, computeId, displayName, experimentName, identity, isArchived, jobType, notificationSetting, services, status) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { JobType = jobType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs index 68c90197c6a7..095c5f3caa89 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.Serialization.cs @@ -26,8 +26,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); +<<<<<<< HEAD writer.WritePropertyName("signalType"u8); writer.WriteStringValue(SignalType.ToString()); +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsCollectionDefined(NotificationTypes)) { if (NotificationTypes != null) @@ -101,6 +104,11 @@ internal static UnknownMonitoringSignalBase DeserializeUnknownMonitoringSignalBa { return null; } +<<<<<<< HEAD +======= + IList notificationTypes = default; + IDictionary properties = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MonitoringSignalType signalType = "Unknown"; IList notificationTypes = default; IDictionary properties = default; @@ -108,11 +116,14 @@ internal static UnknownMonitoringSignalBase DeserializeUnknownMonitoringSignalBa Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("signalType"u8)) { signalType = new MonitoringSignalType(property.Value.GetString()); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("notificationTypes"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -149,7 +160,11 @@ internal static UnknownMonitoringSignalBase DeserializeUnknownMonitoringSignalBa } } serializedAdditionalRawData = rawDataDictionary; +<<<<<<< HEAD return new UnknownMonitoringSignalBase(signalType, notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); +======= + return new UnknownMonitoringSignalBase(notificationTypes ?? new ChangeTrackingList(), properties ?? new ChangeTrackingDictionary(), signalType, serializedAdditionalRawData); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs index 254ff9abf643..214ec3c506f6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownMonitoringSignalBase.cs @@ -14,11 +14,20 @@ namespace Azure.ResourceManager.MachineLearning.Models internal partial class UnknownMonitoringSignalBase : MonitoringSignalBase { /// Initializes a new instance of . +<<<<<<< HEAD +======= + /// The current notification mode for this signal. + /// Property dictionary. Properties can be added, but not removed or altered. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// [Required] Specifies the type of signal to monitor. /// The current notification mode for this signal. /// Property dictionary. Properties can be added, but not removed or altered. /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal UnknownMonitoringSignalBase(MonitoringSignalType signalType, IList notificationTypes, IDictionary properties, IDictionary serializedAdditionalRawData) : base(signalType, notificationTypes, properties, serializedAdditionalRawData) +======= + internal UnknownMonitoringSignalBase(IList notificationTypes, IDictionary properties, MonitoringSignalType signalType, IDictionary serializedAdditionalRawData) : base(notificationTypes, properties, signalType, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { SignalType = signalType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs index 4b42fdbd979b..895d405710b8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOnlineDeployment.cs @@ -15,6 +15,11 @@ internal partial class UnknownOnlineDeployment : MachineLearningOnlineDeployment { /// Initializes a new instance of . /// Description of the endpoint deployment. +<<<<<<< HEAD +======= + /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. + /// Environment variables configuration for the deployment. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Property dictionary. Properties can be added, but not removed or altered. /// Code configuration for the endpoint deployment. /// ARM resource ID or AssetId of the environment specification for the endpoint deployment. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs index 40ff3b3f9660..f37a5172caa1 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.Serialization.cs @@ -31,6 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("category"u8); writer.WriteStringValue(Category.Value.ToString()); } + if (options.Format != "W" && Optional.IsCollectionDefined(ParentRuleNames)) + { + writer.WritePropertyName("parentRuleNames"u8); + writer.WriteStartArray(); + foreach (var item in ParentRuleNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -77,6 +87,7 @@ internal static UnknownOutboundRule DeserializeUnknownOutboundRule(JsonElement e return null; } OutboundRuleCategory? category = default; + IReadOnlyList parentRuleNames = default; OutboundRuleStatus? status = default; OutboundRuleType type = "Unknown"; IDictionary serializedAdditionalRawData = default; @@ -92,6 +103,20 @@ internal static UnknownOutboundRule DeserializeUnknownOutboundRule(JsonElement e category = new OutboundRuleCategory(property.Value.GetString()); continue; } + if (property.NameEquals("parentRuleNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + parentRuleNames = array; + continue; + } if (property.NameEquals("status"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -112,7 +137,7 @@ internal static UnknownOutboundRule DeserializeUnknownOutboundRule(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownOutboundRule(category, status, type, serializedAdditionalRawData); + return new UnknownOutboundRule(category, parentRuleNames ?? new ChangeTrackingList(), status, type, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs index 57fa4aa447f2..0299ae72a728 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownOutboundRule.cs @@ -15,10 +15,11 @@ internal partial class UnknownOutboundRule : MachineLearningOutboundRule { /// Initializes a new instance of . /// Category of a managed network Outbound Rule of a machine learning workspace. + /// /// Type of a managed network Outbound Rule of a machine learning workspace. /// Type of a managed network Outbound Rule of a machine learning workspace. /// Keeps track of any properties unknown to the library. - internal UnknownOutboundRule(OutboundRuleCategory? category, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) : base(category, status, outboundRuleType, serializedAdditionalRawData) + internal UnknownOutboundRule(OutboundRuleCategory? category, IReadOnlyList parentRuleNames, OutboundRuleStatus? status, OutboundRuleType outboundRuleType, IDictionary serializedAdditionalRawData) : base(category, parentRuleNames, status, outboundRuleType, serializedAdditionalRawData) { OutboundRuleType = outboundRuleType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.Serialization.cs index fc19463c071f..19fc1794bda5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.Serialization.cs @@ -99,6 +99,10 @@ internal static UnknownTriggerBase DeserializeUnknownTriggerBase(JsonElement ele string endTime = default; string startTime = default; string timeZone = default; +<<<<<<< HEAD +======= + TriggerType triggerType = "Unknown"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -133,6 +137,14 @@ internal static UnknownTriggerBase DeserializeUnknownTriggerBase(JsonElement ele timeZone = property.Value.GetString(); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("triggerType"u8)) + { + triggerType = new TriggerType(property.Value.GetString()); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.cs index 3268b7ef6bb8..81c3bf095631 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownTriggerBase.cs @@ -26,7 +26,11 @@ internal partial class UnknownTriggerBase : MachineLearningTriggerBase /// TimeZone should follow Windows time zone format. Refer: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11 /// /// Keeps track of any properties unknown to the library. +<<<<<<< HEAD internal UnknownTriggerBase(TriggerType triggerType, string endTime, string startTime, string timeZone, IDictionary serializedAdditionalRawData) : base(triggerType, endTime, startTime, timeZone, serializedAdditionalRawData) +======= + internal UnknownTriggerBase(string endTime, string startTime, string timeZone, TriggerType triggerType, IDictionary serializedAdditionalRawData) : base(endTime, startTime, timeZone, triggerType, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { TriggerType = triggerType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs index beb707d9b0f1..3a8b34e7f05f 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.Serialization.cs @@ -38,12 +38,21 @@ void IJsonModel.Write(Utf8JsonWrit writer.WritePropertyName("createdByWorkspaceArmId"u8); writer.WriteStringValue(CreatedByWorkspaceArmId); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteStringValue(Error); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(ExpiryOn)) { writer.WritePropertyName("expiryTime"u8); writer.WriteStringValue(ExpiryOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Group)) +<<<<<<< HEAD { writer.WritePropertyName("group"u8); writer.WriteStringValue(Group.Value.ToString()); @@ -52,12 +61,54 @@ void IJsonModel.Write(Utf8JsonWrit { writer.WritePropertyName("isSharedToAll"u8); writer.WriteBooleanValue(IsSharedToAll.Value); +======= + { + writer.WritePropertyName("group"u8); + writer.WriteStringValue(Group.Value.ToString()); + } + if (Optional.IsDefined(IsSharedToAll)) + { + writer.WritePropertyName("isSharedToAll"u8); + writer.WriteBooleanValue(IsSharedToAll.Value); + } + if (Optional.IsCollectionDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); + writer.WriteStartObject(); + foreach (var item in Metadata) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(PeRequirement)) + { + writer.WritePropertyName("peRequirement"u8); + writer.WriteStringValue(PeRequirement.Value.ToString()); + } + if (Optional.IsDefined(PeStatus)) + { + writer.WritePropertyName("peStatus"u8); + writer.WriteStringValue(PeStatus.Value.ToString()); + } + if (Optional.IsCollectionDefined(SharedUserList)) + { + writer.WritePropertyName("sharedUserList"u8); + writer.WriteStartArray(); + foreach (var item in SharedUserList) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (Optional.IsDefined(Target)) { writer.WritePropertyName("target"u8); writer.WriteStringValue(Target); } +<<<<<<< HEAD if (Optional.IsCollectionDefined(Metadata)) { writer.WritePropertyName("metadata"u8); @@ -88,6 +139,12 @@ void IJsonModel.Write(Utf8JsonWrit { writer.WritePropertyName("valueFormat"u8); writer.WriteStringValue(ValueFormat.Value.ToString()); +======= + if (Optional.IsDefined(UseWorkspaceManagedIdentity)) + { + writer.WritePropertyName("useWorkspaceManagedIdentity"u8); + writer.WriteBooleanValue(UseWorkspaceManagedIdentity.Value); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -130,6 +187,7 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa MachineLearningConnectionAuthType authType = "Unknown"; MachineLearningConnectionCategory? category = default; ResourceIdentifier createdByWorkspaceArmId = default; +<<<<<<< HEAD DateTimeOffset? expiryTime = default; ConnectionGroup? group = default; bool? isSharedToAll = default; @@ -138,6 +196,18 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa IList sharedUserList = default; string value = default; MachineLearningValueFormat? valueFormat = default; +======= + string error = default; + DateTimeOffset? expiryTime = default; + ConnectionGroup? group = default; + bool? isSharedToAll = default; + IDictionary metadata = default; + ManagedPERequirement? peRequirement = default; + ManagedPEStatus? peStatus = default; + IList sharedUserList = default; + string target = default; + bool? useWorkspaceManagedIdentity = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -165,6 +235,14 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa createdByWorkspaceArmId = new ResourceIdentifier(property.Value.GetString()); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("error"u8)) + { + error = property.Value.GetString(); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("expiryTime"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -192,11 +270,14 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa isSharedToAll = property.Value.GetBoolean(); continue; } +<<<<<<< HEAD if (property.NameEquals("target"u8)) { target = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("metadata"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -209,6 +290,41 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa dictionary.Add(property0.Name, property0.Value.GetString()); } metadata = dictionary; +<<<<<<< HEAD +======= + continue; + } + if (property.NameEquals("peRequirement"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peRequirement = new ManagedPERequirement(property.Value.GetString()); + continue; + } + if (property.NameEquals("peStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + peStatus = new ManagedPEStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("sharedUserList"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + sharedUserList = array; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 continue; } if (property.NameEquals("sharedUserList"u8)) @@ -239,6 +355,15 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa valueFormat = new MachineLearningValueFormat(property.Value.GetString()); continue; } + if (property.NameEquals("useWorkspaceManagedIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + useWorkspaceManagedIdentity = property.Value.GetBoolean(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -249,6 +374,7 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa authType, category, createdByWorkspaceArmId, +<<<<<<< HEAD expiryTime, group, isSharedToAll, @@ -257,6 +383,18 @@ internal static UnknownWorkspaceConnectionPropertiesV2 DeserializeUnknownWorkspa sharedUserList ?? new ChangeTrackingList(), value, valueFormat, +======= + error, + expiryTime, + group, + isSharedToAll, + metadata ?? new ChangeTrackingDictionary(), + peRequirement, + peStatus, + sharedUserList ?? new ChangeTrackingList(), + target, + useWorkspaceManagedIdentity, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs index 73a24c1e6223..49d54aeb7078 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/UnknownWorkspaceConnectionPropertiesV2.cs @@ -18,6 +18,7 @@ internal partial class UnknownWorkspaceConnectionPropertiesV2 : MachineLearningW /// Authentication type of the connection target. /// Category of the connection. /// +<<<<<<< HEAD /// /// Group based on connection category. /// @@ -28,6 +29,20 @@ internal partial class UnknownWorkspaceConnectionPropertiesV2 : MachineLearningW /// format for the workspace connection value. /// Keeps track of any properties unknown to the library. internal UnknownWorkspaceConnectionPropertiesV2(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, string target, IDictionary metadata, IList sharedUserList, string value, MachineLearningValueFormat? valueFormat, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, expiryOn, group, isSharedToAll, target, metadata, sharedUserList, value, valueFormat, serializedAdditionalRawData) +======= + /// + /// + /// Group based on connection category. + /// + /// Store user metadata for this connection. + /// + /// + /// + /// + /// + /// Keeps track of any properties unknown to the library. + internal UnknownWorkspaceConnectionPropertiesV2(MachineLearningConnectionAuthType authType, MachineLearningConnectionCategory? category, ResourceIdentifier createdByWorkspaceArmId, string error, DateTimeOffset? expiryOn, ConnectionGroup? group, bool? isSharedToAll, IDictionary metadata, ManagedPERequirement? peRequirement, ManagedPEStatus? peStatus, IList sharedUserList, string target, bool? useWorkspaceManagedIdentity, IDictionary serializedAdditionalRawData) : base(authType, category, createdByWorkspaceArmId, error, expiryOn, group, isSharedToAll, metadata, peRequirement, peStatus, sharedUserList, target, useWorkspaceManagedIdentity, serializedAdditionalRawData) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { AuthType = authType; } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs index 12db9be11b3f..198a8ea05240 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/Models/WorkspaceConnectionAccountKey.cs @@ -10,7 +10,11 @@ namespace Azure.ResourceManager.MachineLearning.Models { +<<<<<<< HEAD /// The WorkspaceConnectionAccountKey. +======= + /// Account key object for workspace connection credential. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 internal partial class WorkspaceConnectionAccountKey { /// diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.Serialization.cs new file mode 100644 index 000000000000..36027b868ed6 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistItemPropertiesBasicResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiBlocklistItemPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiBlocklistItemPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.cs new file mode 100644 index 000000000000..b1a592d930f9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResource.cs @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a RaiBlocklistItemPropertiesBasicResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetRaiBlocklistItemPropertiesBasicResource method. + /// Otherwise you can get one from its parent resource using the GetRaiBlocklistItemPropertiesBasicResource method. + /// + public partial class RaiBlocklistItemPropertiesBasicResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The raiBlocklistName. + /// The raiBlocklistItemName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics; + private readonly ConnectionRaiBlocklistItemRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient; + private readonly RaiBlocklistItemPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/raiBlocklists/raiBlocklistItems"; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistItemPropertiesBasicResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RaiBlocklistItemPropertiesBasicResource(ArmClient client, RaiBlocklistItemPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal RaiBlocklistItemPropertiesBasicResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient = new ConnectionRaiBlocklistItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiBlocklistItemPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceCollection.cs new file mode 100644 index 000000000000..1d8680cc1a58 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetRaiBlocklistItemPropertiesBasicResources method from an instance of . + /// + public partial class RaiBlocklistItemPropertiesBasicResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics; + private readonly ConnectionRaiBlocklistItemRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient; + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics; + private readonly ConnectionRaiBlocklistItemsRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistItemPropertiesBasicResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal RaiBlocklistItemPropertiesBasicResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistItemPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistItemPropertiesBasicResource.ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient = new ConnectionRaiBlocklistItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistItemPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistItemPropertiesBasicResource.ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient = new ConnectionRaiBlocklistItemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != RaiBlocklistPropertiesBasicResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, RaiBlocklistPropertiesBasicResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistItemPropertiesBasicResourceOperationSource(Client), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItems_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistItemPropertiesBasicResource(Client, RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(e)), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics, Pipeline, "RaiBlocklistItemPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItems_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistItemPropertiesBasicResource(Client, RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(e)), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemsClientDiagnostics, Pipeline, "RaiBlocklistItemPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistItemPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, raiBlocklistItemName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistItemPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.Serialization.cs new file mode 100644 index 000000000000..27ad8f63407d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistItemPropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistItemPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement, options); + } + + internal static RaiBlocklistItemPropertiesBasicResourceData DeserializeRaiBlocklistItemPropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RaiBlocklistItemProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = RaiBlocklistItemProperties.DeserializeRaiBlocklistItemProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistItemPropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistItemPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistItemPropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.cs new file mode 100644 index 000000000000..00a0b7a6f4a4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistItemPropertiesBasicResourceData.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the RaiBlocklistItemPropertiesBasicResource data model. + public partial class RaiBlocklistItemPropertiesBasicResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// RAI Custom Blocklist Item properties. + /// is null. + public RaiBlocklistItemPropertiesBasicResourceData(RaiBlocklistItemProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist Item properties. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistItemPropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RaiBlocklistItemProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RaiBlocklistItemPropertiesBasicResourceData() + { + } + + /// RAI Custom Blocklist Item properties. + public RaiBlocklistItemProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.Serialization.cs new file mode 100644 index 000000000000..c51c34454ba5 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistPropertiesBasicResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiBlocklistPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiBlocklistPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.cs new file mode 100644 index 000000000000..4d08a466b733 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResource.cs @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a RaiBlocklistPropertiesBasicResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetRaiBlocklistPropertiesBasicResource method. + /// Otherwise you can get one from its parent resource using the GetRaiBlocklistPropertiesBasicResource method. + /// + public partial class RaiBlocklistPropertiesBasicResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The raiBlocklistName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics; + private readonly ConnectionRaiBlocklistRestOperations _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient; + private readonly ClientDiagnostics _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics; + private readonly ConnectionRaiBlocklistItemRestOperations _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient; + private readonly RaiBlocklistPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/raiBlocklists"; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistPropertiesBasicResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal RaiBlocklistPropertiesBasicResource(ArmClient client, RaiBlocklistPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal RaiBlocklistPropertiesBasicResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient = new ConnectionRaiBlocklistRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistItemPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistItemPropertiesBasicResource.ResourceType, out string raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); + _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient = new ConnectionRaiBlocklistItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiBlocklistPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of RaiBlocklistItemPropertiesBasicResources in the RaiBlocklistPropertiesBasicResource. + /// An object representing collection of RaiBlocklistItemPropertiesBasicResources and their operations over a RaiBlocklistItemPropertiesBasicResource. + public virtual RaiBlocklistItemPropertiesBasicResourceCollection GetRaiBlocklistItemPropertiesBasicResources() + { + return GetCachedClient(client => new RaiBlocklistItemPropertiesBasicResourceCollection(client, Id)); + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetRaiBlocklistItemPropertiesBasicResourceAsync(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + return await GetRaiBlocklistItemPropertiesBasicResources().GetAsync(raiBlocklistItemName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/raiBlocklistItems/{raiBlocklistItemName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetRaiBlocklistItemPropertiesBasicResource(string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + return GetRaiBlocklistItemPropertiesBasicResources().Get(raiBlocklistItemName, cancellationToken); + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Get"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Delete"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.Update"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_AddBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// is null. + public virtual async Task>> AddBulkConnectionRaiBlocklistItemAsync(WaitUntil waitUntil, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.AddBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.AddBulkAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation>(new IListOperationSource(), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAddBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/addRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_AddBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation> AddBulkConnectionRaiBlocklistItem(WaitUntil waitUntil, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.AddBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.AddBulk(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new MachineLearningArmOperation>(new IListOperationSource(), _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateAddBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_DeleteBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// is null. + public virtual async Task DeleteBulkConnectionRaiBlocklistItemAsync(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.DeleteBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = await _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.DeleteBulkAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName}/deleteRaiBlocklistItems + /// + /// + /// Operation Id + /// ConnectionRaiBlocklistItem_DeleteBulk + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DeleteBulkConnectionRaiBlocklistItem(WaitUntil waitUntil, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResource.DeleteBulkConnectionRaiBlocklistItem"); + scope.Start(); + try + { + var response = _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.DeleteBulk(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new MachineLearningArmOperation(_raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemClientDiagnostics, Pipeline, _raiBlocklistItemPropertiesBasicResourceConnectionRaiBlocklistItemRestClient.CreateDeleteBulkRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceCollection.cs new file mode 100644 index 000000000000..48406f8e6acb --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetRaiBlocklistPropertiesBasicResources method from an instance of . + /// + public partial class RaiBlocklistPropertiesBasicResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics; + private readonly ConnectionRaiBlocklistRestOperations _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient; + private readonly ClientDiagnostics _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics; + private readonly ConnectionRaiBlocklistsRestOperations _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient; + + /// Initializes a new instance of the class for mocking. + protected RaiBlocklistPropertiesBasicResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal RaiBlocklistPropertiesBasicResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistPropertiesBasicResource.ResourceType, out string raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient = new ConnectionRaiBlocklistRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", RaiBlocklistPropertiesBasicResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(RaiBlocklistPropertiesBasicResource.ResourceType, out string raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsApiVersion); + _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient = new ConnectionRaiBlocklistsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceConnectionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceConnectionResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new RaiBlocklistPropertiesBasicResourceOperationSource(Client), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics, Pipeline, _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Get"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists + /// + /// + /// Operation Id + /// ConnectionRaiBlocklists_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistPropertiesBasicResource(Client, RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(e)), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics, Pipeline, "RaiBlocklistPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists + /// + /// + /// Operation Id + /// ConnectionRaiBlocklists_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RaiBlocklistPropertiesBasicResource(Client, RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(e)), _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistsClientDiagnostics, Pipeline, "RaiBlocklistPropertiesBasicResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.Exists"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiBlocklists/{raiBlocklistName} + /// + /// + /// Operation Id + /// ConnectionRaiBlocklist_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var scope = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistClientDiagnostics.CreateScope("RaiBlocklistPropertiesBasicResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _raiBlocklistPropertiesBasicResourceConnectionRaiBlocklistRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiBlocklistName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new RaiBlocklistPropertiesBasicResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.Serialization.cs new file mode 100644 index 000000000000..f8ec2150e080 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiBlocklistPropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiBlocklistPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement, options); + } + + internal static RaiBlocklistPropertiesBasicResourceData DeserializeRaiBlocklistPropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RaiBlocklistProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = RaiBlocklistProperties.DeserializeRaiBlocklistProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiBlocklistPropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + RaiBlocklistPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiBlocklistPropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.cs new file mode 100644 index 000000000000..02321fa00384 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiBlocklistPropertiesBasicResourceData.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// A class representing the RaiBlocklistPropertiesBasicResource data model. + public partial class RaiBlocklistPropertiesBasicResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// RAI Custom Blocklist properties. + /// is null. + public RaiBlocklistPropertiesBasicResourceData(RaiBlocklistProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// RAI Custom Blocklist properties. + /// Keeps track of any properties unknown to the library. + internal RaiBlocklistPropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RaiBlocklistProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RaiBlocklistPropertiesBasicResourceData() + { + } + + /// RAI Custom Blocklist properties. + internal RaiBlocklistProperties Properties { get; set; } + /// Description of the block list. + public string RaiBlocklistDescription + { + get => Properties is null ? default : Properties.Description; + set + { + if (Properties is null) + Properties = new RaiBlocklistProperties(); + Properties.Description = value; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.Serialization.cs new file mode 100644 index 000000000000..575935991f15 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class RaiPolicyPropertiesBasicResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + RaiPolicyPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement, options); + } + + internal static RaiPolicyPropertiesBasicResourceData DeserializeRaiPolicyPropertiesBasicResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + RaiPolicyProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = RaiPolicyProperties.DeserializeRaiPolicyProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RaiPolicyPropertiesBasicResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support writing '{options.Format}' format."); + } + } + + RaiPolicyPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RaiPolicyPropertiesBasicResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.cs new file mode 100644 index 000000000000..e54e633289d4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RaiPolicyPropertiesBasicResourceData.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.MachineLearning.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing the RaiPolicyPropertiesBasicResource data model. + /// Azure OpenAI Content Filters resource. + /// + public partial class RaiPolicyPropertiesBasicResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Azure OpenAI Content Filters properties. + /// is null. + public RaiPolicyPropertiesBasicResourceData(RaiPolicyProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Azure OpenAI Content Filters properties. + /// Keeps track of any properties unknown to the library. + internal RaiPolicyPropertiesBasicResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RaiPolicyProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RaiPolicyPropertiesBasicResourceData() + { + } + + /// Azure OpenAI Content Filters properties. + public RaiPolicyProperties Properties { get; set; } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs index 35519ef5772d..9367c8eb35ee 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchDeploymentsRestOperations.cs @@ -32,7 +32,11 @@ public BatchDeploymentsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs index 925739d2c42f..7f16e37497cb 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/BatchEndpointsRestOperations.cs @@ -32,7 +32,11 @@ public BatchEndpointsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs index 9fb6434b62a9..15c40ff366e5 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeContainersRestOperations.cs @@ -32,7 +32,11 @@ public CodeContainersRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs index f9f566a802b4..1a60e50147a0 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/CodeVersionsRestOperations.cs @@ -32,7 +32,11 @@ public CodeVersionsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs index 7e0d0cb7cb15..d9aeccddfaa6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentContainersRestOperations.cs @@ -32,7 +32,11 @@ public ComponentContainersRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs index 04bedb317615..d6be428d3cb9 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComponentVersionsRestOperations.cs @@ -32,7 +32,11 @@ public ComponentVersionsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs index 0ef8ef68b311..89ab729ad230 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ComputeRestOperations.cs @@ -32,7 +32,11 @@ public ComputeRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -744,6 +748,111 @@ public Response ListKeys(string subscriptionId, s } } + internal RequestUriBuilder CreateUpdateDataMountsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/updateDataMounts", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateDataMountsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/updateDataMounts", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in dataMounts) + { + content.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update Data Mounts of a Machine Learning compute. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateDataMountsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var message = CreateUpdateDataMountsRequest(subscriptionId, resourceGroupName, workspaceName, computeName, dataMounts); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update Data Mounts of a Machine Learning compute. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The parameters for creating or updating a machine learning workspace. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response UpdateDataMounts(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IEnumerable dataMounts, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(dataMounts, nameof(dataMounts)); + + using var message = CreateUpdateDataMountsRequest(subscriptionId, resourceGroupName, workspaceName, computeName, dataMounts); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName) { var uri = new RawRequestUriBuilder(); @@ -1020,6 +1129,311 @@ public Response Restart(string subscriptionId, string resourceGroupName, string } } +<<<<<<< HEAD +======= + internal RequestUriBuilder CreateUpdateIdleShutdownSettingRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IdleShutdownSetting idleShutdownSetting) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/updateIdleShutdownSetting", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateIdleShutdownSettingRequest(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IdleShutdownSetting idleShutdownSetting) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/updateIdleShutdownSetting", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(idleShutdownSetting, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the idle shutdown setting of a compute instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The object for updating idle shutdown setting of specified ComputeInstance. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateIdleShutdownSettingAsync(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IdleShutdownSetting idleShutdownSetting, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(idleShutdownSetting, nameof(idleShutdownSetting)); + + using var message = CreateUpdateIdleShutdownSettingRequest(subscriptionId, resourceGroupName, workspaceName, computeName, idleShutdownSetting); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the idle shutdown setting of a compute instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The object for updating idle shutdown setting of specified ComputeInstance. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response UpdateIdleShutdownSetting(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, IdleShutdownSetting idleShutdownSetting, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(idleShutdownSetting, nameof(idleShutdownSetting)); + + using var message = CreateUpdateIdleShutdownSettingRequest(subscriptionId, resourceGroupName, workspaceName, computeName, idleShutdownSetting); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetAllowedResizeSizesRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/getAllowedVmSizesForResize", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetAllowedResizeSizesRequest(string subscriptionId, string resourceGroupName, string workspaceName, string computeName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/getAllowedVmSizesForResize", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns supported virtual machine sizes for resize. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAllowedResizeSizesAsync(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var message = CreateGetAllowedResizeSizesRequest(subscriptionId, resourceGroupName, workspaceName, computeName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineSizeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualMachineSizeListResult.DeserializeVirtualMachineSizeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns supported virtual machine sizes for resize. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetAllowedResizeSizes(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var message = CreateGetAllowedResizeSizesRequest(subscriptionId, resourceGroupName, workspaceName, computeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineSizeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualMachineSizeListResult.DeserializeVirtualMachineSizeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateResizeRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/resize", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateResizeRequest(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendPath("/resize", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(resizeSchema, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the size of a Compute Instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task ResizeAsync(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var message = CreateResizeRequest(subscriptionId, resourceGroupName, workspaceName, computeName, resizeSchema); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the size of a Compute Instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of Azure Machine Learning workspace. + /// Name of the Azure Machine Learning compute. + /// The object for updating VM size setting of specified Compute Instance. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Resize(string subscriptionId, string resourceGroupName, string workspaceName, string computeName, ResizeSchema resizeSchema, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(resizeSchema, nameof(resizeSchema)); + + using var message = CreateResizeRequest(subscriptionId, resourceGroupName, workspaceName, computeName, resizeSchema); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string skip) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemRestOperations.cs new file mode 100644 index 000000000000..3c147dc255bd --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemRestOperations.cs @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistItemRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistItemRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistItemRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateAddBulkRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/addRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateAddBulkRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/addRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteStartArray(); + foreach (var item in content) + { + content0.JsonWriter.WriteObjectValue(item, ModelSerializationExtensions.WireOptions); + } + content0.JsonWriter.WriteEndArray(); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task AddBulkAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateAddBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Add multiple blocklist items to the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Properties describing the custom blocklist items. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response AddBulk(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, IEnumerable content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateAddBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteBulkRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/deleteRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteBulkRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/deleteRaiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(body); +#else + using (JsonDocument document = JsonDocument.Parse(body)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteBulkAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDeleteBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete multiple blocklist items from the specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// List of RAI Blocklist Items Names. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response DeleteBulk(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, BinaryData body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateDeleteBulkRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistItemPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified custom blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistItemPropertiesBasicResourceData.DeserializeRaiBlocklistItemPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistItemPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems/", false); + uri.AppendPath(raiBlocklistItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified blocklist item associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// Name of the RaiBlocklist Item. + /// The to use. + /// The cancellation token to use. + /// , , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, string raiBlocklistItemName, RaiBlocklistItemPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNullOrEmpty(raiBlocklistItemName, nameof(raiBlocklistItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, raiBlocklistItemName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemsRestOperations.cs new file mode 100644 index 000000000000..adfea5970ca9 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistItemsRestOperations.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistItemsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistItemsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistItemsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendPath("/raiBlocklistItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklist items associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistItemPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistItemPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistRestOperations.cs new file mode 100644 index 000000000000..e864bf0736a3 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistRestOperations.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified custom blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistPropertiesBasicResourceData.DeserializeRaiBlocklistPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiBlocklistPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists/", false); + uri.AppendPath(raiBlocklistName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified blocklist associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The name of the RaiBlocklist. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiBlocklistName, RaiBlocklistPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiBlocklistName, nameof(raiBlocklistName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiBlocklistName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistsRestOperations.cs new file mode 100644 index 000000000000..f095c94a4773 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiBlocklistsRestOperations.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiBlocklistsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiBlocklistsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiBlocklistsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiBlocklists", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the custom blocklists associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiBlocklistPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiBlocklistPropertiesBasicResourceArmPaginatedResult.DeserializeRaiBlocklistPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPoliciesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPoliciesRestOperations.cs new file mode 100644 index 000000000000..d5e783d43501 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPoliciesRestOperations.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiPoliciesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiPoliciesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPolicyRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPolicyRestOperations.cs new file mode 100644 index 000000000000..d885c9356a50 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRaiPolicyRestOperations.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRaiPolicyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRaiPolicyRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRaiPolicyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, raiPolicyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRestOperations.cs new file mode 100644 index 000000000000..31f2b45cf56e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ConnectionRestOperations.cs @@ -0,0 +1,833 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class ConnectionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ConnectionRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ConnectionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListDeploymentsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListDeploymentsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListDeploymentsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListDeployments(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteDeploymentRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteDeploymentRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete Azure OpenAI connection deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteDeploymentAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete Azure OpenAI connection deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response DeleteDeployment(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetDeploymentRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDeploymentRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get deployments under the Azure OpenAI connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetDeploymentAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get deployments under the Azure OpenAI connection by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response GetDeployment(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateDeploymentRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateDeploymentRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update Azure OpenAI connection deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateDeploymentAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update Azure OpenAI connection deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdateDeployment(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateDeploymentRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, deploymentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetModelsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the Azure OpenAI connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModels(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListModelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/listConnectionModels", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListModelsRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/listConnectionModels", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListModelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListModelsRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get models under the Azure ML workspace for all Azure OpenAI connections that the user can deploy. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListModels(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListModelsRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListDeploymentsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListDeploymentsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListDeploymentsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListDeploymentsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateListDeploymentsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateGetModelsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the Azure OpenAI connection. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModelsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs index 75a692b8cd39..0ab3e2d336be 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataContainersRestOperations.cs @@ -32,7 +32,11 @@ public DataContainersRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs index 7022c7f9e509..f2aba3b97832 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DataVersionsRestOperations.cs @@ -32,7 +32,11 @@ public DataVersionsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs index 57ac90766ce4..c7cd3a3b1f7e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/DatastoresRestOperations.cs @@ -33,7 +33,11 @@ public DatastoresRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -517,7 +521,7 @@ public Response CreateOrUpdate(string subscription } } - internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name) + internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -534,7 +538,7 @@ internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, st return uri; } - internal HttpMessage CreateListSecretsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name) + internal HttpMessage CreateListSecretsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -553,6 +557,13 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + if (body != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + } _userAgent.Apply(message); return message; } @@ -562,17 +573,18 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Datastore name. + /// Secret expiry information. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListSecretsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + public async Task> ListSecretsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name); + using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name, body); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -593,17 +605,18 @@ public async Task> ListSecretsAsync(st /// The name of the resource group. The name is case insensitive. /// Name of Azure Machine Learning workspace. /// Datastore name. + /// Secret expiry information. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListSecrets(string subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default) + public Response ListSecrets(string subscriptionId, string resourceGroupName, string workspaceName, string name, SecretExpiry body = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name); + using var message = CreateListSecretsRequest(subscriptionId, resourceGroupName, workspaceName, name, body); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointDeploymentRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointDeploymentRestOperations.cs new file mode 100644 index 000000000000..ee46457e483b --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointDeploymentRestOperations.cs @@ -0,0 +1,751 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class EndpointDeploymentRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EndpointDeploymentRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public EndpointDeploymentRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetInWorkspaceRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + return uri; + } + + internal HttpMessage CreateGetInWorkspaceRequest(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the workspace scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetInWorkspaceAsync(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the workspace scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetInWorkspace(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the endpoint resource scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the endpoint resource scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete endpoint deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete endpoint deployment resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get deployments under endpoint resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get deployments under endpoint resource by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointDeploymentResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update endpoint deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update endpoint deployment resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, deploymentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetInWorkspaceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateGetInWorkspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, string skip) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the workspace scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetInWorkspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the workspace scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// Continuation token for pagination. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetInWorkspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, string skip = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetInWorkspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, skip); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get all the deployments under the endpoint resource scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get all the deployments under the endpoint resource scope. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointDeploymentResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointRestOperations.cs new file mode 100644 index 000000000000..2d7a12da4829 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EndpointRestOperations.cs @@ -0,0 +1,871 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class EndpointRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EndpointRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public EndpointRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (includeInferenceEndpoints != null) + { + uri.AppendQuery("includeInferenceEndpoints", includeInferenceEndpoints.Value, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (endpointType != null) + { + uri.AppendQuery("endpointType", endpointType.Value.ToString(), true); + } + if (includeInferenceEndpoints != null) + { + uri.AppendQuery("includeInferenceEndpoints", includeInferenceEndpoints.Value, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List All the endpoints under this workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List All the endpoints under this workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointResourcePropertiesBasicResourceData.DeserializeEndpointResourcePropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointResourcePropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update endpoint resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update endpoint resource with the specified parameters. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Endpoint resource object. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, EndpointResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/listKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/listKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List keys for the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointKeys value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointKeys.DeserializeEndpointKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List keys for the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListKeys(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointKeys value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointKeys.DeserializeEndpointKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetModelsRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/models", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the endpoint resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModels(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRegenerateKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/regenerateKey", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/regenerateKey", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Regenerate account keys. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> RegenerateKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AccountApiKeys value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AccountApiKeys.DeserializeAccountApiKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Regenerate account keys. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The to use. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response RegenerateKeys(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, RegenerateServiceAccountKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AccountApiKeys value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AccountApiKeys.DeserializeAccountApiKeys(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType, bool? includeInferenceEndpoints, string skip, string expand) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List All the endpoints under this workspace. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List All the endpoints under this workspace. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Endpoint type filter. + /// The ? to use. + /// Continuation token for pagination. + /// Whether the endpoint resource will be expand to include deployment information, e.g. $expand=deployments. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, EndpointType? endpointType = null, bool? includeInferenceEndpoints = null, string skip = null, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointType, includeInferenceEndpoints, skip, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointResourcePropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointResourcePropertiesBasicResourceArmPaginatedResult.DeserializeEndpointResourcePropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetModelsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateGetModelsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get available models under the endpoint resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetModelsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get available models under the endpoint resource. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetModelsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetModelsNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointModels value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EndpointModels.DeserializeEndpointModels(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs index 3d750c1a8513..660c97925a2c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentContainersRestOperations.cs @@ -32,7 +32,11 @@ public EnvironmentContainersRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs index 04be5571e628..0155fee7e065 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/EnvironmentVersionsRestOperations.cs @@ -32,7 +32,11 @@ public EnvironmentVersionsRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs index 92c50d85f52e..2629c98fc288 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesRestOperations.cs @@ -32,7 +32,11 @@ public FeaturesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs index 641b78d5942c..0bedfdeda291 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetContainersRestOperations.cs @@ -32,7 +32,11 @@ public FeaturesetContainersRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs index e4967143d2e0..c6ba0307196c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturesetVersionsRestOperations.cs @@ -32,7 +32,11 @@ public FeaturesetVersionsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs index f408fe7919c3..ecd0b9056d8d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityContainersRestOperations.cs @@ -32,7 +32,11 @@ public FeaturestoreEntityContainersRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs index fe1961c7bd81..6eb8e69f4549 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/FeaturestoreEntityVersionsRestOperations.cs @@ -32,7 +32,11 @@ public FeaturestoreEntityVersionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs index 348efcee5589..c4ea82d52c65 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/JobsRestOperations.cs @@ -32,7 +32,11 @@ public JobsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs index 1b4cd4263c3c..781e86c8cc83 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkProvisionsRestOperations.cs @@ -31,7 +31,11 @@ public ManagedNetworkProvisionsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -81,7 +85,7 @@ internal HttpMessage CreateProvisionManagedNetworkRequest(string subscriptionId, /// Provisions the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Managed Network Provisioning Options for a machine learning workspace. /// The cancellation token to use. /// , or is null. @@ -107,7 +111,7 @@ public async Task ProvisionManagedNetworkAsync(string subscriptionId, /// Provisions the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Managed Network Provisioning Options for a machine learning workspace. /// The cancellation token to use. /// , or is null. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs index ffbc98a38936..ef8a4401fa7e 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ManagedNetworkSettingsRuleRestOperations.cs @@ -32,7 +32,11 @@ public ManagedNetworkSettingsRuleRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +79,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Lists the managed network outbound rules for a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -104,7 +108,7 @@ public async Task> ListAsync(string subscriptio /// Lists the managed network outbound rules for a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -171,7 +175,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Deletes an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -199,7 +203,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Deletes an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -265,7 +269,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Gets an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -298,7 +302,7 @@ public async Task> GetAsync(strin /// Gets an outbound rule from the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// The cancellation token to use. /// , , or is null. @@ -373,7 +377,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// Creates or updates an outbound rule in the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// Outbound Rule to be created or updated in the managed network of a machine learning workspace. /// The cancellation token to use. @@ -402,7 +406,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// Creates or updates an outbound rule in the managed network of a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Name of the workspace managed network outbound rule. /// Outbound Rule to be created or updated in the managed network of a machine learning workspace. /// The cancellation token to use. @@ -454,7 +458,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -485,7 +489,7 @@ public async Task> ListNextPageAsync(string nex /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs index 675e7780ec39..90829a0bbe1c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/MarketplaceSubscriptionsRestOperations.cs @@ -32,7 +32,11 @@ public MarketplaceSubscriptionsRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs index 9e3d9ba62368..e95cdef1a3ee 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelContainersRestOperations.cs @@ -32,7 +32,11 @@ public ModelContainersRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs index 43f22dd291ce..e76b62d2988b 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ModelVersionsRestOperations.cs @@ -32,7 +32,11 @@ public ModelVersionsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs index 3f8deff4034a..10aec8777a23 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineDeploymentsRestOperations.cs @@ -32,7 +32,11 @@ public OnlineDeploymentsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs index e6f3c51ea7a7..6b91c18fc9a8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/OnlineEndpointsRestOperations.cs @@ -32,7 +32,11 @@ public OnlineEndpointsRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 2e995693b2ab..fcefe2307b22 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,11 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +79,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// List all the private endpoint connections associated with the workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -104,7 +108,7 @@ public async Task> /// List all the private endpoint connections associated with the workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -130,6 +134,101 @@ public Response List(string } } +<<<<<<< HEAD +======= + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Called by end-users to delete a PE connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// NRP Private Endpoint Connection Name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Called by end-users to delete a PE connection. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// NRP Private Endpoint Connection Name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string privateEndpointConnectionName) { var uri = new RawRequestUriBuilder(); @@ -171,8 +270,13 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Gets the specified private endpoint connection associated with the workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. +<<<<<<< HEAD /// Name of Azure Machine Learning workspace. /// The name of the private endpoint connection associated with the workspace. +======= + /// Azure Machine Learning Workspace Name. + /// NRP Private Endpoint Connection Name. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -204,8 +308,13 @@ public async Task> GetAsy /// Gets the specified private endpoint connection associated with the workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. +<<<<<<< HEAD /// Name of Azure Machine Learning workspace. /// The name of the private endpoint connection associated with the workspace. +======= + /// Azure Machine Learning Workspace Name. + /// NRP Private Endpoint Connection Name. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -279,9 +388,15 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// Update the state of specified private endpoint connection associated with the workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. +<<<<<<< HEAD /// Name of Azure Machine Learning workspace. /// The name of the private endpoint connection associated with the workspace. /// The private endpoint connection properties. +======= + /// Azure Machine Learning Workspace Name. + /// NRP Private Endpoint Connection Name. + /// PrivateEndpointConnection object. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -312,9 +427,15 @@ public async Task> Create /// Update the state of specified private endpoint connection associated with the workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. +<<<<<<< HEAD /// Name of Azure Machine Learning workspace. /// The name of the private endpoint connection associated with the workspace. /// The private endpoint connection properties. +======= + /// Azure Machine Learning Workspace Name. + /// NRP Private Endpoint Connection Name. + /// PrivateEndpointConnection object. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 6f1675a5ecb0..5a4c631c5c23 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,11 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -75,7 +79,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// Gets the private link resources that need to be created for a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -104,7 +108,7 @@ public async Task> ListAs /// Gets the private link resources that need to be created for a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs index 0b742113cdb1..0d69aeca58de 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/QuotasRestOperations.cs @@ -32,7 +32,11 @@ public QuotasRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPoliciesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPoliciesRestOperations.cs new file mode 100644 index 000000000000..3fbdb27bde44 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPoliciesRestOperations.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.MachineLearning.Models; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class RaiPoliciesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RaiPoliciesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public RaiPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the specified Content Filters associated with the Azure OpenAI account. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceArmPaginatedResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceArmPaginatedResult.DeserializeRaiPolicyPropertiesBasicResourceArmPaginatedResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPolicyRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPolicyRestOperations.cs new file mode 100644 index 000000000000..2b32aab3386e --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RaiPolicyRestOperations.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + internal partial class RaiPolicyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RaiPolicyRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public RaiPolicyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RaiPolicyPropertiesBasicResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((RaiPolicyPropertiesBasicResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendPath("/raiPolicies/", false); + uri.AppendPath(raiPolicyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Name of the endpoint resource. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, endpointName, raiPolicyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs index 95747240e26c..1317c7f7700c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistriesRestOperations.cs @@ -32,7 +32,11 @@ public RegistriesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs index c6bcbd9f560e..dfdfd813ef2c 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeContainersRestOperations.cs @@ -32,7 +32,11 @@ public RegistryCodeContainersRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs index 216962b75584..3f4a976da904 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryCodeVersionsRestOperations.cs @@ -32,7 +32,11 @@ public RegistryCodeVersionsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs index 8ea1ade9e26a..2ea50fbe0786 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentContainersRestOperations.cs @@ -32,7 +32,11 @@ public RegistryComponentContainersRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs index 66af309b3026..a9c48eda5740 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryComponentVersionsRestOperations.cs @@ -32,7 +32,11 @@ public RegistryComponentVersionsRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs index e744ebe86ba4..8c11722f21a8 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataContainersRestOperations.cs @@ -32,7 +32,11 @@ public RegistryDataContainersRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs index f666e9b47055..ffb715fa00d2 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataReferencesRestOperations.cs @@ -32,7 +32,11 @@ public RegistryDataReferencesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs index c01d05f88a74..ded04afbda28 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryDataVersionsRestOperations.cs @@ -32,7 +32,11 @@ public RegistryDataVersionsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs index a3e599fc83ae..19183217703d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentContainersRestOperations.cs @@ -32,7 +32,11 @@ public RegistryEnvironmentContainersRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs index 19a383ed1819..9bfced1bd265 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryEnvironmentVersionsRestOperations.cs @@ -32,7 +32,11 @@ public RegistryEnvironmentVersionsRestOperations(HttpPipeline pipeline, string a { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs index bed95bd3956f..7bc95252110a 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelContainersRestOperations.cs @@ -32,7 +32,11 @@ public RegistryModelContainersRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs index 0a36e44a451b..7f8219c77b76 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/RegistryModelVersionsRestOperations.cs @@ -32,7 +32,11 @@ public RegistryModelVersionsRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs index d74ed700ffb8..c4b629ae03a4 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/SchedulesRestOperations.cs @@ -32,7 +32,11 @@ public SchedulesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ServerlessEndpointsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ServerlessEndpointsRestOperations.cs index 880f01877444..49ffbba14553 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ServerlessEndpointsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/ServerlessEndpointsRestOperations.cs @@ -32,7 +32,11 @@ public ServerlessEndpointsRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs index 8066fa7fc95e..d0af9a2d58ef 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/UsagesRestOperations.cs @@ -32,7 +32,11 @@ public UsagesRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs index 2e54d4f9d796..80812fac872d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/VirtualMachineSizesRestOperations.cs @@ -32,7 +32,11 @@ public VirtualMachineSizesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs index 1bb3d0a9d1c9..2722235d5570 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceConnectionsRestOperations.cs @@ -32,6 +32,7 @@ public WorkspaceConnectionsRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -335,6 +336,13 @@ public Response Delete(string subscriptionId, string resourceGroupName, string w } internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -354,10 +362,14 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendQuery("category", category, true); } uri.AppendQuery("api-version", _apiVersion, true); + if (includeAll != null) + { + uri.AppendQuery("includeAll", includeAll.Value, true); + } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -380,6 +392,10 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendQuery("category", category, true); } uri.AppendQuery("api-version", _apiVersion, true); + if (includeAll != null) + { + uri.AppendQuery("includeAll", includeAll.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -388,19 +404,20 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -418,19 +435,20 @@ public async Task The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListRequest(subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -446,6 +464,421 @@ public Response } } +<<<<<<< HEAD +======= + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete machine learning workspaces connections by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete machine learning workspaces connections by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists machine learning workspaces connections by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineLearningWorkspaceConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineLearningWorkspaceConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists machine learning workspaces connections by name. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName, connectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineLearningWorkspaceConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineLearningWorkspaceConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update machine learning workspaces connections under the specified workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Parameters for workspace connection update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineLearningWorkspaceConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update machine learning workspaces connections under the specified workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Parameters for workspace connection update. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineLearningWorkspaceConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update machine learning workspaces connections under the specified workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The object for creating or updating a new workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineLearningWorkspaceConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update machine learning workspaces connections under the specified workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// The object for creating or updating a new workspace connection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineLearningWorkspaceConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineLearningWorkspaceConnectionData.DeserializeMachineLearningWorkspaceConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 internal RequestUriBuilder CreateListSecretsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName) { var uri = new RawRequestUriBuilder(); @@ -489,7 +922,7 @@ internal HttpMessage CreateListSecretsRequest(string subscriptionId, string reso /// List all the secrets of a machine learning workspaces connections. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -520,7 +953,7 @@ public async Task> ListSecretsA /// List all the secrets of a machine learning workspaces connections. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Friendly name of the workspace connection. /// The cancellation token to use. /// , , or is null. @@ -548,7 +981,108 @@ public Response ListSecrets(string subsc } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal RequestUriBuilder CreateTestConnectionRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/testconnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateTestConnectionRequest(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/testconnection", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (data != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Test machine learning workspaces connections under the specified workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Workspace Connection object. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task TestConnectionAsync(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateTestConnectionRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Test machine learning workspaces connections under the specified workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// Friendly name of the workspace connection. + /// Workspace Connection object. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response TestConnection(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, MachineLearningWorkspaceConnectionData data = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); + + using var message = CreateTestConnectionRequest(subscriptionId, resourceGroupName, workspaceName, connectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -556,7 +1090,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target, string category, bool? includeAll) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -573,20 +1107,21 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -605,20 +1140,21 @@ public async Task The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Target of the workspace connection. /// Category of the workspace connection. + /// query parameter that indicates if get connection call should return both connections and datastores. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string workspaceName, string target = null, string category = null, bool? includeAll = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, workspaceName, target, category, includeAll); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs index 12175ae6fdab..a34e10adae69 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspaceFeaturesRestOperations.cs @@ -32,7 +32,11 @@ public WorkspaceFeaturesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs index a78fdbdf71fa..b67a38fc7768 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/RestOperations/WorkspacesRestOperations.cs @@ -32,11 +32,127 @@ public WorkspacesRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); +<<<<<<< HEAD _apiVersion = apiVersion ?? "2024-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) +======= + _apiVersion = apiVersion ?? "2024-07-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, string kind, string skip, string aiCapabilities) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + if (aiCapabilities != null) + { + uri.AppendQuery("aiCapabilities", aiCapabilities, true); + } + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string kind, string skip, string aiCapabilities) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + if (aiCapabilities != null) + { + uri.AppendQuery("aiCapabilities", aiCapabilities, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all the available machine learning workspaces under the specified subscription. + /// The ID of the target subscription. + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, kind, skip, aiCapabilities); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WorkspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = WorkspaceListResult.DeserializeWorkspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all the available machine learning workspaces under the specified subscription. + /// The ID of the target subscription. + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, kind, skip, aiCapabilities); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WorkspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = WorkspaceListResult.DeserializeWorkspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -47,10 +163,29 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); uri.AppendQuery("api-version", _apiVersion, true); +<<<<<<< HEAD return uri; } internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName) +======= + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + if (aiCapabilities != null) + { + uri.AppendQuery("aiCapabilities", aiCapabilities, true); + } + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -64,6 +199,21 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); uri.AppendPath(workspaceName, true); uri.AppendQuery("api-version", _apiVersion, true); +<<<<<<< HEAD +======= + if (kind != null) + { + uri.AppendQuery("kind", kind, true); + } + if (skip != null) + { + uri.AppendQuery("$skip", skip, true); + } + if (aiCapabilities != null) + { + uri.AppendQuery("aiCapabilities", aiCapabilities, true); + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -73,17 +223,31 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Gets the properties of the specified machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. +<<<<<<< HEAD /// Name of Azure Machine Learning workspace. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) +======= + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); +<<<<<<< HEAD using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName); +======= + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, kind, skip, aiCapabilities); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -104,17 +268,31 @@ public async Task> GetAsync(string subscr /// Gets the properties of the specified machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. +<<<<<<< HEAD /// Name of Azure Machine Learning workspace. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) +======= + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); +<<<<<<< HEAD using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName); +======= + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, kind, skip, aiCapabilities); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -269,7 +447,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Deletes a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Flag to indicate delete is a purge request. /// The cancellation token to use. /// , or is null. @@ -296,7 +474,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Deletes a machine learning workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// Flag to indicate delete is a purge request. /// The cancellation token to use. /// , or is null. @@ -320,6 +498,105 @@ public Response Delete(string subscriptionId, string resourceGroupName, string w } } +<<<<<<< HEAD +======= + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the properties of the specified machine learning workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineLearningWorkspaceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineLearningWorkspaceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the properties of the specified machine learning workspace. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineLearningWorkspaceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineLearningWorkspaceData.DeserializeMachineLearningWorkspaceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MachineLearningWorkspaceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string workspaceName, MachineLearningWorkspacePatch patch) { var uri = new RawRequestUriBuilder(); @@ -361,7 +638,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// Updates a machine learning workspace with the specified parameters. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for updating a machine learning workspace. /// The cancellation token to use. /// , , or is null. @@ -388,7 +665,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// Updates a machine learning workspace with the specified parameters. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameters for updating a machine learning workspace. /// The cancellation token to use. /// , , or is null. @@ -455,7 +732,12 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str /// Lists all the available machine learning workspaces under the specified resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. +<<<<<<< HEAD /// Continuation token for pagination. +======= + /// Azure Machine Learning Workspace Name. + /// The parameters for creating or updating a machine learning workspace. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -483,7 +765,12 @@ public async Task> ListByResourceGroupAsync(string /// Lists all the available machine learning workspaces under the specified resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. +<<<<<<< HEAD /// Continuation token for pagination. +======= + /// Azure Machine Learning Workspace Name. + /// The parameters for creating or updating a machine learning workspace. +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. @@ -554,7 +841,7 @@ internal HttpMessage CreateDiagnoseRequest(string subscriptionId, string resourc /// Diagnose workspace setup issue. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameter of diagnosing workspace health. /// The cancellation token to use. /// , or is null. @@ -580,7 +867,7 @@ public async Task DiagnoseAsync(string subscriptionId, string resource /// Diagnose workspace setup issue. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The parameter of diagnosing workspace health. /// The cancellation token to use. /// , or is null. @@ -642,7 +929,7 @@ internal HttpMessage CreateListKeysRequest(string subscriptionId, string resourc /// Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -671,7 +958,7 @@ public async Task> ListKeysAsync /// Lists all the keys associated with this workspace. This includes keys for the storage account, app insights and password for container registry. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -910,7 +1197,7 @@ internal HttpMessage CreateListNotebookAccessTokenRequest(string subscriptionId, /// return notebook access token and refresh token. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -939,7 +1226,7 @@ public async Task> L /// return notebook access token and refresh token. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1184,7 +1471,7 @@ internal HttpMessage CreateListNotebookKeysRequest(string subscriptionId, string /// List keys of a notebook. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1213,7 +1500,7 @@ public async Task> ListN /// List keys of a notebook. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1239,6 +1526,103 @@ public Response ListNotebookKeys( } } +<<<<<<< HEAD +======= + internal RequestUriBuilder CreateListStorageAccountKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/listStorageAccountKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListStorageAccountKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/listStorageAccountKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists keys of Azure Machine Learning Workspace's storage account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListStorageAccountKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListStorageAccountKeysRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MachineLearningWorkspaceGetStorageAccountKeysResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MachineLearningWorkspaceGetStorageAccountKeysResult.DeserializeMachineLearningWorkspaceGetStorageAccountKeysResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists keys of Azure Machine Learning Workspace's storage account. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListStorageAccountKeys(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateListStorageAccountKeysRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MachineLearningWorkspaceGetStorageAccountKeysResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MachineLearningWorkspaceGetStorageAccountKeysResult.DeserializeMachineLearningWorkspaceGetStorageAccountKeysResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 internal RequestUriBuilder CreateListOutboundNetworkDependenciesEndpointsRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) { var uri = new RawRequestUriBuilder(); @@ -1278,7 +1662,7 @@ internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsRequest(strin /// Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1307,7 +1691,7 @@ public async Task> ListOutboundNetworkDependencie /// Called by Client (Portal, CLI, etc) to get a list of all external outbound dependencies (FQDNs) programmatically. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of Azure Machine Learning workspace. + /// Azure Machine Learning Workspace Name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -1333,7 +1717,183 @@ public Response ListOutboundNetworkDependenciesEndpoints(s } } +<<<<<<< HEAD internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string skip) +======= + internal RequestUriBuilder CreatePrepareNotebookRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/prepareNotebook", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePrepareNotebookRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/prepareNotebook", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Prepare Azure Machine Learning Workspace's notebook resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task PrepareNotebookAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreatePrepareNotebookRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Prepare Azure Machine Learning Workspace's notebook resource. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response PrepareNotebook(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreatePrepareNotebookRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateResyncKeysRequestUri(string subscriptionId, string resourceGroupName, string workspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/resyncKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateResyncKeysRequest(string subscriptionId, string resourceGroupName, string workspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.MachineLearningServices/workspaces/", false); + uri.AppendPath(workspaceName, true); + uri.AppendPath("/resyncKeys", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and password for container registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task ResyncKeysAsync(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateResyncKeysRequest(subscriptionId, resourceGroupName, workspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Resync all the keys associated with this workspace.This includes keys for the storage account, app insights and password for container registry. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Azure Machine Learning Workspace Name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ResyncKeys(string subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(workspaceName, nameof(workspaceName)); + + using var message = CreateResyncKeysRequest(subscriptionId, resourceGroupName, workspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string kind, string skip, string aiCapabilities) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1341,7 +1901,11 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } +<<<<<<< HEAD internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string skip) +======= + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string kind, string skip, string aiCapabilities) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1358,18 +1922,32 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Lists all the available machine learning workspaces under the specified resource group. /// The URL to the next page of results. /// The ID of the target subscription. +<<<<<<< HEAD /// The name of the resource group. The name is case insensitive. /// Continuation token for pagination. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string skip = null, CancellationToken cancellationToken = default) +======= + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); +<<<<<<< HEAD using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skip); +======= + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, kind, skip, aiCapabilities); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1388,18 +1966,32 @@ public async Task> ListByResourceGroupNextPageAsyn /// Lists all the available machine learning workspaces under the specified resource group. /// The URL to the next page of results. /// The ID of the target subscription. +<<<<<<< HEAD /// The name of the resource group. The name is case insensitive. /// Continuation token for pagination. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string skip = null, CancellationToken cancellationToken = default) +======= + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); +<<<<<<< HEAD using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skip); +======= + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, kind, skip, aiCapabilities); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -1415,7 +2007,11 @@ public Response ListByResourceGroupNextPage(string nextLink } } +<<<<<<< HEAD internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string skip) +======= + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1423,7 +2019,11 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } +<<<<<<< HEAD internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string skip) +======= + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string kind, string skip, string aiCapabilities) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1440,16 +2040,31 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Lists all the available machine learning workspaces under the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. +<<<<<<< HEAD /// Continuation token for pagination. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string skip = null, CancellationToken cancellationToken = default) +======= + /// The name of the resource group. The name is case insensitive. + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); +<<<<<<< HEAD using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, skip); +======= + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, kind, skip, aiCapabilities); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -1468,16 +2083,31 @@ public async Task> ListBySubscriptionNextPageAsync /// Lists all the available machine learning workspaces under the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. +<<<<<<< HEAD /// Continuation token for pagination. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string skip = null, CancellationToken cancellationToken = default) +======= + /// The name of the resource group. The name is case insensitive. + /// Kind of workspace. + /// Continuation token for pagination. + /// The to use. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string kind = null, string skip = null, string aiCapabilities = null, CancellationToken cancellationToken = default) +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); +<<<<<<< HEAD using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, skip); +======= + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, kind, skip, aiCapabilities); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs index 01f25c02dda0..f33ffbd91816 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointCollection.cs @@ -64,7 +64,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -113,7 +117,11 @@ public virtual async Task> CreateOrUpda /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -162,7 +170,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -207,7 +219,11 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -252,7 +268,11 @@ public virtual Response Get(string name, Cancellatio /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -283,7 +303,11 @@ public virtual AsyncPageable GetAllAsync(string skip /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -314,7 +338,11 @@ public virtual Pageable GetAll(string skip = null, C /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -357,7 +385,11 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -400,7 +432,11 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -445,7 +481,11 @@ public virtual async Task> GetIfExi /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs index 1d716b1170d7..82197372639d 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.Serialization.cs @@ -28,6 +28,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader } writer.WriteStartObject(); +<<<<<<< HEAD writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); if (Optional.IsDefined(Kind)) @@ -35,12 +36,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind); } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } +<<<<<<< HEAD +======= + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind); + } + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (Optional.IsDefined(Sku)) { writer.WritePropertyName("sku"u8); @@ -117,9 +130,15 @@ internal static ServerlessEndpointData DeserializeServerlessEndpointData(JsonEle { return null; } +<<<<<<< HEAD ServerlessEndpointProperties properties = default; string kind = default; ManagedServiceIdentity identity = default; +======= + ManagedServiceIdentity identity = default; + string kind = default; + ServerlessEndpointProperties properties = default; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 MachineLearningSku sku = default; IDictionary tags = default; AzureLocation location = default; @@ -131,6 +150,7 @@ internal static ServerlessEndpointData DeserializeServerlessEndpointData(JsonEle Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { +<<<<<<< HEAD if (property.NameEquals("properties"u8)) { properties = ServerlessEndpointProperties.DeserializeServerlessEndpointProperties(property.Value, options); @@ -141,6 +161,8 @@ internal static ServerlessEndpointData DeserializeServerlessEndpointData(JsonEle kind = property.Value.GetString(); continue; } +======= +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("identity"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -151,6 +173,19 @@ internal static ServerlessEndpointData DeserializeServerlessEndpointData(JsonEle identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); continue; } +<<<<<<< HEAD +======= + if (property.NameEquals("kind"u8)) + { + kind = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + properties = ServerlessEndpointProperties.DeserializeServerlessEndpointProperties(property.Value, options); + continue; + } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 if (property.NameEquals("sku"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -216,9 +251,15 @@ internal static ServerlessEndpointData DeserializeServerlessEndpointData(JsonEle systemData, tags ?? new ChangeTrackingDictionary(), location, +<<<<<<< HEAD properties, kind, identity, +======= + identity, + kind, + properties, +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 sku, serializedAdditionalRawData); } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs index e7184f76c4d3..cdd38fdaa508 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointData.cs @@ -66,6 +66,7 @@ public ServerlessEndpointData(AzureLocation location, ServerlessEndpointProperti /// The systemData. /// The tags. /// The location. +<<<<<<< HEAD /// [Required] Additional attributes of the entity. /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. /// Managed service identity (system assigned and/or user assigned identities). @@ -76,6 +77,18 @@ internal ServerlessEndpointData(ResourceIdentifier id, string name, ResourceType Properties = properties; Kind = kind; Identity = identity; +======= + /// Managed service identity (system assigned and/or user assigned identities). + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + /// [Required] Additional attributes of the entity. + /// Sku details required for ARM contract for Autoscaling. + /// Keeps track of any properties unknown to the library. + internal ServerlessEndpointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string kind, ServerlessEndpointProperties properties, MachineLearningSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Identity = identity; + Kind = kind; + Properties = properties; +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 Sku = sku; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -85,12 +98,21 @@ internal ServerlessEndpointData() { } +<<<<<<< HEAD /// [Required] Additional attributes of the entity. public ServerlessEndpointProperties Properties { get; set; } /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. public string Kind { get; set; } /// Managed service identity (system assigned and/or user assigned identities). public ManagedServiceIdentity Identity { get; set; } +======= + /// Managed service identity (system assigned and/or user assigned identities). + public ManagedServiceIdentity Identity { get; set; } + /// Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type. + public string Kind { get; set; } + /// [Required] Additional attributes of the entity. + public ServerlessEndpointProperties Properties { get; set; } +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// Sku details required for ARM contract for Autoscaling. public MachineLearningSku Sku { get; set; } } diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs index 076729e22344..9f0abcdef6a6 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/ServerlessEndpointResource.cs @@ -103,7 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -143,7 +147,11 @@ public virtual async Task> GetAsync(Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -183,7 +191,11 @@ public virtual Response Get(CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -225,7 +237,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -267,7 +283,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -313,7 +333,11 @@ public virtual async Task> UpdateAsync( /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -359,7 +383,11 @@ public virtual ArmOperation Update(WaitUntil waitUnt /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -397,7 +425,11 @@ public virtual async Task> GetKeysAsyn /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -435,7 +467,11 @@ public virtual Response GetKeys(CancellationTok /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -481,7 +517,11 @@ public virtual async Task> Regener /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -527,7 +567,11 @@ public virtual ArmOperation RegenerateKeys(Wait /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -589,7 +633,11 @@ public virtual async Task> AddTagAsync(stri /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -651,7 +699,11 @@ public virtual Response AddTag(string key, string va /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -708,7 +760,11 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -765,7 +821,11 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource @@ -825,7 +885,11 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Default Api Version +<<<<<<< HEAD /// 2024-04-01 +======= + /// 2024-07-01-preview +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 /// /// /// Resource diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentCollection.cs new file mode 100644 index 000000000000..a57bf264faee --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceConnectionDeployments method from an instance of . + /// + public partial class WorkspaceConnectionDeploymentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionDeploymentCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceConnectionDeploymentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionDeploymentResource.ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceConnectionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceConnectionResource.ResourceType), nameof(id)); + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all the deployments under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments + /// + /// + /// Operation Id + /// Connection_ListDeployments + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "WorkspaceConnectionDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get all the deployments under the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments + /// + /// + /// Operation Id + /// Connection_ListDeployments + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionDeploymentConnectionRestClient.CreateListDeploymentsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, "WorkspaceConnectionDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.Serialization.cs new file mode 100644 index 000000000000..eb8d86503665 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceConnectionDeploymentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.cs new file mode 100644 index 000000000000..3857dcd15e80 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionDeploymentResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceConnectionDeployment along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceConnectionDeploymentResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceConnectionDeployment method. + /// + public partial class WorkspaceConnectionDeploymentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The deploymentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string deploymentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceConnectionDeploymentConnectionClientDiagnostics; + private readonly ConnectionRestOperations _workspaceConnectionDeploymentConnectionRestClient; + private readonly EndpointDeploymentResourcePropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/deployments"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionDeploymentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceConnectionDeploymentResource(ArmClient client, EndpointDeploymentResourcePropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceConnectionDeploymentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionDeploymentConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceConnectionDeploymentConnectionApiVersion); + _workspaceConnectionDeploymentConnectionRestClient = new ConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionDeploymentConnectionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual EndpointDeploymentResourcePropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.GetDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under the Azure OpenAI connection by name. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_GetDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.GetDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Azure OpenAI connection deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_DeleteDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.DeleteDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateDeleteDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete Azure OpenAI connection deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_DeleteDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Delete"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.DeleteDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateDeleteDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Update"); + scope.Start(); + try + { + var response = await _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeploymentAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update Azure OpenAI connection deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// Connection_CreateOrUpdateDeployment + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionDeploymentConnectionClientDiagnostics.CreateScope("WorkspaceConnectionDeploymentResource.Update"); + scope.Start(); + try + { + var response = _workspaceConnectionDeploymentConnectionRestClient.CreateOrUpdateDeployment(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionDeploymentOperationSource(Client), _workspaceConnectionDeploymentConnectionClientDiagnostics, Pipeline, _workspaceConnectionDeploymentConnectionRestClient.CreateCreateOrUpdateDeploymentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyCollection.cs new file mode 100644 index 000000000000..19a6e857d11d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceConnectionRaiPolicies method from an instance of . + /// + public partial class WorkspaceConnectionRaiPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics; + private readonly ConnectionRaiPolicyRestOperations _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient; + private readonly ClientDiagnostics _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics; + private readonly ConnectionRaiPoliciesRestOperations _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionRaiPolicyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceConnectionRaiPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionRaiPolicyResource.ResourceType, out string workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient = new ConnectionRaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceConnectionRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceConnectionRaiPolicyResource.ResourceType, out string workspaceConnectionRaiPolicyConnectionRaiPoliciesApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient = new ConnectionRaiPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionRaiPolicyConnectionRaiPoliciesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MachineLearningWorkspaceConnectionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MachineLearningWorkspaceConnectionResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies + /// + /// + /// Operation Id + /// ConnectionRaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceConnectionRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies + /// + /// + /// Operation Id + /// ConnectionRaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceConnectionRaiPolicyConnectionRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceConnectionRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceConnectionRaiPolicyConnectionRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceConnectionRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.Serialization.cs new file mode 100644 index 000000000000..792d7e587363 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceConnectionRaiPolicyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiPolicyPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiPolicyPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.cs new file mode 100644 index 000000000000..24573838500d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceConnectionRaiPolicyResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceConnectionRaiPolicy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceConnectionRaiPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceConnectionRaiPolicy method. + /// + public partial class WorkspaceConnectionRaiPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The connectionName. + /// The raiPolicyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string connectionName, string raiPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics; + private readonly ConnectionRaiPolicyRestOperations _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient; + private readonly RaiPolicyPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/connections/raiPolicies"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceConnectionRaiPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceConnectionRaiPolicyResource(ArmClient client, RaiPolicyPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceConnectionRaiPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); + _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient = new ConnectionRaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceConnectionRaiPolicyConnectionRaiPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiPolicyPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceConnectionRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = await _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// ConnectionRaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics.CreateScope("WorkspaceConnectionRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceConnectionRaiPolicyOperationSource(Client), _workspaceConnectionRaiPolicyConnectionRaiPolicyClientDiagnostics, Pipeline, _workspaceConnectionRaiPolicyConnectionRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentCollection.cs new file mode 100644 index 000000000000..f6fd71f1f7b0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceEndpointDeployments method from an instance of . + /// + public partial class WorkspaceEndpointDeploymentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics; + private readonly EndpointDeploymentRestOperations _workspaceEndpointDeploymentEndpointDeploymentRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointDeploymentCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceEndpointDeploymentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointDeploymentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointDeploymentResource.ResourceType, out string workspaceEndpointDeploymentEndpointDeploymentApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentRestClient = new EndpointDeploymentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointDeploymentEndpointDeploymentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != EndpointResourcePropertiesBasicResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, EndpointResourcePropertiesBasicResource.ResourceType), nameof(id)); + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the deployment resource. + /// deployment object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deploymentName, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get all the deployments under the endpoint resource scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "WorkspaceEndpointDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get all the deployments under the endpoint resource scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments + /// + /// + /// Operation Id + /// EndpointDeployment_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointDeploymentResource(Client, EndpointDeploymentResourcePropertiesBasicResourceData.DeserializeEndpointDeploymentResourcePropertiesBasicResourceData(e)), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, "WorkspaceEndpointDeploymentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the deployment resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string deploymentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, deploymentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.Serialization.cs new file mode 100644 index 000000000000..1594ecc8954d --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceEndpointDeploymentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EndpointDeploymentResourcePropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.cs new file mode 100644 index 000000000000..54b5548216a0 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointDeploymentResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceEndpointDeployment along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceEndpointDeploymentResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceEndpointDeployment method. + /// + public partial class WorkspaceEndpointDeploymentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The endpointName. + /// The deploymentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string deploymentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics; + private readonly EndpointDeploymentRestOperations _workspaceEndpointDeploymentEndpointDeploymentRestClient; + private readonly EndpointDeploymentResourcePropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/endpoints/deployments"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointDeploymentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceEndpointDeploymentResource(ArmClient client, EndpointDeploymentResourcePropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceEndpointDeploymentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceEndpointDeploymentEndpointDeploymentApiVersion); + _workspaceEndpointDeploymentEndpointDeploymentRestClient = new EndpointDeploymentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointDeploymentEndpointDeploymentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual EndpointDeploymentResourcePropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get deployments under endpoint resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointDeploymentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete endpoint deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete endpoint deployment resource by name + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Delete"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Update"); + scope.Start(); + try + { + var response = await _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update endpoint deployment resource with the specified parameters + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/deployments/{deploymentName} + /// + /// + /// Operation Id + /// EndpointDeployment_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// deployment object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, EndpointDeploymentResourcePropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics.CreateScope("WorkspaceEndpointDeploymentResource.Update"); + scope.Start(); + try + { + var response = _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointDeploymentOperationSource(Client), _workspaceEndpointDeploymentEndpointDeploymentClientDiagnostics, Pipeline, _workspaceEndpointDeploymentEndpointDeploymentRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyCollection.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyCollection.cs new file mode 100644 index 000000000000..c8f36b19acf4 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyCollection.cs @@ -0,0 +1,498 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetWorkspaceEndpointRaiPolicies method from an instance of . + /// + public partial class WorkspaceEndpointRaiPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics; + private readonly RaiPolicyRestOperations _workspaceEndpointRaiPolicyRaiPolicyRestClient; + private readonly ClientDiagnostics _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics; + private readonly RaiPoliciesRestOperations _workspaceEndpointRaiPolicyRaiPoliciesRestClient; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointRaiPolicyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal WorkspaceEndpointRaiPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointRaiPolicyResource.ResourceType, out string workspaceEndpointRaiPolicyRaiPolicyApiVersion); + _workspaceEndpointRaiPolicyRaiPolicyRestClient = new RaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointRaiPolicyRaiPolicyApiVersion); + _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", WorkspaceEndpointRaiPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WorkspaceEndpointRaiPolicyResource.ResourceType, out string workspaceEndpointRaiPolicyRaiPoliciesApiVersion); + _workspaceEndpointRaiPolicyRaiPoliciesRestClient = new RaiPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointRaiPolicyRaiPoliciesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != EndpointResourcePropertiesBasicResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, EndpointResourcePropertiesBasicResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the Rai Policy. + /// The to use. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string raiPolicyName, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies + /// + /// + /// Operation Id + /// RaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceEndpointRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies + /// + /// + /// Operation Id + /// RaiPolicies_List + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _workspaceEndpointRaiPolicyRaiPoliciesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WorkspaceEndpointRaiPolicyResource(Client, RaiPolicyPropertiesBasicResourceData.DeserializeRaiPolicyPropertiesBasicResourceData(e)), _workspaceEndpointRaiPolicyRaiPoliciesClientDiagnostics, Pipeline, "WorkspaceEndpointRaiPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the Rai Policy. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string raiPolicyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(raiPolicyName, nameof(raiPolicyName)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, raiPolicyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.Serialization.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.Serialization.cs new file mode 100644 index 000000000000..5e26b0d44537 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.MachineLearning +{ + public partial class WorkspaceEndpointRaiPolicyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + RaiPolicyPropertiesBasicResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + RaiPolicyPropertiesBasicResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.cs b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.cs new file mode 100644 index 000000000000..3a5d56f22125 --- /dev/null +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/Generated/WorkspaceEndpointRaiPolicyResource.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.MachineLearning +{ + /// + /// A Class representing a WorkspaceEndpointRaiPolicy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetWorkspaceEndpointRaiPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetWorkspaceEndpointRaiPolicy method. + /// + public partial class WorkspaceEndpointRaiPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The workspaceName. + /// The endpointName. + /// The raiPolicyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string workspaceName, string endpointName, string raiPolicyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics; + private readonly RaiPolicyRestOperations _workspaceEndpointRaiPolicyRaiPolicyRestClient; + private readonly RaiPolicyPropertiesBasicResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.MachineLearningServices/workspaces/endpoints/raiPolicies"; + + /// Initializes a new instance of the class for mocking. + protected WorkspaceEndpointRaiPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WorkspaceEndpointRaiPolicyResource(ArmClient client, RaiPolicyPropertiesBasicResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal WorkspaceEndpointRaiPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.MachineLearning", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string workspaceEndpointRaiPolicyRaiPolicyApiVersion); + _workspaceEndpointRaiPolicyRaiPolicyRestClient = new RaiPolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, workspaceEndpointRaiPolicyRaiPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual RaiPolicyPropertiesBasicResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Get + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Get"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WorkspaceEndpointRaiPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(_workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Delete + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Delete"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new MachineLearningArmOperation(_workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = await _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified Content Filters associated with the Azure OpenAI account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/endpoints/{endpointName}/raiPolicies/{raiPolicyName} + /// + /// + /// Operation Id + /// RaiPolicy_Create + /// + /// + /// Default Api Version + /// 2024-07-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The to use. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, RaiPolicyPropertiesBasicResourceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics.CreateScope("WorkspaceEndpointRaiPolicyResource.Update"); + scope.Start(); + try + { + var response = _workspaceEndpointRaiPolicyRaiPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MachineLearningArmOperation(new WorkspaceEndpointRaiPolicyOperationSource(Client), _workspaceEndpointRaiPolicyRaiPolicyClientDiagnostics, Pipeline, _workspaceEndpointRaiPolicyRaiPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md index 1ca3482bfbb4..b48de931f1fa 100644 --- a/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md +++ b/sdk/machinelearningservices/Azure.ResourceManager.MachineLearning/src/autorest.md @@ -8,7 +8,11 @@ azure-arm: true library-name: MachineLearning namespace: Azure.ResourceManager.MachineLearning require: https://github.com/Azure/azure-rest-api-specs/blob/edb7904bfead536c7aa9716d44dba15bdabd0b00/specification/machinelearningservices/resource-manager/readme.md +<<<<<<< HEAD tag: package-2024-04 +======= +#tag: package-preview-2023-06 +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -517,8 +521,12 @@ rename-mapping: ProtectionLevel: IntellectualProtectionLevel OsPatchingStatus.latestPatchTime: -|date-time OsPatchingStatus.scheduledRebootTime: -|date-time +<<<<<<< HEAD ServerlessComputeSettings.serverlessComputeNoPublicIP: HasNoPublicIP PrivateEndpointConnection.properties.privateEndpoint: SubResource +======= + ServerlessComputeSettings.serverlessComputeNoPublicIP : HasNoPublicIP +>>>>>>> 3f8cf30a3ebe61cfdd08f1bbe8fa5494eda0e9f7 suppress-abstract-base-class: - MachineLearningJobProperties diff --git a/sdk/maps/Azure.Maps.Search/README.md b/sdk/maps/Azure.Maps.Search/README.md index 05f6ff8d7b1a..900f7fbf0d59 100644 --- a/sdk/maps/Azure.Maps.Search/README.md +++ b/sdk/maps/Azure.Maps.Search/README.md @@ -144,10 +144,11 @@ You can familiarize yourself with different APIs using our [samples](https://git ### Example Get Geocoding ```C# Snippet:GetGeocoding -var query = "15171 NE 24th St, Redmond, WA 98052, United States"; -Response result = client.GetGeocoding(query); -Console.WriteLine("Result for query: \"{0}\"", query); -Console.WriteLine(result); +Response searchResult = client.GetGeocoding("1 Microsoft Way, Redmond, WA 98052"); +for (int i = 0; i < searchResult.Value.Features.Count; i++) +{ + Console.WriteLine("Coordinate:" + string.Join(",", searchResult.Value.Features[i].Geometry.Coordinates)); +} ``` ### Example Get Geocoding Batch @@ -161,11 +162,19 @@ List queries = new List }, new GeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + AddressLine = "400 Broad St" }, }; Response results = client.GetGeocodingBatch(queries); -Console.WriteLine(results); + +//Print coordinates +for (var i = 0; i < results.Value.BatchItems.Count; i++) +{ + for (var j = 0; j < results.Value.BatchItems[i].Features.Count; j++) + { + Console.WriteLine("Coordinates: " + string.Join(",", results.Value.BatchItems[i].Features[j].Geometry.Coordinates)); + } +} ``` ### Example Get Polygon @@ -173,10 +182,20 @@ Console.WriteLine(results); ```C# Snippet:GetPolygon GetPolygonOptions options = new GetPolygonOptions() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.204141, 47.61256), + ResultType = BoundaryResultTypeEnum.Locality, + Resolution = ResolutionEnum.Small, }; Response result = client.GetPolygon(options); -Console.WriteLine(result); +var count = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates.Count; +for (var i = 0; i < count; i++) +{ + var coorCount = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i].Count; + for (var j = 0; j < coorCount; j++) + { + Console.WriteLine(string.Join(",", ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i][j])); + } +} ``` ### Example Get Reverse Geocoding @@ -184,6 +203,12 @@ Console.WriteLine(result); ```C# Snippet:GetReverseGeocoding GeoPosition coordinates = new GeoPosition(-122.138685, 47.6305637); Response result = client.GetReverseGeocoding(coordinates); + +//Print addresses +for (int i = 0; i < result.Value.Features.Count; i++) +{ + Console.WriteLine(result.Value.Features[i].Properties.Address.FormattedAddress); +} ``` ### Example Get Reverse Geocoding Batch @@ -193,14 +218,22 @@ List items = new List { new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.53, 25.0) + Coordinates = new GeoPosition(-122.349309, 47.620498) }, new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.138679, 47.630356), + ResultTypes = new List(){ ReverseGeocodingResultTypeEnum.Address, ReverseGeocodingResultTypeEnum.Neighborhood } }, }; Response result = client.GetReverseGeocodingBatch(items); + +//Print addresses +for (var i = 0; i < result.Value.BatchItems.Count; i++) +{ + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.AddressLine); + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.Neighborhood); +} ``` ## Troubleshooting diff --git a/sdk/maps/Azure.Maps.Search/samples/MapsSearchSamples.md b/sdk/maps/Azure.Maps.Search/samples/MapsSearchSamples.md index 4dd6f46e4d63..7558a9564c29 100644 --- a/sdk/maps/Azure.Maps.Search/samples/MapsSearchSamples.md +++ b/sdk/maps/Azure.Maps.Search/samples/MapsSearchSamples.md @@ -34,10 +34,11 @@ MapsSearchClient client = new MapsSearchClient(credential, clientId); Most of the time, we only want to search for a specific address. We can call `GetGeocoding` (or `GetGeocodingAsync` for asynchronous call): ```C# Snippet:GetGeocoding -var query = "15171 NE 24th St, Redmond, WA 98052, United States"; -Response result = client.GetGeocoding(query); -Console.WriteLine("Result for query: \"{0}\"", query); -Console.WriteLine(result); +Response searchResult = client.GetGeocoding("1 Microsoft Way, Redmond, WA 98052"); +for (int i = 0; i < searchResult.Value.Features.Count; i++) +{ + Console.WriteLine("Coordinate:" + string.Join(",", searchResult.Value.Features[i].Geometry.Coordinates)); +} ``` You can also search multiple addresses. If the queries are less than 100, use `GetGeocodingBatch` (or `GetGeocodingBatchAsync` for asynchronous call): @@ -51,11 +52,19 @@ List queries = new List }, new GeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + AddressLine = "400 Broad St" }, }; Response results = client.GetGeocodingBatch(queries); -Console.WriteLine(results); + +//Print coordinates +for (var i = 0; i < results.Value.BatchItems.Count; i++) +{ + for (var j = 0; j < results.Value.BatchItems[i].Features.Count; j++) + { + Console.WriteLine("Coordinates: " + string.Join(",", results.Value.BatchItems[i].Features[j].Geometry.Coordinates)); + } +} ``` ## Get Polygon @@ -63,10 +72,20 @@ Console.WriteLine(results); ```C# Snippet:GetPolygon GetPolygonOptions options = new GetPolygonOptions() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.204141, 47.61256), + ResultType = BoundaryResultTypeEnum.Locality, + Resolution = ResolutionEnum.Small, }; Response result = client.GetPolygon(options); -Console.WriteLine(result); +var count = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates.Count; +for (var i = 0; i < count; i++) +{ + var coorCount = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i].Count; + for (var j = 0; j < coorCount; j++) + { + Console.WriteLine(string.Join(",", ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i][j])); + } +} ``` ## Get Reverse Geocoding @@ -77,6 +96,12 @@ Translate a coordinate (example: 37.786505, -122.3862) into a human understandab ```C# Snippet:GetReverseGeocoding GeoPosition coordinates = new GeoPosition(-122.138685, 47.6305637); Response result = client.GetReverseGeocoding(coordinates); + +//Print addresses +for (int i = 0; i < result.Value.Features.Count; i++) +{ + Console.WriteLine(result.Value.Features[i].Properties.Address.FormattedAddress); +} ``` You can also search multiple coordinates. If the queries are less than 100, use `GetReverseGeocodingBatch` (or `GetReverseGeocodingBatchAsync` for asynchronous call): @@ -86,12 +111,20 @@ List items = new List { new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.53, 25.0) + Coordinates = new GeoPosition(-122.349309, 47.620498) }, new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.138679, 47.630356), + ResultTypes = new List(){ ReverseGeocodingResultTypeEnum.Address, ReverseGeocodingResultTypeEnum.Neighborhood } }, }; Response result = client.GetReverseGeocodingBatch(items); + +//Print addresses +for (var i = 0; i < result.Value.BatchItems.Count; i++) +{ + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.AddressLine); + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.Neighborhood); +} ``` diff --git a/sdk/maps/Azure.Maps.Search/tests/Samples/SearchClientSamples.cs b/sdk/maps/Azure.Maps.Search/tests/Samples/SearchClientSamples.cs index ea1bf4f5d509..ddfd042d8d25 100644 --- a/sdk/maps/Azure.Maps.Search/tests/Samples/SearchClientSamples.cs +++ b/sdk/maps/Azure.Maps.Search/tests/Samples/SearchClientSamples.cs @@ -87,10 +87,11 @@ public void GetGeocoding() var clientId = TestEnvironment.MapAccountClientId; var client = new MapsSearchClient(TestEnvironment.Credential, clientId, clientOptions); #region Snippet:GetGeocoding - var query = "15171 NE 24th St, Redmond, WA 98052, United States"; - Response result = client.GetGeocoding(query); - Console.WriteLine("Result for query: \"{0}\"", query); - Console.WriteLine(result); + Response searchResult = client.GetGeocoding("1 Microsoft Way, Redmond, WA 98052"); + for (int i = 0; i < searchResult.Value.Features.Count; i++) + { + Console.WriteLine("Coordinate:" + string.Join(",", searchResult.Value.Features[i].Geometry.Coordinates)); + } #endregion } @@ -112,11 +113,19 @@ public void GetGeocodingBatch() }, new GeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + AddressLine = "400 Broad St" }, }; Response results = client.GetGeocodingBatch(queries); - Console.WriteLine(results); + + //Print coordinates + for (var i = 0; i < results.Value.BatchItems.Count; i++) + { + for (var j = 0; j < results.Value.BatchItems[i].Features.Count; j++) + { + Console.WriteLine("Coordinates: " + string.Join(",", results.Value.BatchItems[i].Features[j].Geometry.Coordinates)); + } + } #endregion } @@ -132,10 +141,20 @@ public void GetPolygon() #region Snippet:GetPolygon GetPolygonOptions options = new GetPolygonOptions() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.204141, 47.61256), + ResultType = BoundaryResultTypeEnum.Locality, + Resolution = ResolutionEnum.Small, }; Response result = client.GetPolygon(options); - Console.WriteLine(result); + var count = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates.Count; + for (var i = 0; i < count; i++) + { + var coorCount = ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i].Count; + for (var j = 0; j < coorCount; j++) + { + Console.WriteLine(string.Join(",", ((GeoJsonPolygon)((GeoJsonGeometryCollection)result.Value.Geometry).Geometries[0]).Coordinates[i][j])); + } + } #endregion } @@ -151,6 +170,12 @@ public void GetReverseGeocoding() #region Snippet:GetReverseGeocoding GeoPosition coordinates = new GeoPosition(-122.138685, 47.6305637); Response result = client.GetReverseGeocoding(coordinates); + + //Print addresses + for (int i = 0; i < result.Value.Features.Count; i++) + { + Console.WriteLine(result.Value.Features[i].Properties.Address.FormattedAddress); + } #endregion } @@ -168,14 +193,22 @@ public void GetReverseGeocodingBatch() { new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.53, 25.0) + Coordinates = new GeoPosition(-122.349309, 47.620498) }, new ReverseGeocodingQuery() { - Coordinates = new GeoPosition(121.5, 25.0) + Coordinates = new GeoPosition(-122.138679, 47.630356), + ResultTypes = new List(){ ReverseGeocodingResultTypeEnum.Address, ReverseGeocodingResultTypeEnum.Neighborhood } }, }; Response result = client.GetReverseGeocodingBatch(items); + + //Print addresses + for (var i = 0; i < result.Value.BatchItems.Count; i++) + { + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.AddressLine); + Console.WriteLine(result.Value.BatchItems[i].Features[0].Properties.Address.Neighborhood); + } #endregion } } diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md index 6a9f3bac33c1..2c3982b22059 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/CHANGELOG.md @@ -1,6 +1,16 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 1.0.0-beta.1 (2024-08-30) ### Features Added @@ -14,4 +24,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md index 1ad4c08a5e95..a8860122c4e1 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/README.md @@ -1,6 +1,6 @@ # Microsoft Azure MongoCluster management client library for .NET -**[Describe the service briefly first.]** +Azure Cosmos DB for MongoDB in vCore architecture provides developers with a fully managed MongoDB-compatible database service for building modern applications with a familiar architecture. With Azure Cosmos DB for MongoDB (vCore), developers can enjoy the benefits of native Azure integrations, low total cost of ownership (TCO), and the familiar vCore architecture when migrating existing applications or building new ones. This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: diff --git a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj index fece58e306f4..8ec6e4a56017 100644 --- a/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj +++ b/sdk/mongocluster/Azure.ResourceManager.MongoCluster/src/Azure.ResourceManager.MongoCluster.csproj @@ -1,6 +1,6 @@ - + - 1.0.0-beta.1 + 1.0.0-beta.2 Azure.ResourceManager.MongoCluster Azure Resource Manager client SDK for Azure resource provider Microsoft.MongoCluster. azure;management;arm;resource manager;mongocluster diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md index 32db15360c8c..9351eb7c2f83 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md @@ -18,8 +18,20 @@ * Fixed a bug where LiveMetrics displays "UNKNOWN_INSTANCE" and "UNKNOWN_NAME" for "server name" and "role name" respectively. ([#45433](https://github.com/Azure/azure-sdk-for-net/pull/45433)) +* Fixed a bug in LiveMetrics that counted all manually created Dependencies as failures. + ([#45103](https://github.com/Azure/azure-sdk-for-net/pull/45103)) + ### Other Changes +* Updated field mappings for telemetry sent to LiveMetrics. + ([#45103](https://github.com/Azure/azure-sdk-for-net/pull/45103)) + +* Updated log collection to default to Warning level and above for Azure SDKs + via `Microsoft.Extensions.Logging`. For more information, refer to [Logging + with the Azure SDK for + .NET](https://learn.microsoft.com/dotnet/azure/sdk/logging). + ([#45649](https://github.com/Azure/azure-sdk-for-net/pull/45649)) + ## 1.3.0-beta.1 (2024-07-12) ### Bugs Fixed diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj index 2474f074dc02..1e16c984cda5 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Azure.Monitor.OpenTelemetry.AspNetCore.csproj @@ -23,10 +23,10 @@ - + - + diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs index 81120d325d82..c4c970cdfe98 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/Internals/AzureSdkCompat/AzureEventSourceLogForwarder.cs @@ -14,8 +14,9 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.Internals.AzureSdkCompat { internal sealed class AzureEventSourceLogForwarder : IHostedService, IDisposable { - internal static readonly AzureEventSourceLogForwarder Noop = new AzureEventSourceLogForwarder(null); + internal static readonly AzureEventSourceLogForwarder Noop = new AzureEventSourceLogForwarder(null, null); private readonly ILoggerFactory _loggerFactory; + private readonly bool _hasAzureLoggerFilterOptionsRules = false; private readonly ConcurrentDictionary _loggers = new ConcurrentDictionary(); @@ -23,9 +24,19 @@ internal sealed class AzureEventSourceLogForwarder : IHostedService, IDisposable private AzureEventSourceListener _listener; - public AzureEventSourceLogForwarder(ILoggerFactory loggerFactory) + public AzureEventSourceLogForwarder(ILoggerFactory loggerFactory, LoggerFilterOptions loggerFilterOptions) { _loggerFactory = loggerFactory; + + foreach (var rule in loggerFilterOptions?.Rules ?? Enumerable.Empty()) + { + if (!string.IsNullOrEmpty(rule.CategoryName) + && rule.CategoryName != "Azure.Monitor.OpenTelemetry.CustomEvents" // Exporter defines a custom filter rule to support CustomEvents. We MUST ignore this here. + && (rule.CategoryName.StartsWith("Azure.") || rule.CategoryName.StartsWith("Microsoft.Azure."))) + { + _hasAzureLoggerFilterOptionsRules = true; + } + } } private void LogEvent(EventWrittenEventArgs eventData) @@ -67,7 +78,9 @@ public Task StartAsync(CancellationToken cancellationToken) { if (_loggerFactory != null) { - _listener ??= new AzureEventSourceListener((e, s) => LogEvent(e), EventLevel.Verbose); + // Setting even a single custom filter for Azure SDK logs will reset the default warning level and switch to listening at the verbose level. + // This gives the customer full control over the log levels for all Azure SDK components. + _listener ??= new AzureEventSourceListener((e, s) => LogEvent(e), _hasAzureLoggerFilterOptionsRules ? EventLevel.Verbose : EventLevel.Warning); } return Task.CompletedTask; diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/DataCollection/DocumentHelper.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/DataCollection/DocumentHelper.cs index c4727d0dbc4b..a083e3ede32b 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/DataCollection/DocumentHelper.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/DataCollection/DocumentHelper.cs @@ -108,8 +108,13 @@ internal static RemoteDependency ConvertToDependencyDocument(Activity activity) RemoteDependency remoteDependencyDocument = new() { DocumentType = DocumentType.RemoteDependency, + Duration = activity.Duration < SchemaConstants.RemoteDependencyData_Duration_LessThanDays + ? activity.Duration.ToString("c", CultureInfo.InvariantCulture) + : SchemaConstants.Duration_MaxValue, + // The following "EXTENSION" properties are used to calculate metrics. These are not serialized. Extension_Duration = activity.Duration.TotalMilliseconds, + Extension_IsSuccess = activity.Status != ActivityStatusCode.Error, }; var liveMetricsTagsProcessor = new LiveMetricsTagsProcessor(); @@ -119,41 +124,41 @@ internal static RemoteDependency ConvertToDependencyDocument(Activity activity) { case OperationType.Http: remoteDependencyDocument.Name = activity.DisplayName; - remoteDependencyDocument.CommandName = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeUrlFull)?.ToString(); + + var httpUrl = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeUrlFull)?.ToString(); + remoteDependencyDocument.CommandName = httpUrl; + var httpResponseStatusCode = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeHttpResponseStatusCode)?.ToString(); - remoteDependencyDocument.ResultCode = httpResponseStatusCode; - remoteDependencyDocument.Duration = activity.Duration < SchemaConstants.RequestData_Duration_LessThanDays - ? activity.Duration.ToString("c", CultureInfo.InvariantCulture) - : SchemaConstants.Duration_MaxValue; + remoteDependencyDocument.ResultCode = httpResponseStatusCode ?? "0"; // The following "EXTENSION" properties are used to calculate metrics. These are not serialized. remoteDependencyDocument.Extension_IsSuccess = IsHttpSuccess(activity, httpResponseStatusCode); break; case OperationType.Db: - // Note: The Exception details are recorded in Activity.Events only if the configuration has opt-ed into this (SqlClientInstrumentationOptions.RecordException). - - var (_, dbTarget) = liveMetricsTagsProcessor.Tags.GetDbDependencyTargetAndName(); + remoteDependencyDocument.Name = activity.DisplayName; - remoteDependencyDocument.Name = dbTarget; remoteDependencyDocument.CommandName = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeDbStatement)?.ToString(); - remoteDependencyDocument.Duration = activity.Duration.ToString("c", CultureInfo.InvariantCulture); // TODO: remoteDependencyDocumentIngress.ResultCode = ""; // AI SDK reads a Number property from Connection or Command objects. // As of Feb 2024, OpenTelemetry doesn't record this. This may change in the future when the semantic convention stabalizes. - // The following "EXTENSION" properties are used to calculate metrics. These are not serialized. - remoteDependencyDocument.Extension_IsSuccess = activity.Status != ActivityStatusCode.Error; - break; - case OperationType.Rpc: - // TODO RPC break; case OperationType.Messaging: - // TODO MESSAGING + remoteDependencyDocument.Name = activity.DisplayName; + + var (messagingUrl, _) = liveMetricsTagsProcessor.Tags.GetMessagingUrlAndSourceOrTarget(activity.Kind); + remoteDependencyDocument.CommandName = messagingUrl; + break; + case OperationType.Rpc: + // remoteDependencyDocument.Name = activity.DisplayName; + // remoteDependencyDocument.CommandName = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeRpcService)?.ToString(); + // remoteDependencyDocument.ResultCode = AzMonList.GetTagValue(ref liveMetricsTagsProcessor.Tags, SemanticConventions.AttributeRpcStatus)?.ToString(); default: - // Unknown or Unexpected Dependency Type - remoteDependencyDocument.Name = liveMetricsTagsProcessor.ActivityType.ToString(); + // Unknown or Manual or Unexpected Dependency Type + remoteDependencyDocument.Name = activity.DisplayName; + remoteDependencyDocument.Properties.Add(new KeyValuePairString("ActivitySource", activity.Source.Name)); break; } diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AccumulatedValues.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AccumulatedValues.cs index 70699d71c755..53972e7ccc88 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AccumulatedValues.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AccumulatedValues.cs @@ -13,7 +13,7 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics.Filtering /// internal class AccumulatedValues { - private readonly AggregationType aggregationType; + private readonly AggregationTypeEnum aggregationType; private SpinLock spinLock = new SpinLock(); @@ -25,7 +25,7 @@ internal class AccumulatedValues private double min = double.MaxValue; - public AccumulatedValues(string metricId, AggregationType aggregationType) + public AccumulatedValues(string metricId, AggregationTypeEnum aggregationType) { this.MetricId = metricId; this.aggregationType = aggregationType; @@ -44,18 +44,18 @@ public void AddValue(double value) switch (this.aggregationType) { - case AggregationType.Avg: - case AggregationType.Sum: + case AggregationTypeEnum.Avg: + case AggregationTypeEnum.Sum: this.sum += value; break; - case AggregationType.Min: + case AggregationTypeEnum.Min: if (value < this.min) { this.min = value; } break; - case AggregationType.Max: + case AggregationTypeEnum.Max: if (value > this.max) { this.max = value; @@ -86,13 +86,13 @@ public double CalculateAggregation(out long count) count = this.count; switch (this.aggregationType) { - case AggregationType.Avg: + case AggregationTypeEnum.Avg: return this.count != 0 ? this.sum / this.count : 0.0; - case AggregationType.Sum: + case AggregationTypeEnum.Sum: return this.sum; - case AggregationType.Min: + case AggregationTypeEnum.Min: return this.count != 0 ? this.min : 0.0; - case AggregationType.Max: + case AggregationTypeEnum.Max: return this.count != 0 ? this.max : 0.0; default: throw new ArgumentOutOfRangeException( diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationTypeEnum.cs similarity index 87% rename from sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationType.cs rename to sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationTypeEnum.cs index 4f4b1c0f98f8..f3f496a51e33 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationType.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/AggregationTypeEnum.cs @@ -3,7 +3,7 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics.Filtering { - internal enum AggregationType + internal enum AggregationTypeEnum { Avg = 0, diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/CollectionConfiguration.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/CollectionConfiguration.cs index 3f39151fb693..d468857c35b2 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/CollectionConfiguration.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/CollectionConfiguration.cs @@ -7,7 +7,6 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics.Filtering using System.Collections.Generic; using System.Globalization; using System.Linq; - using Azure.Monitor.OpenTelemetry.Exporter.Internals; using Azure.Monitor.OpenTelemetry.AspNetCore.Models; using ExceptionDocument = Models.Exception; @@ -41,7 +40,7 @@ internal class CollectionConfiguration #endregion #region Metadata used by other components - private readonly List> telemetryMetadata = new List>(); + private readonly List> telemetryMetadata = new List>(); #endregion public CollectionConfiguration( @@ -110,7 +109,7 @@ private void UpdateAllErrorsWithKeyValue(CollectionConfigurationError[] errors, /// /// Gets Telemetry types only. Used by QuickPulseTelemetryProcessor. /// - public IEnumerable> TelemetryMetadata => this.telemetryMetadata; + public IEnumerable> TelemetryMetadata => this.telemetryMetadata; /// /// Gets document streams. Telemetry items are provided by QuickPulseTelemetryProcessor. diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/DerivedMetric.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/DerivedMetric.cs index d55e891cd36d..a6aa96251b51 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/DerivedMetric.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Filtering/DerivedMetric.cs @@ -56,7 +56,7 @@ public DerivedMetric(DerivedMetricInfo info, out CollectionConfigurationError[] public string Id => this.info.Id; - public Models.AggregationType? AggregationType => this.info.Aggregation; // TODO: this was enum. Need to double check new type is parsed and used correctly. + public AggregationType? AggregationType => this.info.Aggregation; // TODO: this was enum. Need to double check new type is parsed and used correctly. public bool CheckFilters(TTelemetry document, out CollectionConfigurationError[] errors) { diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Manager.Metrics.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Manager.Metrics.cs index 9be0c56b3fcc..628769a1cc32 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Manager.Metrics.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/LiveMetrics/Manager.Metrics.cs @@ -194,8 +194,8 @@ private Dictionary CreateMetricAccumulators(Collectio Dictionary metricAccumulators = new(); // prepare the accumulators based on the collection configuration - IEnumerable> allMetrics = collectionConfiguration.TelemetryMetadata; - foreach (Tuple metricId in allMetrics) + IEnumerable> allMetrics = collectionConfiguration.TelemetryMetadata; + foreach (Tuple metricId in allMetrics) { var derivedMetricInfoAggregation = metricId.Item2; if (!derivedMetricInfoAggregation.HasValue) @@ -203,7 +203,7 @@ private Dictionary CreateMetricAccumulators(Collectio continue; } - if (Enum.TryParse(derivedMetricInfoAggregation.ToString(), out AspNetCore.LiveMetrics.Filtering.AggregationType aggregationType)) + if (Enum.TryParse(derivedMetricInfoAggregation.ToString(), out AspNetCore.LiveMetrics.Filtering.AggregationTypeEnum aggregationType)) { var accumulatedValues = new AccumulatedValues(metricId.Item1, aggregationType); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs index 6b3a6167abbd..4906a3aff565 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs @@ -6,6 +6,7 @@ using Azure.Monitor.OpenTelemetry.AspNetCore.Internals.LiveMetrics; using Azure.Monitor.OpenTelemetry.AspNetCore.Internals.Profiling; using Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics; +using Azure.Monitor.OpenTelemetry.Events; using Azure.Monitor.OpenTelemetry.Exporter; using Azure.Monitor.OpenTelemetry.Exporter.Internals.Platform; using Microsoft.Extensions.Configuration; @@ -28,6 +29,7 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore public static class OpenTelemetryBuilderExtensions { private const string SqlClientInstrumentationPackageName = "OpenTelemetry.Instrumentation.SqlClient"; + private const string EventLoggerName = "Azure.Monitor.OpenTelemetry.CustomEvents"; /// /// Configures Azure Monitor for logging, distributed tracing, and metrics. @@ -176,7 +178,8 @@ public static OpenTelemetryBuilder UseAzureMonitor(this OpenTelemetryBuilder bui } var loggerFactory = sp.GetRequiredService(); - return new AzureEventSourceLogForwarder(loggerFactory); + var loggerFilterOptions = sp.GetRequiredService>().CurrentValue; + return new AzureEventSourceLogForwarder(loggerFactory, loggerFilterOptions); }); // Register Manager as a singleton @@ -211,6 +214,34 @@ public static OpenTelemetryBuilder UseAzureMonitor(this OpenTelemetryBuilder bui } }); + // Enable custom events and set filter to enable collection. + builder.Services.TryAddSingleton(); + + // The default behavior is to always capture logs for custom events. + // This can achieved with this code level filter -> loggingBuilder.AddFilter("",LogLevel.Information); + // However, this may run into issues when users try to override this behavior from Configuration like below using appsettings.json: + // { + // "Logging": { + // "OpenTelemetry": { + // "LogLevel": { + // "Azure.Monitor.OpenTelemetry.CustomEvents": "None" + // } + // } + // }, + // ... + // } + // The reason is as both rules will match the filter, the last one added wins. + // To ensure that the default filter is in the beginning of filter rules, so that user override from Configuration will always win, + // we add code filter rule to the 0th position as below. + builder.Services.Configure( + options => options.Rules.Insert( + 0, + new LoggerFilterRule( + "OpenTelemetry", + EventLoggerName, + LogLevel.Information, + null))); + return builder; } diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs index d2b336bb2932..bced439dd7cc 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/AzureSdkLoggingTests.cs @@ -11,135 +11,249 @@ using System.Threading.Tasks; using Azure.Core.Diagnostics; using Azure.Core.TestFramework; -using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Xunit; -using static Xunit.CustomXunitAttributes; namespace Azure.Monitor.OpenTelemetry.AspNetCore.Tests { public class AzureSdkLoggingTests { -#if NET6_0 - [ConditionallySkipOSTheory(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] -#else + private readonly MockTransport _mockTransport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); + [Theory] -#endif - [InlineData(LogLevel.Information, "TestInfoEvent: hello")] - [InlineData(LogLevel.Warning, "TestWarningEvent: hello")] - [InlineData(LogLevel.Debug, null)] - public async Task DistroLogForwarderIsAdded(LogLevel eventLevel, string expectedMessage) + [InlineData(false, LogLevel.Debug, null)] + [InlineData(false, LogLevel.Information, null)] + [InlineData(false, LogLevel.Warning, "TestWarningEvent: hello")] + [InlineData(true, LogLevel.Information, "TestInfoEvent: hello")] + [InlineData(true, LogLevel.Warning, "TestWarningEvent: hello")] + [InlineData(true, LogLevel.Debug, "TestVerboseEvent: hello")] + public async Task DistroLogForwarderIsAdded(bool addLoggingFilter, LogLevel eventLevel, string expectedMessage) { - var builder = WebApplication.CreateBuilder(); - var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); - SetUpOTelAndLogging(builder, transport, LogLevel.Information); + // SETUP + var serviceCollection = new ServiceCollection(); + using TestEventSource source = new TestEventSource(addLoggingFilter ? "Azure-LoggingFilter" : "Azure-Test"); + + SetUpOTelAndLogging(serviceCollection, _mockTransport, LogLevel.Information, (loggingBuilder) => + { + if (addLoggingFilter) + { + loggingBuilder.AddFilter(source.Name.Replace('-', '.'), eventLevel); + } + }); - using var app = builder.Build(); - await app.StartAsync(); + using var serviceProvider = serviceCollection.BuildServiceProvider(); - using TestEventSource source = new TestEventSource(); + // We must manually start any IHostedServices. This includes the AzureLogForwarder. + // In a normal app, Microsoft.Extensions.Hosting would handle this. + await StartHostedServicesAsync(serviceProvider); + + // ACT Assert.True(source.IsEnabled()); source.LogMessage("hello", eventLevel); - WaitForRequest(transport); + WaitForRequest(_mockTransport); + + // ASSERT if (expectedMessage != null) { - Assert.Single(transport.Requests); - await AssertContentContains(transport.Requests.Single(), expectedMessage, eventLevel); + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), expectedMessage, eventLevel); } else { - await AssertContentDoesNotContain(transport.Requests, "hello"); + await AssertContentDoesNotContain(_mockTransport.Requests, "hello"); } } -#if NET6_0 - [ConditionallySkipOSTheory(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] -#else [Theory] -#endif [InlineData(LogLevel.Information, "TestInfoEvent: hello")] [InlineData(LogLevel.Warning, "TestWarningEvent: hello")] [InlineData(LogLevel.Debug, null)] public async Task PublicLogForwarderIsAdded(LogLevel eventLevel, string expectedMessage) { - var builder = WebApplication.CreateBuilder(); - var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); - SetUpOTelAndLogging(builder, transport, LogLevel.Information); - - builder.Services.TryAddSingleton(); - using var app = builder.Build(); + // SETUP + var serviceCollection = new ServiceCollection(); + SetUpOTelAndLogging(serviceCollection, _mockTransport, LogLevel.Information); - Microsoft.Extensions.Azure.AzureEventSourceLogForwarder publicLogForwarder = - app.Services.GetRequiredService(); + serviceCollection.TryAddSingleton(); - Assert.NotNull(publicLogForwarder); - publicLogForwarder.Start(); + using var serviceProvider = serviceCollection.BuildServiceProvider(); - await app.StartAsync(); + var logForwarder = serviceProvider.GetRequiredService(); + Assert.NotNull(logForwarder); + logForwarder.Start(); - using TestEventSource source = new TestEventSource(); + // ACT + using TestEventSource source = new TestEventSource("Azure-Test"); Assert.True(source.IsEnabled()); source.LogMessage("hello", eventLevel); + WaitForRequest(_mockTransport); - WaitForRequest(transport); + // ASSERT if (expectedMessage != null) { - Assert.Single(transport.Requests); - await AssertContentContains(transport.Requests.Single(), expectedMessage, eventLevel); + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), expectedMessage, eventLevel); } else { - await AssertContentDoesNotContain(transport.Requests, "hello"); + await AssertContentDoesNotContain(_mockTransport.Requests, "hello"); } } -#if NET6_0 - [ConditionallySkipOSFact(platformToSkip: "macos", reason: "This test consistently exceeds 1 hour runtime limit when running on MacOS & Net60")] -#else [Fact] -#endif - public async Task SelfDiagnosticsIsDisabled() + public void SelfDiagnosticsIsDisabled() { + // SETUP + bool logAzureFilterCalled = false; var enableLevel = LogLevel.Debug; - var builder = WebApplication.CreateBuilder(); - var transport = new MockTransport(_ => new MockResponse(200).SetContent("ok")); - builder.Logging.ClearProviders(); - bool logAzureFilterCalled = false; - builder.Logging.AddFilter((name, level) => + var serviceCollection = new ServiceCollection(); + + serviceCollection.AddLogging(loggingBuilder => { - if (name != null && name.StartsWith("Azure")) + loggingBuilder.ClearProviders(); + loggingBuilder.AddFilter((name, level) => { - logAzureFilterCalled = true; - return level >= enableLevel; - } - return false; + if (name != null && name.StartsWith("Azure")) + { + logAzureFilterCalled = true; + return level >= enableLevel; + } + return false; + }); }); - builder.Services.AddOpenTelemetry().UseAzureMonitor(config => + + serviceCollection.AddOpenTelemetry().UseAzureMonitor(config => { - config.Transport = transport; - config.ConnectionString = $"InstrumentationKey={Guid.NewGuid()}"; + config.Transport = _mockTransport; + config.ConnectionString = $"InstrumentationKey={nameof(SelfDiagnosticsIsDisabled)}"; config.EnableLiveMetrics = true; Assert.False(config.Diagnostics.IsLoggingEnabled); Assert.False(config.Diagnostics.IsDistributedTracingEnabled); }); - using var app = builder.Build(); - await app.StartAsync(); + using var serviceProvider = serviceCollection.BuildServiceProvider(); + // ASSERT // let's get some live metric requests first to check that no logs were recorded for them - WaitForRequest(transport, r => r.Uri.Host == "rt.services.visualstudio.com"); + var liveMetricsRequests = WaitForRequest(_mockTransport, r => r.Uri.Host == "rt.services.visualstudio.com"); + Assert.Empty(liveMetricsRequests); // now let's wait for track requests - var trackRequests = WaitForRequest(transport, r => r.Uri.Host == "dc.services.visualstudio.com"); - Assert.Empty(trackRequests); + var breezeTrackRequests = WaitForRequest(_mockTransport, r => r.Uri.Host == "dc.services.visualstudio.com"); + Assert.Empty(breezeTrackRequests); // since LiveMetrics logging is disabled, we shouldn't even have logging policy trying to log anything. Assert.False(logAzureFilterCalled); } + [Fact] + public async Task DistroLogForwarderAppliesWildCardFilter() + { + // SETUP + var serviceCollection = new ServiceCollection(); + SetUpOTelAndLogging(serviceCollection, _mockTransport, LogLevel.Information, (loggingBuilder) => loggingBuilder.AddFilter("Azure.*", LogLevel.Warning)); + using var serviceProvider = serviceCollection.BuildServiceProvider(); + + // We must manually start any IHostedServices. This includes the AzureLogForwarder. + // In a normal app, Microsoft.Extensions.Hosting would handle this. + var hostedServices = serviceProvider.GetServices(); + foreach (var hostedService in hostedServices) + { + await hostedService.StartAsync(CancellationToken.None); + } + + // ACT + using TestEventSource source = new TestEventSource("Azure-Test"); + Assert.True(source.IsEnabled()); + source.LogMessage("hello", LogLevel.Warning); + WaitForRequest(_mockTransport); + + // ASSERT + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), "TestWarningEvent: hello", LogLevel.Warning); + } + + [Fact] + public async Task SettingCustomLoggingFilterResetsDefaultWarningLevel() + { + // SETUP + var serviceCollection = new ServiceCollection(); + SetUpOTelAndLogging(serviceCollection, _mockTransport, LogLevel.Information, (loggingBuilder) => loggingBuilder.AddFilter("Azure.One", LogLevel.Information)); + using var serviceProvider = serviceCollection.BuildServiceProvider(); + + // We must manually start any IHostedServices. This includes the AzureLogForwarder. + // In a normal app, Microsoft.Extensions.Hosting would handle this. + await StartHostedServicesAsync(serviceProvider); + + // ACT 1 + // Azure-One is added as a logging filter, the default warning level is reset. + // Informational-level logs from Azure-One sources are collected. + using TestEventSource source1 = new TestEventSource("Azure-One"); + Assert.True(source1.IsEnabled()); + + // ASSERT 1 + source1.LogMessage("hello one", LogLevel.Information); + WaitForRequest(_mockTransport); + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), "TestInfoEvent: hello one", LogLevel.Information); + _mockTransport.Requests.Clear(); + + // ACT 2 + // Azure-Two is not part of the logging filter. + // Since the logging filter is customized for the Azure SDK, the default warning level is reset. + // Informational-level logs from Azure-Two sources are collected. + using TestEventSource source2 = new TestEventSource("Azure-Two"); + Assert.True(source2.IsEnabled()); + + // ASSERT 2 + source2.LogMessage("hello two", LogLevel.Information); + WaitForRequest(_mockTransport); + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), "TestInfoEvent: hello two", LogLevel.Information); + } + + [Fact] + public async Task CustomLoggingFilterOverridesDefaultWarningAndCapturesErrorLogs() + { + // SETUP + var serviceCollection = new ServiceCollection(); + SetUpOTelAndLogging(serviceCollection, _mockTransport, LogLevel.Information, (loggingBuilder) => loggingBuilder.AddFilter("Azure.One", LogLevel.Error)); + using var serviceProvider = serviceCollection.BuildServiceProvider(); + + // We must manually start any IHostedServices. This includes the AzureLogForwarder. + // In a normal app, Microsoft.Extensions.Hosting would handle this. + await StartHostedServicesAsync(serviceProvider); + + // ACT + using TestEventSource source1 = new TestEventSource("Azure-One"); + Assert.True(source1.IsEnabled()); + + // Only log level with errors should be captured as it is set in the logging filter. + source1.LogMessage("Hello Information", LogLevel.Information); + source1.LogMessage("Hello Debug", LogLevel.Debug); + source1.LogMessage("Hello Warning", LogLevel.Warning); + source1.LogMessage("Hello Error", LogLevel.Error); + WaitForRequest(_mockTransport); + + // ASSERT + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), "TestErrorEvent: Hello Error", LogLevel.Error); + + // Azure-Two is not part of the logging filter, it should capture all logs. + using TestEventSource source2 = new TestEventSource("Azure-Two"); + Assert.True(source2.IsEnabled()); + _mockTransport.Requests.Clear(); + + source2.LogMessage("hello two", LogLevel.Information); + WaitForRequest(_mockTransport); + Assert.Single(_mockTransport.Requests); + await AssertContentContains(_mockTransport.Requests.Single(), "TestInfoEvent: hello two", LogLevel.Information); + } + private IEnumerable WaitForRequest(MockTransport transport, Func? filter = null) { filter = filter ?? (_ => true); @@ -161,7 +275,8 @@ private static async Task AssertContentContains(MockRequest request, str contentStream.Position = 0; var content = BinaryData.FromStream(contentStream).ToString(); var jsonMessage = $"\"message\":\"{expectedMessage}\""; - var jsonLevel = $"\"severityLevel\":\"{expectedLevel}\""; + var level = expectedLevel == LogLevel.Debug ? "Verbose" : expectedLevel.ToString(); + var jsonLevel = $"\"severityLevel\":\"{level}\""; Assert.Contains(jsonMessage, content); Assert.Contains(jsonLevel, content); @@ -184,19 +299,24 @@ private static async Task AssertContentDoesNotContain(List requests } } - private static void SetUpOTelAndLogging(WebApplicationBuilder builder, MockTransport transport, LogLevel enableLevel) + private static void SetUpOTelAndLogging(ServiceCollection serviceCollection, MockTransport transport, LogLevel enableLevel, Action? extraLoggingConfig = null) { - builder.Logging.ClearProviders(); - builder.Logging.AddFilter((name, level) => + serviceCollection.AddLogging(loggingBuilder => { - if (name != null && name.StartsWith("Azure")) + //loggingBuilder.ClearProviders(); + loggingBuilder.AddFilter((name, level) => { - return level >= enableLevel; - } - return false; + if (name != null && name.StartsWith("Azure")) + { + return level >= enableLevel; + } + return false; + }); + + extraLoggingConfig?.Invoke(loggingBuilder); }); - builder.Services.AddOpenTelemetry().UseAzureMonitor(config => + serviceCollection.AddOpenTelemetry().UseAzureMonitor(config => { config.Transport = transport; config.ConnectionString = $"InstrumentationKey={Guid.NewGuid()}"; @@ -204,11 +324,22 @@ private static void SetUpOTelAndLogging(WebApplicationBuilder builder, MockTrans }); } + private static async Task StartHostedServicesAsync(ServiceProvider serviceProvider) + { + var hostedServices = serviceProvider.GetServices(); + foreach (var hostedService in hostedServices) + { + await hostedService.StartAsync(CancellationToken.None); + } + } + internal class TestEventSource : AzureEventSource { - private const string EventSourceName = "Azure-Test"; - public TestEventSource() : base(EventSourceName) + private readonly string EventSourceName; + + public TestEventSource(string eventSourceName) : base(eventSourceName) { + EventSourceName = eventSourceName; } [Event(1, Level = EventLevel.Informational, Message = "TestInfoEvent: {0}")] @@ -229,10 +360,19 @@ public void LogTestWarningEvent(string message) WriteEvent(3, message); } + [Event(4, Level = EventLevel.Error, Message = "TestErrorEvent: {0}")] + public void LogTestErrorEvent(string message) + { + WriteEvent(4, message); + } + public void LogMessage(string message, LogLevel level) { switch (level) { + case LogLevel.Error: + LogTestErrorEvent(message); + break; case LogLevel.Warning: LogTestWarningEvent(message); break; diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/E2ETests/ILoggerTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/E2ETests/ILoggerTests.cs new file mode 100644 index 000000000000..c6b5368c5f5d --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/E2ETests/ILoggerTests.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#if !NETFRAMEWORK +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using Azure.Monitor.OpenTelemetry.Events; +using Azure.Monitor.OpenTelemetry.Exporter.Models; +using Azure.Monitor.OpenTelemetry.Exporter.Tests.CommonTestFramework; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.AspNetCore.TestHost; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using OpenTelemetry.Logs; +using OpenTelemetry.Trace; +using Xunit; +using Xunit.Abstractions; + +namespace Azure.Monitor.OpenTelemetry.AspNetCore.Tests.E2ETests +{ + public partial class ILoggerTests + : IClassFixture>, IDisposable + { + private readonly WebApplicationFactory _factory; + private readonly TelemetryItemOutputHelper _telemetryOutput; + + public ILoggerTests(WebApplicationFactory factory, ITestOutputHelper output) + { + _factory = factory; + _telemetryOutput = new TelemetryItemOutputHelper(output); + } + + [Fact] + public void CustomEventsAreCapturedCorrectly() + { + // SETUP MOCK TRANSMITTER TO CAPTURE AZURE MONITOR TELEMETRY + var testConnectionString = $"InstrumentationKey=unitTest-{nameof(CustomEventsAreCapturedCorrectly)}"; + var telemetryItems = new List(); + var mockTransmitter = new Exporter.Tests.CommonTestFramework.MockTransmitter(telemetryItems); + // The TransmitterFactory is invoked by the Exporter during initialization to ensure that there's only one instance of a transmitter/connectionString shared by all Exporters. + // Here we're setting that instance to use the MockTransmitter so this test can capture telemetry before it's sent to Azure Monitor. + Exporter.Internals.TransmitterFactory.Instance.Set(connectionString: testConnectionString, transmitter: mockTransmitter); + + // SETUP WEBAPPLICATIONFACTORY WITH OPENTELEMETRY + using (var client = _factory + .WithWebHostBuilder(builder => + { + builder.ConfigureLogging(loggingBuilder => loggingBuilder.ClearProviders()); + builder.ConfigureTestServices(serviceCollection => + { + serviceCollection.AddOpenTelemetry() + .UseAzureMonitor(x => + { + x.EnableLiveMetrics = false; + x.ConnectionString = testConnectionString; + }); + }); + + builder.Configure(app => + { + app.UseRouting(); + + app.UseEndpoints(endpoints => + { + endpoints.MapGet("/", (IApplicationInsightsEventLogger CustomEventLogger) => + { + CustomEventLogger.TrackEvent("TestCustomEvent"); + }); + }); + }); + }) + .CreateClient()) + { + // Act + try + { + using var response = client.GetAsync("/").Result; + } + catch + { + // Ignore exceptions + } + } + + // SHUTDOWN + var loggerProvider = _factory.Factories.Last().Services.GetRequiredService(); + loggerProvider.ForceFlush(); + + // ASSERT + _telemetryOutput.Write(telemetryItems); + Assert.True(telemetryItems.Any(), "Unit test failed to collect telemetry."); + var telemetryItem = telemetryItems.Where(x => x.Name == "Event").Single(); + var eventData = (TelemetryEventData)(telemetryItem.Data.BaseData); + Assert.Equal("TestCustomEvent", eventData.Name); + } + + [Fact] + public void IloggerFilterCanBeAppliedToCustomEvent() + { + // SETUP MOCK TRANSMITTER TO CAPTURE AZURE MONITOR TELEMETRY + var testConnectionString = $"InstrumentationKey=unitTest-{nameof(CustomEventsAreCapturedCorrectly)}"; + var telemetryItems = new List(); + var mockTransmitter = new Exporter.Tests.CommonTestFramework.MockTransmitter(telemetryItems); + // The TransmitterFactory is invoked by the Exporter during initialization to ensure that there's only one instance of a transmitter/connectionString shared by all Exporters. + // Here we're setting that instance to use the MockTransmitter so this test can capture telemetry before it's sent to Azure Monitor. + Exporter.Internals.TransmitterFactory.Instance.Set(connectionString: testConnectionString, transmitter: mockTransmitter); + + // SETUP WEBAPPLICATIONFACTORY WITH OPENTELEMETRY + using (var client = _factory + .WithWebHostBuilder(builder => + { + builder.ConfigureLogging(loggingBuilder => + { + loggingBuilder.ClearProviders(); + + // Filter out custom events. + loggingBuilder.AddFilter("Azure.Monitor.OpenTelemetry.CustomEvents", LogLevel.None); + }); + builder.ConfigureTestServices(serviceCollection => + { + serviceCollection.AddOpenTelemetry() + .UseAzureMonitor(x => + { + x.EnableLiveMetrics = false; + x.ConnectionString = testConnectionString; + }); + }); + + builder.Configure(app => + { + app.UseRouting(); + + app.UseEndpoints(endpoints => + { + endpoints.MapGet("/", (IApplicationInsightsEventLogger CustomEventLogger) => + { + CustomEventLogger.TrackEvent("TestCustomEvent"); + }); + }); + }); + }) + .CreateClient()) + { + // Act + try + { + using var response = client.GetAsync("/").Result; + } + catch + { + // Ignore exceptions + } + } + + // SHUTDOWN + var loggerProvider = _factory.Factories.Last().Services.GetRequiredService(); + loggerProvider.ForceFlush(); + + // ASSERT + _telemetryOutput.Write(telemetryItems); + + // Internal Asp.NetCore logging. + Assert.NotNull(telemetryItems); + + var traceTelemetry = telemetryItems.Where(x => x.Name == "Message").FirstOrDefault(); + Assert.NotNull(traceTelemetry); + + // Custom event should not be collected. + var eventTelemetry = telemetryItems.Where(x => x.Name == "Event").FirstOrDefault(); + Assert.Null(eventTelemetry); + } + + public void Dispose() + { + // OpenTelemetry is registered on a nested Factory which is not disposed between test runs! + // MUST explicitly dispose the nested Factory to avoid test conflicts. + _factory.Factories.Last().Dispose(); + + _factory.Dispose(); + } + } +} +#endif diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/HttpClientDependecyTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/HttpClientDependecyTests.cs index 0a1f042a6a07..828d42055c46 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/HttpClientDependecyTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/HttpClientDependecyTests.cs @@ -43,7 +43,7 @@ public void VerifyHttpClientAttributes() ActivitySource.AddActivityListener(listener); // ACT - using var dependencyActivity = activitySource.StartActivity(name: "HelloWorld", kind: ActivityKind.Client); + using var dependencyActivity = activitySource.StartActivity(name: "TestActivityName", kind: ActivityKind.Client); Assert.NotNull(dependencyActivity); dependencyActivity.SetTag("http.request.method", "GET"); dependencyActivity.SetTag("url.full", "http://bing.com"); @@ -67,7 +67,7 @@ public void VerifyHttpClientAttributes() // ASSERT Assert.Equal("http://bing.com", dependencyDocument.CommandName); Assert.Equal(DocumentType.RemoteDependency, dependencyDocument.DocumentType); - Assert.Equal("HelloWorld", dependencyDocument.Name); + Assert.Equal("TestActivityName", dependencyDocument.Name); Assert.Equal("200", dependencyDocument.ResultCode); VerifyCustomProperties(dependencyDocument); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/ManualDependencyTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/ManualDependencyTests.cs new file mode 100644 index 000000000000..5df314e5098f --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/ManualDependencyTests.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; +using Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics.DataCollection; +using Azure.Monitor.OpenTelemetry.AspNetCore.Models; +using Microsoft.AspNetCore.Builder; +using OpenTelemetry; +using OpenTelemetry.Trace; +using Xunit; +using Xunit.Abstractions; + +namespace Azure.Monitor.OpenTelemetry.AspNetCore.Tests.LiveMetrics.DocumentTests +{ + public class ManualDependencyTests : DocumentTestBase + { + public ManualDependencyTests(ITestOutputHelper output) : base(output) + { + } + + [Theory] + [InlineData(ActivityStatusCode.Ok, true)] + [InlineData(ActivityStatusCode.Error, false)] + [InlineData(ActivityStatusCode.Unset, true)] + public void VerifyManualDependency(ActivityStatusCode activityStatusCode, bool expectedIsSuccess) + { + var exportedActivities = new List(); + + var testActivitySource = new ActivitySource("TestActivitySource"); + + // SETUP + using var tracerProvider = Sdk.CreateTracerProviderBuilder() + .AddSource("TestActivitySource") + .AddInMemoryExporter(exportedActivities) + .Build(); + + // ACT + using (var activity = testActivitySource.StartActivity("TestActivityName", ActivityKind.Internal)) + { + activity?.SetStatus(activityStatusCode); + } + + tracerProvider.ForceFlush(); + WaitForActivityExport(exportedActivities); + + // Assert + var dependencyActivity = exportedActivities.Last(); + PrintActivity(dependencyActivity); + var dependencyDocument = DocumentHelper.ConvertToDependencyDocument(dependencyActivity); + + Assert.Null(dependencyDocument.CommandName); + Assert.Equal(DocumentType.RemoteDependency, dependencyDocument.DocumentType); + Assert.Equal("TestActivityName", dependencyDocument.Name); + Assert.Equal("TestActivitySource", dependencyDocument.Properties.Single(x => x.Key == "ActivitySource").Value); + + //// The following "EXTENSION" properties are used to calculate metrics. These are not serialized. + Assert.Equal(dependencyActivity.Duration.TotalMilliseconds, dependencyDocument.Extension_Duration); + Assert.Equal(expectedIsSuccess, dependencyDocument.Extension_IsSuccess); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/SqlClientDependencyTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/SqlClientDependencyTests.cs index 83201283846a..fa6a782ff2bb 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/SqlClientDependencyTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/DocumentTests/SqlClientDependencyTests.cs @@ -46,7 +46,7 @@ public void VerifySqlClientAttributes() ActivitySource.AddActivityListener(listener); // ACT - using var dependencyActivity = activitySource.StartActivity(name: "HelloWorld", kind: ActivityKind.Client); + using var dependencyActivity = activitySource.StartActivity(name: "TestActivityName", kind: ActivityKind.Client); Assert.NotNull(dependencyActivity); dependencyActivity.SetTag("db.system", "mssql"); dependencyActivity.SetTag("db.name", "MyDatabase"); @@ -71,7 +71,7 @@ public void VerifySqlClientAttributes() Assert.Equal("select * from sys.databases", dependencyDocument.CommandName); Assert.Equal(DocumentType.RemoteDependency, dependencyDocument.DocumentType); Assert.Equal(dependencyActivity.Duration.ToString("c"), dependencyDocument.Duration); - Assert.Equal("(localdb)\\MSSQLLocalDB | MyDatabase", dependencyDocument.Name); + Assert.Equal("TestActivityName", dependencyDocument.Name); VerifyCustomProperties(dependencyDocument); @@ -141,7 +141,7 @@ public void VerifySqlClientDependency( Assert.Equal(commandText, dependencyDocument.CommandName); Assert.Equal(DocumentType.RemoteDependency, dependencyDocument.DocumentType); Assert.Equal(dependencyActivity.Duration.ToString("c"), dependencyDocument.Duration); - Assert.Equal("(localdb)\\MSSQLLocalDB | MyDatabase", dependencyDocument.Name); + Assert.Equal("MyDatabase", dependencyDocument.Name); // The following "EXTENSION" properties are used to calculate metrics. These are not serialized. Assert.Equal(dependencyActivity.Duration.TotalMilliseconds, dependencyDocument.Extension_Duration); @@ -214,7 +214,7 @@ public void VerifySqlClientDependencyWithException( Assert.Equal(commandText, dependencyDocument.CommandName); Assert.Equal(DocumentType.RemoteDependency, dependencyDocument.DocumentType); Assert.Equal(dependencyActivity.Duration.ToString("c"), dependencyDocument.Duration); - Assert.Equal("(localdb)\\MSSQLLocalDB | MyDatabase", dependencyDocument.Name); + Assert.Equal("MyDatabase", dependencyDocument.Name); // The following "EXTENSION" properties are used to calculate metrics. These are not serialized. Assert.Equal(dependencyActivity.Duration.TotalMilliseconds, dependencyDocument.Extension_Duration); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/AccumulatedValuesTest.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/AccumulatedValuesTest.cs index 9cb938544b2b..12018fd9ae8b 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/AccumulatedValuesTest.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/AccumulatedValuesTest.cs @@ -13,10 +13,10 @@ public void AccumulatedValuesAggregatesCorrectly() { // ARRANGE double[] accumulatedValues = { 1d, 3d }; - AccumulatedValues accumulatorAverage = new AccumulatedValues("Metric1", AggregationType.Avg); - AccumulatedValues accumulatorSum = new AccumulatedValues("Metric1", AggregationType.Sum); - AccumulatedValues accumulatorMin = new AccumulatedValues("Metric1", AggregationType.Min); - AccumulatedValues accumulatorMax = new AccumulatedValues("Metric1", AggregationType.Max); + AccumulatedValues accumulatorAverage = new AccumulatedValues("Metric1", AggregationTypeEnum.Avg); + AccumulatedValues accumulatorSum = new AccumulatedValues("Metric1", AggregationTypeEnum.Sum); + AccumulatedValues accumulatorMin = new AccumulatedValues("Metric1", AggregationTypeEnum.Min); + AccumulatedValues accumulatorMax = new AccumulatedValues("Metric1", AggregationTypeEnum.Max); // ACT ArrayHelpers.ForEach(accumulatedValues, accumulatorAverage.AddValue); @@ -45,10 +45,10 @@ public void AccumulatedValuesAggregatesCorrectly() public void AccumulatedValuesAggregatesCorrectlyForEmptyDataSet() { // ARRANGE - AccumulatedValues accumulatorAverage = new AccumulatedValues("Metric1", AggregationType.Avg); - AccumulatedValues accumulatorSum = new AccumulatedValues("Metric1", AggregationType.Sum); - AccumulatedValues accumulatorMin = new AccumulatedValues("Metric1", AggregationType.Min); - AccumulatedValues accumulatorMax = new AccumulatedValues("Metric1", AggregationType.Max); + AccumulatedValues accumulatorAverage = new AccumulatedValues("Metric1", AggregationTypeEnum.Avg); + AccumulatedValues accumulatorSum = new AccumulatedValues("Metric1", AggregationTypeEnum.Sum); + AccumulatedValues accumulatorMin = new AccumulatedValues("Metric1", AggregationTypeEnum.Min); + AccumulatedValues accumulatorMax = new AccumulatedValues("Metric1", AggregationTypeEnum.Max); // ACT double avg = accumulatorAverage.CalculateAggregation(out long avgCount); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/DerivedMetricTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/DerivedMetricTests.cs index 728c1ac0c843..669a357cdfcb 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/DerivedMetricTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Tests/LiveMetrics/Filtering/DerivedMetricTests.cs @@ -9,7 +9,6 @@ namespace Azure.Monitor.OpenTelemetry.AspNetCore.Tests.LiveMetrics.Filtering using Azure.Monitor.OpenTelemetry.AspNetCore.LiveMetrics.Filtering; using Azure.Monitor.OpenTelemetry.AspNetCore.Models; using Xunit; - using AggregationType = Models.AggregationType; using RequestTelemetry = Azure.Monitor.OpenTelemetry.AspNetCore.Models.Request; using TelemetryType = Models.TelemetryType; @@ -26,8 +25,8 @@ public void DerivedMetricFiltersCorrectly() telemetryType: TelemetryType.Request.ToString(), filterGroups: new[] { new FilterConjunctionGroupInfo(new List { filterInfo1, filterInfo2 }) }, projection: "Name", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetryThatMustPass = new RequestTelemetry() { Name = "Both the words 'dog' and 'CAT' are here, which satisfies both filters" }; @@ -60,8 +59,8 @@ public void DerivedMetricHandlesNoFiltersCorrectly() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "Name", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetryThatMustPass = new RequestTelemetry() { Name = "Both the words 'dog' and 'CAT' are here, which satisfies both filters" }; @@ -86,8 +85,8 @@ public void DerivedMetricHandlesNullFiltersCorrectly() telemetryType: TelemetryType.Request.ToString(), filterGroups: null, projection: "Name", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetryThatMustPass = new RequestTelemetry() { Name = "Both the words 'dog' and 'CAT' are here, which satisfies both filters" }; @@ -121,8 +120,8 @@ public void DerivedMetricPerformsLogicalConnectionsBetweenFiltersCorrectly() new FilterConjunctionGroupInfo(new[] { filterInfoApple, filterInfoOrange }) }, projection: "Name", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetryThatMustPass1 = new RequestTelemetry() { Name = "Both the words 'dog' and 'CAT' are here, which satisfies the first OR." }; @@ -167,8 +166,8 @@ public void DerivedMetricProjectsCorrectly() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "Id", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetry = new DocumentMock() { Name = "1.23", Id = "5.67" }; @@ -179,7 +178,7 @@ public void DerivedMetricProjectsCorrectly() double projection = metric.Project(telemetry); // ASSERT - Assert.Equal(Models.AggregationType.Sum, metric.AggregationType); + Assert.Equal(AggregationType.Sum, metric.AggregationType); Assert.Empty(errors); Assert.Equal(5.67d, projection); } @@ -193,8 +192,8 @@ public void DerivedMetricProjectsCorrectlyWhenCustomDimension() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "CustomDimensions.Dimension1", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetry = new DocumentMock(new List() { new("Dimension.1", "1.5") }); @@ -205,7 +204,7 @@ public void DerivedMetricProjectsCorrectlyWhenCustomDimension() double projection = metric.Project(telemetry); // ASSERT - Assert.Equal(Models.AggregationType.Sum, metric.AggregationType); + Assert.Equal(AggregationType.Sum, metric.AggregationType); Assert.Empty(errors); Assert.Equal(1.5d, projection); } @@ -219,8 +218,8 @@ public void DerivedMetricProjectsCorrectlyWhenCustomMetric() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "CustomMetrics.Metric1", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetry = new DocumentMock() { Metrics = { ["Metric1"] = 1.75d } }; @@ -231,7 +230,7 @@ public void DerivedMetricProjectsCorrectlyWhenCustomMetric() double projection = metric.Project(telemetry); // ASSERT - Assert.Equal(Models.AggregationType.Sum, metric.AggregationType); + Assert.Equal(AggregationType.Sum, metric.AggregationType); Assert.Empty(errors); Assert.Equal(1.75d, projection); } @@ -245,8 +244,8 @@ public void DerivedMetricProjectsCorrectlyWhenCount() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "COUNT()", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetry = new RequestTelemetry(); @@ -257,7 +256,7 @@ public void DerivedMetricProjectsCorrectlyWhenCount() double projection = metric.Project(telemetry); // ASSERT - Assert.Equal(Models.AggregationType.Sum, metric.AggregationType); + Assert.Equal(AggregationType.Sum, metric.AggregationType); Assert.Empty(errors); Assert.Equal(1d, projection); } @@ -271,8 +270,8 @@ public void DerivedMetricProjectsCorrectlyWhenTimeSpan() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "Duration", - aggregation: Models.AggregationType.Avg, - backEndAggregation: Models.AggregationType.Avg + aggregation: AggregationType.Avg, + backEndAggregation: AggregationType.Avg ); var telemetry = new DocumentMock() { Duration = TimeSpan.FromMilliseconds(120) }; @@ -283,7 +282,7 @@ public void DerivedMetricProjectsCorrectlyWhenTimeSpan() double projection = metric.Project(telemetry); // ASSERT - Assert.Equal(Models.AggregationType.Avg, metric.AggregationType); + Assert.Equal(AggregationType.Avg, metric.AggregationType); Assert.Empty(errors); Assert.Equal(120, projection); } @@ -298,7 +297,7 @@ public void DerivedMetricProjectsCorrectlyWhenDurationIsString() filterGroups: new FilterConjunctionGroupInfo[0], projection: "Duration", aggregation: AggregationType.Avg, - backEndAggregation: Models.AggregationType.Avg + backEndAggregation: AggregationType.Avg ); var durationString = TimeSpan.FromMilliseconds(120).ToString(); @@ -326,8 +325,8 @@ public void DerivedMetricReportsErrorsForInvalidFilters() telemetryType: TelemetryType.Request.ToString(), filterGroups: new[] { new FilterConjunctionGroupInfo(new[] { filterInfo1, filterInfo2 }) }, projection: "Name", - aggregation: Models.AggregationType.Avg, - backEndAggregation: Models.AggregationType.Avg + aggregation: AggregationType.Avg, + backEndAggregation: AggregationType.Avg ); // ACT @@ -363,8 +362,8 @@ public void DerivedMetricThrowsWhenInvalidProjection() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "NonExistentFieldName", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); // ACT, ASSERT @@ -381,8 +380,8 @@ public void DerivedMetricReportsErrorWhenProjectionIsNotDouble() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "Id", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); var telemetry = new DocumentMock() { Id = "NotDoubleValue" }; @@ -414,8 +413,8 @@ public void DerivedMetricReportsErrorWhenProjectionIsAsterisk() telemetryType: TelemetryType.Request.ToString(), filterGroups: new FilterConjunctionGroupInfo[0], projection: "*", - aggregation: Models.AggregationType.Sum, - backEndAggregation: Models.AggregationType.Sum + aggregation: AggregationType.Sum, + backEndAggregation: AggregationType.Sum ); // ACT, ASSERT diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.net6.0.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.net6.0.cs index 43332b65beaf..5ce7a8e922bf 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.net6.0.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.net6.0.cs @@ -1,3 +1,15 @@ +namespace Azure.Monitor.OpenTelemetry.Events +{ + public sealed partial class ApplicationInsightsEventLogger : Azure.Monitor.OpenTelemetry.Events.IApplicationInsightsEventLogger + { + public ApplicationInsightsEventLogger(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) { } + public void TrackEvent(string name, System.Collections.Generic.IReadOnlyList>? attributes = null) { } + } + public partial interface IApplicationInsightsEventLogger + { + void TrackEvent(string name, System.Collections.Generic.IReadOnlyList>? attributes = null); + } +} namespace Azure.Monitor.OpenTelemetry.Exporter { public static partial class AzureMonitorExporterExtensions diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.netstandard2.0.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.netstandard2.0.cs index 43332b65beaf..5ce7a8e922bf 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.netstandard2.0.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/api/Azure.Monitor.OpenTelemetry.Exporter.netstandard2.0.cs @@ -1,3 +1,15 @@ +namespace Azure.Monitor.OpenTelemetry.Events +{ + public sealed partial class ApplicationInsightsEventLogger : Azure.Monitor.OpenTelemetry.Events.IApplicationInsightsEventLogger + { + public ApplicationInsightsEventLogger(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) { } + public void TrackEvent(string name, System.Collections.Generic.IReadOnlyList>? attributes = null) { } + } + public partial interface IApplicationInsightsEventLogger + { + void TrackEvent(string name, System.Collections.Generic.IReadOnlyList>? attributes = null); + } +} namespace Azure.Monitor.OpenTelemetry.Exporter { public static partial class AzureMonitorExporterExtensions diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/ApplicationInsightsEventLogger.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/ApplicationInsightsEventLogger.cs new file mode 100644 index 000000000000..26bb5164f088 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/ApplicationInsightsEventLogger.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using Microsoft.Extensions.Logging; + +namespace Azure.Monitor.OpenTelemetry.Events +{ + /// + /// Default logger for logging Application Insights custom events. + /// + public sealed class ApplicationInsightsEventLogger : IApplicationInsightsEventLogger + { + private const string EventLoggerName = "Azure.Monitor.OpenTelemetry.CustomEvents"; + private static readonly Func>?, Exception?, string> s_formatter = (state, ex) => + { + return "Application Insights Custom Event"; + }; + + private readonly ILogger _logger; + + /// + /// Creates an instance of CustomEventLogger to log custom events. + /// + /// LoggerFactory instance for logging events. + /// + public ApplicationInsightsEventLogger(ILoggerFactory loggerFactory) + { + if (loggerFactory == null) + throw new ArgumentNullException(nameof(loggerFactory)); + + _logger = loggerFactory.CreateLogger(EventLoggerName); + } + + // TODO: Follow up to check if nullables are ok. + /// + public void TrackEvent(string name, IReadOnlyList>? attributes = null) + { + _logger.Log(LogLevel.Information, eventId: new EventId(1, name), attributes, exception: null, formatter: s_formatter); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/IApplicationInsightsEventLogger.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/IApplicationInsightsEventLogger.cs new file mode 100644 index 000000000000..85be24b791e5 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/CustomEvents/IApplicationInsightsEventLogger.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.Events +{ + /// + /// An interface for logging custom events telemetry. + /// + public interface IApplicationInsightsEventLogger + { + /// + /// Tracks Application Insights custom events. + /// + /// Name of the CustomEvent. + /// Custom dimensions of the event. + public void TrackEvent(string name, IReadOnlyList>? attributes = null); + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryEventData.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryEventData.cs new file mode 100644 index 000000000000..8c2a632ebeef --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryEventData.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using OpenTelemetry.Logs; + +namespace Azure.Monitor.OpenTelemetry.Exporter.Models +{ + internal partial class TelemetryEventData + { + public TelemetryEventData(int version, LogRecord logRecord) : base(version) + { + Properties = new ChangeTrackingDictionary(); + Measurements = new ChangeTrackingDictionary(); + + Name = logRecord.EventId.Name; + + if (logRecord.Attributes != null) + { + foreach (var kv in logRecord.Attributes) + { + Properties.Add(kv.Key, kv.Value?.ToString()); + } + } + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryItem.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryItem.cs index e6fadd8f6986..c02c464f0b9b 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryItem.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Customizations/Models/TelemetryItem.cs @@ -91,8 +91,8 @@ public TelemetryItem(string name, TelemetryItem telemetryItem, ActivitySpanId ac } } - public TelemetryItem (LogRecord logRecord, AzureMonitorResource? resource, string instrumentationKey) : - this(logRecord.Exception != null ? "Exception" : "Message", FormatUtcTimestamp(logRecord.Timestamp)) + public TelemetryItem (string name, LogRecord logRecord, AzureMonitorResource? resource, string instrumentationKey) : + this(name, FormatUtcTimestamp(logRecord.Timestamp)) { if (logRecord.TraceId != default) { diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/LogsHelper.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/LogsHelper.cs index 26b05b6e7bec..927837c9e6d5 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/LogsHelper.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/src/Internals/LogsHelper.cs @@ -56,17 +56,27 @@ internal static List OtelToAzureMonitorLogs(Batch batc { try { - telemetryItem = new TelemetryItem(logRecord, resource, instrumentationKey); if (logRecord.Exception != null) { + telemetryItem = new TelemetryItem("Exception", logRecord, resource, instrumentationKey); telemetryItem.Data = new MonitorBase { BaseType = "ExceptionData", BaseData = new TelemetryExceptionData(Version, logRecord), }; } + else if (logRecord.CategoryName == "Azure.Monitor.OpenTelemetry.CustomEvents") + { + telemetryItem = new TelemetryItem("Event", logRecord, resource, instrumentationKey); + telemetryItem.Data = new MonitorBase + { + BaseType = "EventData", + BaseData = new TelemetryEventData(Version, logRecord), + }; + } else { + telemetryItem = new TelemetryItem("Message", logRecord, resource, instrumentationKey); telemetryItem.Data = new MonitorBase { BaseType = "MessageData", diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/CommonTestFramework/TelemetryItemOutputHelper.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/CommonTestFramework/TelemetryItemOutputHelper.cs index 1d00594ee09e..d8adb65abbab 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/CommonTestFramework/TelemetryItemOutputHelper.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/CommonTestFramework/TelemetryItemOutputHelper.cs @@ -70,12 +70,26 @@ private void WriteBaseData(TelemetryItem telemetryItem) case "ExceptionData": WriteExceptionData((TelemetryExceptionData)baseData); break; + case "EventData": + WriteEventData((TelemetryEventData)baseData); + break; default: output.WriteLine($"***WriteBaseData not implemented for '{baseType}'***"); break; } } + private void WriteEventData(TelemetryEventData eventData) + { + output.WriteLine($"Name: {eventData.Name}"); + + output.WriteLine($"Properties: {eventData.Properties.Count}"); + foreach (var prop in eventData.Properties) + { + output.WriteLine($"\t{prop.Key}: {prop.Value}"); + } + } + private void WriteExceptionData(TelemetryExceptionData exceptionData) { output.WriteLine($"SeverityLevel: {exceptionData.SeverityLevel}"); diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/LogsHelperTests.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/LogsHelperTests.cs index 87bbbc96535e..861b2b5c5787 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/LogsHelperTests.cs +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter/tests/Azure.Monitor.OpenTelemetry.Exporter.Tests/LogsHelperTests.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using Azure.Core; +using Azure.Monitor.OpenTelemetry.Events; using Azure.Monitor.OpenTelemetry.Exporter.Internals; using Azure.Monitor.OpenTelemetry.Exporter.Models; @@ -544,6 +545,45 @@ public void DuplicateKeysInLogRecordAttributesAndLogScope2() Assert.Equal(duplicateScopeValue2, actualScopeValue); } + [Fact] + public void ValidateCustomEvent() + { + // Arrange. + var logRecords = new List(1); + using var loggerFactory = LoggerFactory.Create(builder => + { + builder.AddOpenTelemetry(options => + { + options.AddInMemoryExporter(logRecords); + }); + }); + + var eventLogger = new ApplicationInsightsEventLogger(loggerFactory); + + var attributesList = new List> + { + new KeyValuePair("customEventKey", "customEventValue") + }; + + eventLogger.TrackEvent("MyCustomEvent", attributesList); + + // Assert. + var logRecord = logRecords.Single(); + var logRecodBatch = new Batch(new[] { logRecord } , 1); + var properties = new ChangeTrackingDictionary(); + var telemetryItems = LogsHelper.OtelToAzureMonitorLogs(logRecodBatch, null, "Ikey"); + + var telemetryItem = telemetryItems.FirstOrDefault(); + var telemetryEventData = telemetryItem?.Data.BaseData as TelemetryEventData; + + Assert.NotNull(telemetryEventData); + Assert.Equal("MyCustomEvent", telemetryEventData.Name); + Assert.Single(telemetryEventData.Properties); + var property = telemetryEventData.Properties.Single(); + Assert.Equal("customEventKey", property.Key); + Assert.Equal("customEventValue", property.Value); + } + private class CustomObject { public override string ToString() diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/README.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/README.md new file mode 100644 index 000000000000..d9d54bb38a7f --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/README.md @@ -0,0 +1,8 @@ +# Azure Monitor OpenTelemetry LiveMetrics code sharing library + +This library is intended to serve as a common location for non-public code for the [Live Metrics](https://learn.microsoft.com/azure/azure-monitor/app/live-stream) REST API. +The [Azure Monitor OpenTelemetry Exporter](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/monitor/Azure.Monitor.OpenTelemetry.Exporter) includes these artifacts by shared links to enable them to be loosely hosted within those projects rather than consumed by direct project or package reference. + +## Contributing + +See [CONTRIBUTING.md](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for details on contribution process. diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj new file mode 100644 index 000000000000..c0e7b47e567f --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Azure.Monitor.OpenTelemetry.LiveMetrics.csproj @@ -0,0 +1,16 @@ + + + + Azure.Monitor.OpenTelemetry.Exporter shared code library + 1.0.0 + $(RequiredTargetFrameworks) + false + true + + + + + + + + diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Argument.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..05b2583ac62a --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..2ccd52fb2fc7 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingList.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..d3d310bb63c1 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..a8139122f57d --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value) + { + writer.WriteObjectValue(value); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/MultipartFormDataRequestContent.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/MultipartFormDataRequestContent.cs new file mode 100644 index 000000000000..6246a4304cb2 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/MultipartFormDataRequestContent.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.IO; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal class MultipartFormDataRequestContent : RequestContent + { + private readonly System.Net.Http.MultipartFormDataContent _multipartContent; + private static readonly Random _random = new Random(); + private static readonly char[] _boundaryValues = "0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".ToCharArray(); + + public MultipartFormDataRequestContent() + { + _multipartContent = new System.Net.Http.MultipartFormDataContent(CreateBoundary()); + } + + public string ContentType + { + get + { + return _multipartContent.Headers.ContentType.ToString(); + } + } + + internal HttpContent HttpContent => _multipartContent; + + private static string CreateBoundary() + { + Span chars = new char[70]; + byte[] random = new byte[70]; + _random.NextBytes(random); + int mask = 255 >> 2; + for (int i = 0; i < 70; i++) + { + chars[i] = _boundaryValues[random[i] & mask]; + } + return chars.ToString(); + } + + public void Add(string content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + Add(new StringContent(content), name, filename, contentType); + } + + public void Add(int content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content.ToString("G", CultureInfo.InvariantCulture); + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(long content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content.ToString("G", CultureInfo.InvariantCulture); + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(float content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content.ToString("G", CultureInfo.InvariantCulture); + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(double content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content.ToString("G", CultureInfo.InvariantCulture); + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(decimal content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content.ToString("G", CultureInfo.InvariantCulture); + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(bool content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + string value = content ? "true" : "false"; + Add(new StringContent(value), name, filename, contentType); + } + + public void Add(Stream content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + Add(new StreamContent(content), name, filename, contentType); + } + + public void Add(byte[] content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + Add(new ByteArrayContent(content), name, filename, contentType); + } + + public void Add(BinaryData content, string name, string filename = null, string contentType = null) + { + Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + Add(new ByteArrayContent(content.ToArray()), name, filename, contentType); + } + + private void Add(HttpContent content, string name, string filename, string contentType) + { + if (filename != null) + { + Argument.AssertNotNullOrEmpty(filename, nameof(filename)); + AddFilenameHeader(content, name, filename); + } + if (contentType != null) + { + Argument.AssertNotNullOrEmpty(contentType, nameof(contentType)); + AddContentTypeHeader(content, contentType); + } + _multipartContent.Add(content, name); + } + + public static void AddFilenameHeader(HttpContent content, string name, string filename) + { + ContentDispositionHeaderValue header = new ContentDispositionHeaderValue("form-data") { Name = name, FileName = filename }; + content.Headers.ContentDisposition = header; + } + + public static void AddContentTypeHeader(HttpContent content, string contentType) + { + MediaTypeHeaderValue header = new MediaTypeHeaderValue(contentType); + content.Headers.ContentType = header; + } + + public override bool TryComputeLength(out long length) + { + if (_multipartContent.Headers.ContentLength is long contentLength) + { + length = contentLength; + return true; + } + length = 0; + return false; + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { +#if NET6_0_OR_GREATER + _multipartContent.CopyTo(stream, default, cancellationToken); +#else +#pragma warning disable AZC0107 + _multipartContent.CopyToAsync(stream).EnsureCompleted(); +#pragma warning restore AZC0107 +#endif + } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { +#if NET6_0_OR_GREATER + await _multipartContent.CopyToAsync(stream, cancellationToken).ConfigureAwait(false); +#else + await _multipartContent.CopyToAsync(stream).ConfigureAwait(false); +#endif + } + + public override void Dispose() + { + _multipartContent.Dispose(); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Optional.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..7a820ce70c4f --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/RequestContentHelper.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/RequestContentHelper.cs new file mode 100644 index 000000000000..c4ecf95c18da --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/RequestContentHelper.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal static class RequestContentHelper + { + public static RequestContent FromEnumerable(IEnumerable enumerable) + where T : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + content.JsonWriter.WriteObjectValue(item); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromEnumerable(IEnumerable enumerable) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in enumerable) + { + if (item == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item); +#else + using (JsonDocument document = JsonDocument.Parse(item)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromEnumerable(ReadOnlySpan span) + where T : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + for (int i = 0; i < span.Length; i++) + { + content.JsonWriter.WriteObjectValue(span[i]); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + + public static RequestContent FromDictionary(IDictionary dictionary) + where TValue : notnull + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + content.JsonWriter.WriteObjectValue(item.Value); + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + public static RequestContent FromDictionary(IDictionary dictionary) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartObject(); + foreach (var item in dictionary) + { + content.JsonWriter.WritePropertyName(item.Key); + if (item.Value == null) + { + content.JsonWriter.WriteNullValue(); + } + else + { +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + } + } + content.JsonWriter.WriteEndObject(); + + return content; + } + + public static RequestContent FromObject(object value) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(value); + return content; + } + + public static RequestContent FromObject(BinaryData value) + { + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); +#if NET6_0_OR_GREATER + content.JsonWriter.WriteRawValue(value); +#else + using (JsonDocument document = JsonDocument.Parse(value)) + { + JsonSerializer.Serialize(content.JsonWriter, document.RootElement); + } +#endif + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..34342d231645 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders.cs new file mode 100644 index 000000000000..606061137473 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal partial class LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders + { + private readonly Response _response; + public LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders(Response response) + { + _response = response; + } + /// An encoded string that indicates whether the collection configuration is changed. + public string XMsQpsConfigurationEtag => _response.Headers.TryGetValue("x-ms-qps-configuration-etag", out string value) ? value : null; + /// Contains a URI of the service endpoint that the client must permanently use for the particular resource. This header exists only when the client is talking to Live Metrics global endpoint. + public string XMsQpsServiceEndpointRedirectV2 => _response.Headers.TryGetValue("x-ms-qps-service-endpoint-redirect-v2", out string value) ? value : null; + /// Recommended time (in milliseconds) before the client should ping the service again. This header exists only when the instrumentation key is not subscribed to. + public string XMsQpsServicePollingIntervalHint => _response.Headers.TryGetValue("x-ms-qps-service-polling-interval-hint", out string value) ? value : null; + /// A boolean flag indicating whether there are active user sessions 'watching' the instrumentation key. If true, the client must start collecting data and posting it to Live Metrics. Otherwise, the client must keep pinging. + public string XMsQpsSubscribed => _response.Headers.TryGetValue("x-ms-qps-subscribed", out string value) ? value : null; + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsPublishHeaders.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsPublishHeaders.cs new file mode 100644 index 000000000000..70151eb29ffc --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsPublishHeaders.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal partial class LiveMetricsRestAPIsForClientSDKsPublishHeaders + { + private readonly Response _response; + public LiveMetricsRestAPIsForClientSDKsPublishHeaders(Response response) + { + _response = response; + } + /// An encoded string that indicates whether the collection configuration is changed. + public string XMsQpsConfigurationEtag => _response.Headers.TryGetValue("x-ms-qps-configuration-etag", out string value) ? value : null; + /// Tells the client whether the input instrumentation key is subscribed to. + public string XMsQpsSubscribed => _response.Headers.TryGetValue("x-ms-qps-subscribed", out string value) ? value : null; + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsRestClient.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsRestClient.cs new file mode 100644 index 000000000000..749796cc365f --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/LiveMetricsRestAPIsForClientSDKsRestClient.cs @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.Monitor.OpenTelemetry.LiveMetrics.Models; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics +{ + internal partial class LiveMetricsRestAPIsForClientSDKsRestClient + { + private readonly HttpPipeline _pipeline; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// Initializes a new instance of LiveMetricsRestAPIsForClientSDKsRestClient. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Api Version. + /// , or is null. + public LiveMetricsRestAPIsForClientSDKsRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string apiVersion = "2024-04-01-preview") + { + ClientDiagnostics = clientDiagnostics ?? throw new ArgumentNullException(nameof(clientDiagnostics)); + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _apiVersion = apiVersion ?? throw new ArgumentNullException(nameof(apiVersion)); + } + + internal HttpMessage CreateIsSubscribedRequest(string endpoint, string ikey, long? transmissionTime, string machineName, string instanceName, string streamId, string roleName, string invariantVersion, string configurationEtag, MonitoringDataPoint monitoringDataPoint) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, true); + uri.AppendPath("/QuickPulseService.svc/ping", false); + uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendQuery("ikey", ikey, true); + request.Uri = uri; + if (transmissionTime != null) + { + request.Headers.Add("x-ms-qps-transmission-time", transmissionTime.Value); + } + if (machineName != null) + { + request.Headers.Add("x-ms-qps-machine-name", machineName); + } + if (instanceName != null) + { + request.Headers.Add("x-ms-qps-instance-name", instanceName); + } + if (streamId != null) + { + request.Headers.Add("x-ms-qps-stream-id", streamId); + } + if (roleName != null) + { + request.Headers.Add("x-ms-qps-role-name", roleName); + } + if (invariantVersion != null) + { + request.Headers.Add("x-ms-qps-invariant-version", invariantVersion); + } + if (configurationEtag != null) + { + request.Headers.Add("x-ms-qps-configuration-etag", configurationEtag); + } + request.Headers.Add("Accept", "application/json"); + if (monitoringDataPoint != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(monitoringDataPoint); + request.Content = content; + } + return message; + } + + /// Determine whether there is any subscription to the metrics and documents. + /// The endpoint of the Live Metrics service. The default value is "https://global.livediagnostics.monitor.azure.com". + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// Computer name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Service instance name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Identifies an Application Insights SDK as trusted agent to report metrics and documents. + /// Cloud role name of the service. + /// Version/generation of the data contract (MonitoringDataPoint) between the client and Live Metrics. + /// An encoded string that indicates whether the collection configuration is changed. + /// Data contract between Application Insights client SDK and Live Metrics. /QuickPulseService.svc/ping uses this as a backup source of machine name, instance name and invariant version. + /// The cancellation token to use. + /// or is null. + public async Task> IsSubscribedAsync(string endpoint, string ikey, long? transmissionTime = null, string machineName = null, string instanceName = null, string streamId = null, string roleName = null, string invariantVersion = null, string configurationEtag = null, MonitoringDataPoint monitoringDataPoint = null, CancellationToken cancellationToken = default) + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (ikey == null) + { + throw new ArgumentNullException(nameof(ikey)); + } + + using var message = CreateIsSubscribedRequest(endpoint, ikey, transmissionTime, machineName, instanceName, streamId, roleName, invariantVersion, configurationEtag, monitoringDataPoint); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + CollectionConfigurationInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CollectionConfigurationInfo.DeserializeCollectionConfigurationInfo(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Determine whether there is any subscription to the metrics and documents. + /// The endpoint of the Live Metrics service. The default value is "https://global.livediagnostics.monitor.azure.com". + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// Computer name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Service instance name where Application Insights SDK lives. Live Metrics uses machine name with instance name as a backup. + /// Identifies an Application Insights SDK as trusted agent to report metrics and documents. + /// Cloud role name of the service. + /// Version/generation of the data contract (MonitoringDataPoint) between the client and Live Metrics. + /// An encoded string that indicates whether the collection configuration is changed. + /// Data contract between Application Insights client SDK and Live Metrics. /QuickPulseService.svc/ping uses this as a backup source of machine name, instance name and invariant version. + /// The cancellation token to use. + /// or is null. + public ResponseWithHeaders IsSubscribed(string endpoint, string ikey, long? transmissionTime = null, string machineName = null, string instanceName = null, string streamId = null, string roleName = null, string invariantVersion = null, string configurationEtag = null, MonitoringDataPoint monitoringDataPoint = null, CancellationToken cancellationToken = default) + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (ikey == null) + { + throw new ArgumentNullException(nameof(ikey)); + } + + using var message = CreateIsSubscribedRequest(endpoint, ikey, transmissionTime, machineName, instanceName, streamId, roleName, invariantVersion, configurationEtag, monitoringDataPoint); + _pipeline.Send(message, cancellationToken); + var headers = new LiveMetricsRestAPIsForClientSDKsIsSubscribedHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + CollectionConfigurationInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CollectionConfigurationInfo.DeserializeCollectionConfigurationInfo(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreatePublishRequest(string endpoint, string ikey, string configurationEtag, long? transmissionTime, IEnumerable monitoringDataPoints) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.AppendRaw(endpoint, true); + uri.AppendPath("/QuickPulseService.svc/post", false); + uri.AppendQuery("api-version", _apiVersion, true); + uri.AppendQuery("ikey", ikey, true); + request.Uri = uri; + if (configurationEtag != null) + { + request.Headers.Add("x-ms-qps-configuration-etag", configurationEtag); + } + if (transmissionTime != null) + { + request.Headers.Add("x-ms-qps-transmission-time", transmissionTime.Value); + } + request.Headers.Add("Accept", "application/json"); + if (monitoringDataPoints != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteStartArray(); + foreach (var item in monitoringDataPoints) + { + content.JsonWriter.WriteObjectValue(item); + } + content.JsonWriter.WriteEndArray(); + request.Content = content; + } + return message; + } + + /// Publish live metrics to the Live Metrics service when there is an active subscription to the metrics. + /// The endpoint of the Live Metrics service. The default value is "https://global.livediagnostics.monitor.azure.com". + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// An encoded string that indicates whether the collection configuration is changed. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// Data contract between the client and Live Metrics. /QuickPulseService.svc/ping uses this as a backup source of machine name, instance name and invariant version. + /// The cancellation token to use. + /// or is null. + public async Task> PublishAsync(string endpoint, string ikey, string configurationEtag = null, long? transmissionTime = null, IEnumerable monitoringDataPoints = null, CancellationToken cancellationToken = default) + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (ikey == null) + { + throw new ArgumentNullException(nameof(ikey)); + } + + using var message = CreatePublishRequest(endpoint, ikey, configurationEtag, transmissionTime, monitoringDataPoints); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + var headers = new LiveMetricsRestAPIsForClientSDKsPublishHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + CollectionConfigurationInfo value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CollectionConfigurationInfo.DeserializeCollectionConfigurationInfo(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Publish live metrics to the Live Metrics service when there is an active subscription to the metrics. + /// The endpoint of the Live Metrics service. The default value is "https://global.livediagnostics.monitor.azure.com". + /// The instrumentation key of the target Application Insights component for which the client checks whether there's any subscription to it. + /// An encoded string that indicates whether the collection configuration is changed. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. A 8-byte long type of ticks. + /// Data contract between the client and Live Metrics. /QuickPulseService.svc/ping uses this as a backup source of machine name, instance name and invariant version. + /// The cancellation token to use. + /// or is null. + public ResponseWithHeaders Publish(string endpoint, string ikey, string configurationEtag = null, long? transmissionTime = null, IEnumerable monitoringDataPoints = null, CancellationToken cancellationToken = default) + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (ikey == null) + { + throw new ArgumentNullException(nameof(ikey)); + } + + using var message = CreatePublishRequest(endpoint, ikey, configurationEtag, transmissionTime, monitoringDataPoints); + _pipeline.Send(message, cancellationToken); + var headers = new LiveMetricsRestAPIsForClientSDKsPublishHeaders(message.Response); + switch (message.Response.Status) + { + case 200: + { + CollectionConfigurationInfo value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CollectionConfigurationInfo.DeserializeCollectionConfigurationInfo(document.RootElement); + return ResponseWithHeaders.FromValue(value, headers, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/AggregationType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/AggregationType.cs new file mode 100644 index 000000000000..e5cc1d40f973 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/AggregationType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Aggregation type. + internal readonly partial struct AggregationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AggregationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AvgValue = "Avg"; + private const string SumValue = "Sum"; + private const string MinValue = "Min"; + private const string MaxValue = "Max"; + + /// Average. + public static AggregationType Avg { get; } = new AggregationType(AvgValue); + /// Sum. + public static AggregationType Sum { get; } = new AggregationType(SumValue); + /// Minimum. + public static AggregationType Min { get; } = new AggregationType(MinValue); + /// Maximum. + public static AggregationType Max { get; } = new AggregationType(MaxValue); + /// Determines if two values are the same. + public static bool operator ==(AggregationType left, AggregationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AggregationType left, AggregationType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator AggregationType(string value) => new AggregationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AggregationType other && Equals(other); + /// + public bool Equals(AggregationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.Serialization.cs new file mode 100644 index 000000000000..d7a4b9df2d17 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.Serialization.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class CollectionConfigurationError : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("CollectionConfigurationErrorType"u8); + writer.WriteStringValue(CollectionConfigurationErrorType.ToString()); + writer.WritePropertyName("Message"u8); + writer.WriteStringValue(Message); + writer.WritePropertyName("FullException"u8); + writer.WriteStringValue(FullException); + writer.WritePropertyName("Data"u8); + writer.WriteStartArray(); + foreach (var item in Data) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.cs new file mode 100644 index 000000000000..1e9cc01e4655 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationError.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Represents an error while SDK parses and applies an instance of CollectionConfigurationInfo. + internal partial class CollectionConfigurationError + { + /// Initializes a new instance of . + /// Error type. + /// Error message. + /// Exception that led to the creation of the configuration error. + /// Custom properties to add more information to the error. + /// , or is null. + public CollectionConfigurationError(CollectionConfigurationErrorType collectionConfigurationErrorType, string message, string fullException, IEnumerable data) + { + Argument.AssertNotNull(message, nameof(message)); + Argument.AssertNotNull(fullException, nameof(fullException)); + Argument.AssertNotNull(data, nameof(data)); + + CollectionConfigurationErrorType = collectionConfigurationErrorType; + Message = message; + FullException = fullException; + Data = data.ToList(); + } + + /// Initializes a new instance of . + /// Error type. + /// Error message. + /// Exception that led to the creation of the configuration error. + /// Custom properties to add more information to the error. + internal CollectionConfigurationError(CollectionConfigurationErrorType collectionConfigurationErrorType, string message, string fullException, IList data) + { + CollectionConfigurationErrorType = collectionConfigurationErrorType; + Message = message; + FullException = fullException; + Data = data; + } + + /// Error type. + public CollectionConfigurationErrorType CollectionConfigurationErrorType { get; } + /// Error message. + public string Message { get; } + /// Exception that led to the creation of the configuration error. + public string FullException { get; } + /// Custom properties to add more information to the error. + public IList Data { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationErrorType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationErrorType.cs new file mode 100644 index 000000000000..0b5853e2c56e --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationErrorType.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Collection configuration error type reported by the client SDK. + internal readonly partial struct CollectionConfigurationErrorType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CollectionConfigurationErrorType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string PerformanceCounterParsingValue = "PerformanceCounterParsing"; + private const string PerformanceCounterUnexpectedValue = "PerformanceCounterUnexpected"; + private const string PerformanceCounterDuplicateIdsValue = "PerformanceCounterDuplicateIds"; + private const string DocumentStreamDuplicateIdsValue = "DocumentStreamDuplicateIds"; + private const string DocumentStreamFailureToCreateValue = "DocumentStreamFailureToCreate"; + private const string DocumentStreamFailureToCreateFilterUnexpectedValue = "DocumentStreamFailureToCreateFilterUnexpected"; + private const string MetricDuplicateIdsValue = "MetricDuplicateIds"; + private const string MetricTelemetryTypeUnsupportedValue = "MetricTelemetryTypeUnsupported"; + private const string MetricFailureToCreateValue = "MetricFailureToCreate"; + private const string MetricFailureToCreateFilterUnexpectedValue = "MetricFailureToCreateFilterUnexpected"; + private const string FilterFailureToCreateUnexpectedValue = "FilterFailureToCreateUnexpected"; + private const string CollectionConfigurationFailureToCreateUnexpectedValue = "CollectionConfigurationFailureToCreateUnexpected"; + + /// Unknown error type. + public static CollectionConfigurationErrorType Unknown { get; } = new CollectionConfigurationErrorType(UnknownValue); + /// Performance counter parsing error. + public static CollectionConfigurationErrorType PerformanceCounterParsing { get; } = new CollectionConfigurationErrorType(PerformanceCounterParsingValue); + /// Performance counter unexpected error. + public static CollectionConfigurationErrorType PerformanceCounterUnexpected { get; } = new CollectionConfigurationErrorType(PerformanceCounterUnexpectedValue); + /// Performance counter duplicate ids. + public static CollectionConfigurationErrorType PerformanceCounterDuplicateIds { get; } = new CollectionConfigurationErrorType(PerformanceCounterDuplicateIdsValue); + /// Document stream duplication ids. + public static CollectionConfigurationErrorType DocumentStreamDuplicateIds { get; } = new CollectionConfigurationErrorType(DocumentStreamDuplicateIdsValue); + /// Document stream failed to create. + public static CollectionConfigurationErrorType DocumentStreamFailureToCreate { get; } = new CollectionConfigurationErrorType(DocumentStreamFailureToCreateValue); + /// Document stream failed to create filter unexpectedly. + public static CollectionConfigurationErrorType DocumentStreamFailureToCreateFilterUnexpected { get; } = new CollectionConfigurationErrorType(DocumentStreamFailureToCreateFilterUnexpectedValue); + /// Metric duplicate ids. + public static CollectionConfigurationErrorType MetricDuplicateIds { get; } = new CollectionConfigurationErrorType(MetricDuplicateIdsValue); + /// Metric telemetry type unsupported. + public static CollectionConfigurationErrorType MetricTelemetryTypeUnsupported { get; } = new CollectionConfigurationErrorType(MetricTelemetryTypeUnsupportedValue); + /// Metric failed to create. + public static CollectionConfigurationErrorType MetricFailureToCreate { get; } = new CollectionConfigurationErrorType(MetricFailureToCreateValue); + /// Metric failed to create filter unexpectedly. + public static CollectionConfigurationErrorType MetricFailureToCreateFilterUnexpected { get; } = new CollectionConfigurationErrorType(MetricFailureToCreateFilterUnexpectedValue); + /// Filter failed to create unexpectedly. + public static CollectionConfigurationErrorType FilterFailureToCreateUnexpected { get; } = new CollectionConfigurationErrorType(FilterFailureToCreateUnexpectedValue); + /// Collection configuration failed to create unexpectedly. + public static CollectionConfigurationErrorType CollectionConfigurationFailureToCreateUnexpected { get; } = new CollectionConfigurationErrorType(CollectionConfigurationFailureToCreateUnexpectedValue); + /// Determines if two values are the same. + public static bool operator ==(CollectionConfigurationErrorType left, CollectionConfigurationErrorType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CollectionConfigurationErrorType left, CollectionConfigurationErrorType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CollectionConfigurationErrorType(string value) => new CollectionConfigurationErrorType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CollectionConfigurationErrorType other && Equals(other); + /// + public bool Equals(CollectionConfigurationErrorType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.Serialization.cs new file mode 100644 index 000000000000..160706521a0b --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.Serialization.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class CollectionConfigurationInfo + { + internal static CollectionConfigurationInfo DeserializeCollectionConfigurationInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string eTag = default; + IReadOnlyList metrics = default; + IReadOnlyList documentStreams = default; + QuotaConfigurationInfo quotaInfo = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ETag"u8)) + { + eTag = property.Value.GetString(); + continue; + } + if (property.NameEquals("Metrics"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DerivedMetricInfo.DeserializeDerivedMetricInfo(item)); + } + metrics = array; + continue; + } + if (property.NameEquals("DocumentStreams"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentStreamInfo.DeserializeDocumentStreamInfo(item)); + } + documentStreams = array; + continue; + } + if (property.NameEquals("QuotaInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + quotaInfo = QuotaConfigurationInfo.DeserializeQuotaConfigurationInfo(property.Value); + continue; + } + } + return new CollectionConfigurationInfo(eTag, metrics, documentStreams, quotaInfo); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CollectionConfigurationInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCollectionConfigurationInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.cs new file mode 100644 index 000000000000..866535b02f43 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/CollectionConfigurationInfo.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Represents the collection configuration - a customizable description of performance counters, metrics, and full telemetry documents to be collected by the client SDK. + internal partial class CollectionConfigurationInfo + { + /// Initializes a new instance of . + /// An encoded string that indicates whether the collection configuration is changed. + /// An array of metric configuration info. + /// An array of document stream configuration info. + /// , or is null. + internal CollectionConfigurationInfo(string eTag, IEnumerable metrics, IEnumerable documentStreams) + { + Argument.AssertNotNull(eTag, nameof(eTag)); + Argument.AssertNotNull(metrics, nameof(metrics)); + Argument.AssertNotNull(documentStreams, nameof(documentStreams)); + + ETag = eTag; + Metrics = metrics.ToList(); + DocumentStreams = documentStreams.ToList(); + } + + /// Initializes a new instance of . + /// An encoded string that indicates whether the collection configuration is changed. + /// An array of metric configuration info. + /// An array of document stream configuration info. + /// Controls document quotas to be sent to Live Metrics. + internal CollectionConfigurationInfo(string eTag, IReadOnlyList metrics, IReadOnlyList documentStreams, QuotaConfigurationInfo quotaInfo) + { + ETag = eTag; + Metrics = metrics; + DocumentStreams = documentStreams; + QuotaInfo = quotaInfo; + } + + /// An encoded string that indicates whether the collection configuration is changed. + public string ETag { get; } + /// An array of metric configuration info. + public IReadOnlyList Metrics { get; } + /// An array of document stream configuration info. + public IReadOnlyList DocumentStreams { get; } + /// Controls document quotas to be sent to Live Metrics. + public QuotaConfigurationInfo QuotaInfo { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.Serialization.cs new file mode 100644 index 000000000000..9101bf764e5d --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.Serialization.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class DerivedMetricInfo + { + internal static DerivedMetricInfo DeserializeDerivedMetricInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string telemetryType = default; + IReadOnlyList filterGroups = default; + string projection = default; + AggregationType aggregation = default; + AggregationType backEndAggregation = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("TelemetryType"u8)) + { + telemetryType = property.Value.GetString(); + continue; + } + if (property.NameEquals("FilterGroups"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FilterConjunctionGroupInfo.DeserializeFilterConjunctionGroupInfo(item)); + } + filterGroups = array; + continue; + } + if (property.NameEquals("Projection"u8)) + { + projection = property.Value.GetString(); + continue; + } + if (property.NameEquals("Aggregation"u8)) + { + aggregation = new AggregationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("BackEndAggregation"u8)) + { + backEndAggregation = new AggregationType(property.Value.GetString()); + continue; + } + } + return new DerivedMetricInfo( + id, + telemetryType, + filterGroups, + projection, + aggregation, + backEndAggregation); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DerivedMetricInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDerivedMetricInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.cs new file mode 100644 index 000000000000..fc89e7d1c05f --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DerivedMetricInfo.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// A metric configuration set by UX to scope the metrics it's interested in. + internal partial class DerivedMetricInfo + { + /// Initializes a new instance of . + /// metric configuration identifier. + /// Telemetry type. + /// A collection of filters to scope metrics that UX needs. + /// Telemetry's metric dimension whose value is to be aggregated. Example values: Duration, Count(),... + /// Aggregation type. This is the aggregation done from everything within a single server. + /// Aggregation type. This Aggregation is done across the values for all the servers taken together. + /// , , or is null. + internal DerivedMetricInfo(string id, string telemetryType, IEnumerable filterGroups, string projection, AggregationType aggregation, AggregationType backEndAggregation) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(telemetryType, nameof(telemetryType)); + Argument.AssertNotNull(filterGroups, nameof(filterGroups)); + Argument.AssertNotNull(projection, nameof(projection)); + + Id = id; + TelemetryType = telemetryType; + FilterGroups = filterGroups.ToList(); + Projection = projection; + Aggregation = aggregation; + BackEndAggregation = backEndAggregation; + } + + /// Initializes a new instance of . + /// metric configuration identifier. + /// Telemetry type. + /// A collection of filters to scope metrics that UX needs. + /// Telemetry's metric dimension whose value is to be aggregated. Example values: Duration, Count(),... + /// Aggregation type. This is the aggregation done from everything within a single server. + /// Aggregation type. This Aggregation is done across the values for all the servers taken together. + internal DerivedMetricInfo(string id, string telemetryType, IReadOnlyList filterGroups, string projection, AggregationType aggregation, AggregationType backEndAggregation) + { + Id = id; + TelemetryType = telemetryType; + FilterGroups = filterGroups; + Projection = projection; + Aggregation = aggregation; + BackEndAggregation = backEndAggregation; + } + + /// metric configuration identifier. + public string Id { get; } + /// Telemetry type. + public string TelemetryType { get; } + /// A collection of filters to scope metrics that UX needs. + public IReadOnlyList FilterGroups { get; } + /// Telemetry's metric dimension whose value is to be aggregated. Example values: Duration, Count(),... + public string Projection { get; } + /// Aggregation type. This is the aggregation done from everything within a single server. + public AggregationType Aggregation { get; } + /// Aggregation type. This Aggregation is done across the values for all the servers taken together. + public AggregationType BackEndAggregation { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.Serialization.cs new file mode 100644 index 000000000000..25f595b4111e --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class DocumentFilterConjunctionGroupInfo + { + internal static DocumentFilterConjunctionGroupInfo DeserializeDocumentFilterConjunctionGroupInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TelemetryType telemetryType = default; + FilterConjunctionGroupInfo filters = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("TelemetryType"u8)) + { + telemetryType = new TelemetryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("Filters"u8)) + { + filters = FilterConjunctionGroupInfo.DeserializeFilterConjunctionGroupInfo(property.Value); + continue; + } + } + return new DocumentFilterConjunctionGroupInfo(telemetryType, filters); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentFilterConjunctionGroupInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentFilterConjunctionGroupInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.cs new file mode 100644 index 000000000000..d61bb6965321 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentFilterConjunctionGroupInfo.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// A collection of filters for a specific telemetry type. + internal partial class DocumentFilterConjunctionGroupInfo + { + /// Initializes a new instance of . + /// Telemetry type. + /// An array of filter groups. + /// is null. + internal DocumentFilterConjunctionGroupInfo(TelemetryType telemetryType, FilterConjunctionGroupInfo filters) + { + Argument.AssertNotNull(filters, nameof(filters)); + + TelemetryType = telemetryType; + Filters = filters; + } + + /// Telemetry type. + public TelemetryType TelemetryType { get; } + /// An array of filter groups. + public FilterConjunctionGroupInfo Filters { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.Serialization.cs new file mode 100644 index 000000000000..cde93f504bc3 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class DocumentIngress : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("DocumentType"u8); + writer.WriteStringValue(DocumentType.ToString()); + if (Optional.IsCollectionDefined(DocumentStreamIds)) + { + writer.WritePropertyName("DocumentStreamIds"u8); + writer.WriteStartArray(); + foreach (var item in DocumentStreamIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("Properties"u8); + writer.WriteStartArray(); + foreach (var item in Properties) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.cs new file mode 100644 index 000000000000..2514fbf02f8e --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentIngress.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// + /// Base class of the specific document types. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + internal abstract partial class DocumentIngress + { + /// Initializes a new instance of . + protected DocumentIngress() + { + DocumentStreamIds = new ChangeTrackingList(); + Properties = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + internal DocumentIngress(DocumentType documentType, IList documentStreamIds, IList properties) + { + DocumentType = documentType; + DocumentStreamIds = documentStreamIds; + Properties = properties; + } + + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + internal DocumentType DocumentType { get; set; } + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + public IList DocumentStreamIds { get; } + /// Collection of custom properties. + public IList Properties { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.Serialization.cs new file mode 100644 index 000000000000..6986d457b18b --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class DocumentStreamInfo + { + internal static DocumentStreamInfo DeserializeDocumentStreamInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IReadOnlyList documentFilterGroups = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("DocumentFilterGroups"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DocumentFilterConjunctionGroupInfo.DeserializeDocumentFilterConjunctionGroupInfo(item)); + } + documentFilterGroups = array; + continue; + } + } + return new DocumentStreamInfo(id, documentFilterGroups); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static DocumentStreamInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeDocumentStreamInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.cs new file mode 100644 index 000000000000..beb1992a4c07 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentStreamInfo.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Configurations/filters set by UX to scope the document/telemetry it's interested in. + internal partial class DocumentStreamInfo + { + /// Initializes a new instance of . + /// Identifier of the document stream initiated by a UX. + /// Gets or sets an OR-connected collection of filter groups. + /// or is null. + internal DocumentStreamInfo(string id, IEnumerable documentFilterGroups) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(documentFilterGroups, nameof(documentFilterGroups)); + + Id = id; + DocumentFilterGroups = documentFilterGroups.ToList(); + } + + /// Initializes a new instance of . + /// Identifier of the document stream initiated by a UX. + /// Gets or sets an OR-connected collection of filter groups. + internal DocumentStreamInfo(string id, IReadOnlyList documentFilterGroups) + { + Id = id; + DocumentFilterGroups = documentFilterGroups; + } + + /// Identifier of the document stream initiated by a UX. + public string Id { get; } + /// Gets or sets an OR-connected collection of filter groups. + public IReadOnlyList DocumentFilterGroups { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentType.cs new file mode 100644 index 000000000000..df6d7662e786 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/DocumentType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Document type. + internal readonly partial struct DocumentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DocumentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RequestValue = "Request"; + private const string RemoteDependencyValue = "RemoteDependency"; + private const string ExceptionValue = "Exception"; + private const string EventValue = "Event"; + private const string TraceValue = "Trace"; + private const string UnknownValue = "Unknown"; + + /// Represents a request telemetry type. + public static DocumentType Request { get; } = new DocumentType(RequestValue); + /// Represents a remote dependency telemetry type. + public static DocumentType RemoteDependency { get; } = new DocumentType(RemoteDependencyValue); + /// Represents an exception telemetry type. + public static DocumentType Exception { get; } = new DocumentType(ExceptionValue); + /// Represents an event telemetry type. + public static DocumentType Event { get; } = new DocumentType(EventValue); + /// Represents a trace telemetry type. + public static DocumentType Trace { get; } = new DocumentType(TraceValue); + /// Represents an unknown telemetry type. + public static DocumentType Unknown { get; } = new DocumentType(UnknownValue); + /// Determines if two values are the same. + public static bool operator ==(DocumentType left, DocumentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DocumentType left, DocumentType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator DocumentType(string value) => new DocumentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DocumentType other && Equals(other); + /// + public bool Equals(DocumentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.Serialization.cs new file mode 100644 index 000000000000..07b9e6628e36 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class Event : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("Name"u8); + writer.WriteStringValue(Name); + } + writer.WritePropertyName("DocumentType"u8); + writer.WriteStringValue(DocumentType.ToString()); + if (Optional.IsCollectionDefined(DocumentStreamIds)) + { + writer.WritePropertyName("DocumentStreamIds"u8); + writer.WriteStartArray(); + foreach (var item in DocumentStreamIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("Properties"u8); + writer.WriteStartArray(); + foreach (var item in Properties) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.cs new file mode 100644 index 000000000000..046b2cdf87de --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Event.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Event document type. + internal partial class Event : DocumentIngress + { + /// Initializes a new instance of . + public Event() + { + DocumentType = DocumentType.Event; + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Event name. + internal Event(DocumentType documentType, IList documentStreamIds, IList properties, string name) : base(documentType, documentStreamIds, properties) + { + Name = name; + DocumentType = documentType; + } + + /// Event name. + public string Name { get; set; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.Serialization.cs new file mode 100644 index 000000000000..5e03596fe431 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class Exception : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(ExceptionType)) + { + writer.WritePropertyName("ExceptionType"u8); + writer.WriteStringValue(ExceptionType); + } + if (Optional.IsDefined(ExceptionMessage)) + { + writer.WritePropertyName("ExceptionMessage"u8); + writer.WriteStringValue(ExceptionMessage); + } + writer.WritePropertyName("DocumentType"u8); + writer.WriteStringValue(DocumentType.ToString()); + if (Optional.IsCollectionDefined(DocumentStreamIds)) + { + writer.WritePropertyName("DocumentStreamIds"u8); + writer.WriteStartArray(); + foreach (var item in DocumentStreamIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("Properties"u8); + writer.WriteStartArray(); + foreach (var item in Properties) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.cs new file mode 100644 index 000000000000..0fb637419fe6 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Exception.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Exception document type. + internal partial class Exception : DocumentIngress + { + /// Initializes a new instance of . + public Exception() + { + DocumentType = DocumentType.Exception; + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Exception type name. + /// Exception message. + internal Exception(DocumentType documentType, IList documentStreamIds, IList properties, string exceptionType, string exceptionMessage) : base(documentType, documentStreamIds, properties) + { + ExceptionType = exceptionType; + ExceptionMessage = exceptionMessage; + DocumentType = documentType; + } + + /// Exception type name. + public string ExceptionType { get; set; } + /// Exception message. + public string ExceptionMessage { get; set; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.Serialization.cs new file mode 100644 index 000000000000..a9b1451beace --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.Serialization.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class FilterConjunctionGroupInfo + { + internal static FilterConjunctionGroupInfo DeserializeFilterConjunctionGroupInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList filters = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("Filters"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FilterInfo.DeserializeFilterInfo(item)); + } + filters = array; + continue; + } + } + return new FilterConjunctionGroupInfo(filters); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FilterConjunctionGroupInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFilterConjunctionGroupInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.cs new file mode 100644 index 000000000000..9d70c4c9e270 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterConjunctionGroupInfo.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// An AND-connected group of FilterInfo objects. + internal partial class FilterConjunctionGroupInfo + { + /// Initializes a new instance of . + /// An array of filters. + /// is null. + internal FilterConjunctionGroupInfo(IEnumerable filters) + { + Argument.AssertNotNull(filters, nameof(filters)); + + Filters = filters.ToList(); + } + + /// Initializes a new instance of . + /// An array of filters. + internal FilterConjunctionGroupInfo(IReadOnlyList filters) + { + Filters = filters; + } + + /// An array of filters. + public IReadOnlyList Filters { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.Serialization.cs new file mode 100644 index 000000000000..f1b1261bef6c --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.Serialization.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class FilterInfo + { + internal static FilterInfo DeserializeFilterInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fieldName = default; + PredicateType predicate = default; + string comparand = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("FieldName"u8)) + { + fieldName = property.Value.GetString(); + continue; + } + if (property.NameEquals("Predicate"u8)) + { + predicate = new PredicateType(property.Value.GetString()); + continue; + } + if (property.NameEquals("Comparand"u8)) + { + comparand = property.Value.GetString(); + continue; + } + } + return new FilterInfo(fieldName, predicate, comparand); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static FilterInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeFilterInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.cs new file mode 100644 index 000000000000..766708559dd0 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/FilterInfo.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// A filter set on UX. + internal partial class FilterInfo + { + /// Initializes a new instance of . + /// dimension name of the filter. + /// Operator of the filter. + /// Comparand of the filter. + /// or is null. + internal FilterInfo(string fieldName, PredicateType predicate, string comparand) + { + Argument.AssertNotNull(fieldName, nameof(fieldName)); + Argument.AssertNotNull(comparand, nameof(comparand)); + + FieldName = fieldName; + Predicate = predicate; + Comparand = comparand; + } + + /// dimension name of the filter. + public string FieldName { get; } + /// Operator of the filter. + public PredicateType Predicate { get; } + /// Comparand of the filter. + public string Comparand { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.Serialization.cs new file mode 100644 index 000000000000..6afcfcc484a9 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class KeyValuePairString : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + writer.WritePropertyName("value"u8); + writer.WriteStringValue(Value); + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.cs new file mode 100644 index 000000000000..a16fc2ccec39 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/KeyValuePairString.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Key-value pair of string and string. + internal partial class KeyValuePairString + { + /// Initializes a new instance of . + /// Key of the key-value pair. + /// Value of the key-value pair. + /// or is null. + public KeyValuePairString(string key, string value) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + Key = key; + Value = value; + } + + /// Key of the key-value pair. + public string Key { get; } + /// Value of the key-value pair. + public string Value { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.Serialization.cs new file mode 100644 index 000000000000..1be293870dbc --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class MetricPoint : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("Name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("Value"u8); + writer.WriteNumberValue(Value); + writer.WritePropertyName("Weight"u8); + writer.WriteNumberValue(Weight); + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.cs new file mode 100644 index 000000000000..0b26ef61db31 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MetricPoint.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Metric data point. + internal partial class MetricPoint + { + /// Initializes a new instance of . + /// Metric name. + /// Metric value. + /// Metric weight. + /// is null. + public MetricPoint(string name, double value, int weight) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + Value = value; + Weight = weight; + } + + /// Metric name. + public string Name { get; } + /// Metric value. + public double Value { get; } + /// Metric weight. + public int Weight { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.Serialization.cs new file mode 100644 index 000000000000..8717cfa87d2a --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class MonitoringDataPoint : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("Version"u8); + writer.WriteStringValue(Version); + writer.WritePropertyName("InvariantVersion"u8); + writer.WriteNumberValue(InvariantVersion); + writer.WritePropertyName("Instance"u8); + writer.WriteStringValue(Instance); + writer.WritePropertyName("RoleName"u8); + writer.WriteStringValue(RoleName); + writer.WritePropertyName("MachineName"u8); + writer.WriteStringValue(MachineName); + writer.WritePropertyName("StreamId"u8); + writer.WriteStringValue(StreamId); + if (Optional.IsDefined(Timestamp)) + { + writer.WritePropertyName("Timestamp"u8); + writer.WriteStringValue(Timestamp.Value, "O"); + } + if (Optional.IsDefined(TransmissionTime)) + { + writer.WritePropertyName("TransmissionTime"u8); + writer.WriteStringValue(TransmissionTime.Value, "O"); + } + writer.WritePropertyName("IsWebApp"u8); + writer.WriteBooleanValue(IsWebApp); + writer.WritePropertyName("PerformanceCollectionSupported"u8); + writer.WriteBooleanValue(PerformanceCollectionSupported); + if (Optional.IsCollectionDefined(Metrics)) + { + writer.WritePropertyName("Metrics"u8); + writer.WriteStartArray(); + foreach (var item in Metrics) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Documents)) + { + writer.WritePropertyName("Documents"u8); + writer.WriteStartArray(); + foreach (var item in Documents) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(TopCpuProcesses)) + { + writer.WritePropertyName("TopCpuProcesses"u8); + writer.WriteStartArray(); + foreach (var item in TopCpuProcesses) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(CollectionConfigurationErrors)) + { + writer.WritePropertyName("CollectionConfigurationErrors"u8); + writer.WriteStartArray(); + foreach (var item in CollectionConfigurationErrors) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.cs new file mode 100644 index 000000000000..1d9efae8b426 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/MonitoringDataPoint.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Monitoring data point coming from the client, which includes metrics, documents and other metadata info. + internal partial class MonitoringDataPoint + { + /// Initializes a new instance of . + /// Application Insights SDK version. + /// Version/generation of the data contract (MonitoringDataPoint) between SDK and Live Metrics. + /// Service instance name where Application Insights SDK lives. + /// Service role name. + /// Computer name where Application Insights SDK lives. + /// Identifies an Application Insights SDK as a trusted agent to report metrics and documents. + /// True if the current application is an Azure Web App. + /// True if performance counters collection is supported. + /// , , , or is null. + public MonitoringDataPoint(string version, int invariantVersion, string instance, string roleName, string machineName, string streamId, bool isWebApp, bool performanceCollectionSupported) + { + Argument.AssertNotNull(version, nameof(version)); + Argument.AssertNotNull(instance, nameof(instance)); + Argument.AssertNotNull(roleName, nameof(roleName)); + Argument.AssertNotNull(machineName, nameof(machineName)); + Argument.AssertNotNull(streamId, nameof(streamId)); + + Version = version; + InvariantVersion = invariantVersion; + Instance = instance; + RoleName = roleName; + MachineName = machineName; + StreamId = streamId; + IsWebApp = isWebApp; + PerformanceCollectionSupported = performanceCollectionSupported; + Metrics = new ChangeTrackingList(); + Documents = new ChangeTrackingList(); + TopCpuProcesses = new ChangeTrackingList(); + CollectionConfigurationErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Application Insights SDK version. + /// Version/generation of the data contract (MonitoringDataPoint) between SDK and Live Metrics. + /// Service instance name where Application Insights SDK lives. + /// Service role name. + /// Computer name where Application Insights SDK lives. + /// Identifies an Application Insights SDK as a trusted agent to report metrics and documents. + /// Data point generation timestamp. + /// Timestamp when the client transmits the metrics and documents to Live Metrics. + /// True if the current application is an Azure Web App. + /// True if performance counters collection is supported. + /// An array of metric data points. + /// + /// An array of documents of a specific type {Request}, {RemoteDependency}, {Exception}, {Event}, or {Trace} + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// An array of top cpu consumption data point. + /// An array of error while SDK parses and applies the {CollectionConfigurationInfo} provided by Live Metrics. + internal MonitoringDataPoint(string version, int invariantVersion, string instance, string roleName, string machineName, string streamId, DateTimeOffset? timestamp, DateTimeOffset? transmissionTime, bool isWebApp, bool performanceCollectionSupported, IList metrics, IList documents, IList topCpuProcesses, IList collectionConfigurationErrors) + { + Version = version; + InvariantVersion = invariantVersion; + Instance = instance; + RoleName = roleName; + MachineName = machineName; + StreamId = streamId; + Timestamp = timestamp; + TransmissionTime = transmissionTime; + IsWebApp = isWebApp; + PerformanceCollectionSupported = performanceCollectionSupported; + Metrics = metrics; + Documents = documents; + TopCpuProcesses = topCpuProcesses; + CollectionConfigurationErrors = collectionConfigurationErrors; + } + + /// Application Insights SDK version. + public string Version { get; } + /// Version/generation of the data contract (MonitoringDataPoint) between SDK and Live Metrics. + public int InvariantVersion { get; } + /// Service instance name where Application Insights SDK lives. + public string Instance { get; } + /// Service role name. + public string RoleName { get; } + /// Computer name where Application Insights SDK lives. + public string MachineName { get; } + /// Identifies an Application Insights SDK as a trusted agent to report metrics and documents. + public string StreamId { get; } + /// Data point generation timestamp. + public DateTimeOffset? Timestamp { get; set; } + /// Timestamp when the client transmits the metrics and documents to Live Metrics. + public DateTimeOffset? TransmissionTime { get; set; } + /// True if the current application is an Azure Web App. + public bool IsWebApp { get; } + /// True if performance counters collection is supported. + public bool PerformanceCollectionSupported { get; } + /// An array of metric data points. + public IList Metrics { get; } + /// + /// An array of documents of a specific type {Request}, {RemoteDependency}, {Exception}, {Event}, or {Trace} + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + public IList Documents { get; } + /// An array of top cpu consumption data point. + public IList TopCpuProcesses { get; } + /// An array of error while SDK parses and applies the {CollectionConfigurationInfo} provided by Live Metrics. + public IList CollectionConfigurationErrors { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/PredicateType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/PredicateType.cs new file mode 100644 index 000000000000..05515dd5afd9 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/PredicateType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Enum representing the different types of predicates. + internal readonly partial struct PredicateType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PredicateType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EqualValue = "Equal"; + private const string NotEqualValue = "NotEqual"; + private const string LessThanValue = "LessThan"; + private const string GreaterThanValue = "GreaterThan"; + private const string LessThanOrEqualValue = "LessThanOrEqual"; + private const string GreaterThanOrEqualValue = "GreaterThanOrEqual"; + private const string ContainsValue = "Contains"; + private const string DoesNotContainValue = "DoesNotContain"; + + /// Represents an equality predicate. + public static PredicateType Equal { get; } = new PredicateType(EqualValue); + /// Represents a not-equal predicate. + public static PredicateType NotEqual { get; } = new PredicateType(NotEqualValue); + /// Represents a less-than predicate. + public static PredicateType LessThan { get; } = new PredicateType(LessThanValue); + /// Represents a greater-than predicate. + public static PredicateType GreaterThan { get; } = new PredicateType(GreaterThanValue); + /// Represents a less-than-or-equal predicate. + public static PredicateType LessThanOrEqual { get; } = new PredicateType(LessThanOrEqualValue); + /// Represents a greater-than-or-equal predicate. + public static PredicateType GreaterThanOrEqual { get; } = new PredicateType(GreaterThanOrEqualValue); + /// Represents a contains predicate. + public static PredicateType Contains { get; } = new PredicateType(ContainsValue); + /// Represents a does-not-contain predicate. + public static PredicateType DoesNotContain { get; } = new PredicateType(DoesNotContainValue); + /// Determines if two values are the same. + public static bool operator ==(PredicateType left, PredicateType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PredicateType left, PredicateType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PredicateType(string value) => new PredicateType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PredicateType other && Equals(other); + /// + public bool Equals(PredicateType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.Serialization.cs new file mode 100644 index 000000000000..2f9201151fdf --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class ProcessCpuData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("ProcessName"u8); + writer.WriteStringValue(ProcessName); + writer.WritePropertyName("CpuPercentage"u8); + writer.WriteNumberValue(CpuPercentage); + writer.WriteEndObject(); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.cs new file mode 100644 index 000000000000..756e9a6be758 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ProcessCpuData.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// CPU consumption datapoint. + internal partial class ProcessCpuData + { + /// Initializes a new instance of . + /// Process name. + /// CPU consumption percentage. + /// is null. + public ProcessCpuData(string processName, int cpuPercentage) + { + Argument.AssertNotNull(processName, nameof(processName)); + + ProcessName = processName; + CpuPercentage = cpuPercentage; + } + + /// Process name. + public string ProcessName { get; } + /// CPU consumption percentage. + public int CpuPercentage { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.Serialization.cs new file mode 100644 index 000000000000..484e18a43c78 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class QuotaConfigurationInfo + { + internal static QuotaConfigurationInfo DeserializeQuotaConfigurationInfo(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float? initialQuota = default; + float maxQuota = default; + float quotaAccrualRatePerSec = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("InitialQuota"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialQuota = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("MaxQuota"u8)) + { + maxQuota = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("QuotaAccrualRatePerSec"u8)) + { + quotaAccrualRatePerSec = property.Value.GetSingle(); + continue; + } + } + return new QuotaConfigurationInfo(initialQuota, maxQuota, quotaAccrualRatePerSec); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static QuotaConfigurationInfo FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeQuotaConfigurationInfo(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.cs new file mode 100644 index 000000000000..0c867233b648 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/QuotaConfigurationInfo.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Controls document quotas to be sent to Live Metrics. + internal partial class QuotaConfigurationInfo + { + /// Initializes a new instance of . + /// Max quota. + /// Quota accrual rate per second. + internal QuotaConfigurationInfo(float maxQuota, float quotaAccrualRatePerSec) + { + MaxQuota = maxQuota; + QuotaAccrualRatePerSec = quotaAccrualRatePerSec; + } + + /// Initializes a new instance of . + /// Initial quota. + /// Max quota. + /// Quota accrual rate per second. + internal QuotaConfigurationInfo(float? initialQuota, float maxQuota, float quotaAccrualRatePerSec) + { + InitialQuota = initialQuota; + MaxQuota = maxQuota; + QuotaAccrualRatePerSec = quotaAccrualRatePerSec; + } + + /// Initial quota. + public float? InitialQuota { get; } + /// Max quota. + public float MaxQuota { get; } + /// Quota accrual rate per second. + public float QuotaAccrualRatePerSec { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.Serialization.cs new file mode 100644 index 000000000000..4f1be14a4160 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class RemoteDependency : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("Name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(CommandName)) + { + writer.WritePropertyName("CommandName"u8); + writer.WriteStringValue(CommandName); + } + if (Optional.IsDefined(ResultCode)) + { + writer.WritePropertyName("ResultCode"u8); + writer.WriteStringValue(ResultCode); + } + if (Optional.IsDefined(Duration)) + { + writer.WritePropertyName("Duration"u8); + writer.WriteStringValue(Duration); + } + writer.WritePropertyName("DocumentType"u8); + writer.WriteStringValue(DocumentType.ToString()); + if (Optional.IsCollectionDefined(DocumentStreamIds)) + { + writer.WritePropertyName("DocumentStreamIds"u8); + writer.WriteStartArray(); + foreach (var item in DocumentStreamIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("Properties"u8); + writer.WriteStartArray(); + foreach (var item in Properties) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.cs new file mode 100644 index 000000000000..bdf92382863b --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/RemoteDependency.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// RemoteDependency document type. + internal partial class RemoteDependency : DocumentIngress + { + /// Initializes a new instance of . + public RemoteDependency() + { + DocumentType = DocumentType.RemoteDependency; + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Name of the command initiated with this dependency call, e.g., GET /username. + /// URL of the dependency call to the target, with all query string parameters. + /// Result code of a dependency call. Examples are SQL error code and HTTP status code. + /// Request duration in ISO 8601 duration format, i.e., P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W. + internal RemoteDependency(DocumentType documentType, IList documentStreamIds, IList properties, string name, string commandName, string resultCode, string duration) : base(documentType, documentStreamIds, properties) + { + Name = name; + CommandName = commandName; + ResultCode = resultCode; + Duration = duration; + DocumentType = documentType; + } + + /// Name of the command initiated with this dependency call, e.g., GET /username. + public string Name { get; set; } + /// URL of the dependency call to the target, with all query string parameters. + public string CommandName { get; set; } + /// Result code of a dependency call. Examples are SQL error code and HTTP status code. + public string ResultCode { get; set; } + /// Request duration in ISO 8601 duration format, i.e., P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W. + public string Duration { get; set; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.Serialization.cs new file mode 100644 index 000000000000..b764d499e60b --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.Serialization.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class Request : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("Name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Url)) + { + writer.WritePropertyName("Url"u8); + writer.WriteStringValue(Url.AbsoluteUri); + } + if (Optional.IsDefined(ResponseCode)) + { + writer.WritePropertyName("ResponseCode"u8); + writer.WriteStringValue(ResponseCode); + } + if (Optional.IsDefined(Duration)) + { + writer.WritePropertyName("Duration"u8); + writer.WriteStringValue(Duration); + } + writer.WritePropertyName("DocumentType"u8); + writer.WriteStringValue(DocumentType.ToString()); + if (Optional.IsCollectionDefined(DocumentStreamIds)) + { + writer.WritePropertyName("DocumentStreamIds"u8); + writer.WriteStartArray(); + foreach (var item in DocumentStreamIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("Properties"u8); + writer.WriteStartArray(); + foreach (var item in Properties) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.cs new file mode 100644 index 000000000000..4dc10467a7c8 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Request.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Request document type. + internal partial class Request : DocumentIngress + { + /// Initializes a new instance of . + public Request() + { + DocumentType = DocumentType.Request; + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Name of the request, e.g., 'GET /values/{id}'. + /// Request URL with all query string parameters. + /// Result of a request execution. For http requests, it could be some HTTP status code. + /// Request duration in ISO 8601 duration format, i.e., P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W. + internal Request(DocumentType documentType, IList documentStreamIds, IList properties, string name, Uri url, string responseCode, string duration) : base(documentType, documentStreamIds, properties) + { + Name = name; + Url = url; + ResponseCode = responseCode; + Duration = duration; + DocumentType = documentType; + } + + /// Name of the request, e.g., 'GET /values/{id}'. + public string Name { get; set; } + /// Request URL with all query string parameters. + public Uri Url { get; set; } + /// Result of a request execution. For http requests, it could be some HTTP status code. + public string ResponseCode { get; set; } + /// Request duration in ISO 8601 duration format, i.e., P[n]Y[n]M[n]DT[n]H[n]M[n]S or P[n]W. + public string Duration { get; set; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.Serialization.cs new file mode 100644 index 000000000000..de36722eb0ad --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.Serialization.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class ServiceError + { + internal static ServiceError DeserializeServiceError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string requestId = default; + string responseDateTime = default; + string code = default; + string message = default; + string exception = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("RequestId"u8)) + { + requestId = property.Value.GetString(); + continue; + } + if (property.NameEquals("ResponseDateTime"u8)) + { + responseDateTime = property.Value.GetString(); + continue; + } + if (property.NameEquals("Code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("Message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("Exception"u8)) + { + exception = property.Value.GetString(); + continue; + } + } + return new ServiceError(requestId, responseDateTime, code, message, exception); + } + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ServiceError FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeServiceError(document.RootElement); + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.cs new file mode 100644 index 000000000000..a4ca56c39489 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/ServiceError.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Optional http response body, whose existence carries additional error descriptions. + internal partial class ServiceError + { + /// Initializes a new instance of . + /// A globally unique identifier to identify the diagnostic context. It defaults to the empty GUID. + /// Service error response date time. + /// Error code. + /// Error message. + /// Message of the exception that triggers the error response. + /// , , , or is null. + internal ServiceError(string requestId, string responseDateTime, string code, string message, string exception) + { + Argument.AssertNotNull(requestId, nameof(requestId)); + Argument.AssertNotNull(responseDateTime, nameof(responseDateTime)); + Argument.AssertNotNull(code, nameof(code)); + Argument.AssertNotNull(message, nameof(message)); + Argument.AssertNotNull(exception, nameof(exception)); + + RequestId = requestId; + ResponseDateTime = responseDateTime; + Code = code; + Message = message; + Exception = exception; + } + + /// A globally unique identifier to identify the diagnostic context. It defaults to the empty GUID. + public string RequestId { get; } + /// Service error response date time. + public string ResponseDateTime { get; } + /// Error code. + public string Code { get; } + /// Error message. + public string Message { get; } + /// Message of the exception that triggers the error response. + public string Exception { get; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/TelemetryType.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/TelemetryType.cs new file mode 100644 index 000000000000..3033ee40dbaa --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/TelemetryType.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Telemetry type. + internal readonly partial struct TelemetryType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TelemetryType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RequestValue = "Request"; + private const string DependencyValue = "Dependency"; + private const string ExceptionValue = "Exception"; + private const string EventValue = "Event"; + private const string MetricValue = "Metric"; + private const string PerformanceCounterValue = "PerformanceCounter"; + private const string TraceValue = "Trace"; + + /// Represents a request telemetry type. + public static TelemetryType Request { get; } = new TelemetryType(RequestValue); + /// Represents a dependency telemetry type. + public static TelemetryType Dependency { get; } = new TelemetryType(DependencyValue); + /// Represents an exception telemetry type. + public static TelemetryType Exception { get; } = new TelemetryType(ExceptionValue); + /// Represents an event telemetry type. + public static TelemetryType Event { get; } = new TelemetryType(EventValue); + /// Represents a metric telemetry type. + public static TelemetryType Metric { get; } = new TelemetryType(MetricValue); + /// Represents a performance counter telemetry type. + public static TelemetryType PerformanceCounter { get; } = new TelemetryType(PerformanceCounterValue); + /// Represents a trace telemetry type. + public static TelemetryType Trace { get; } = new TelemetryType(TraceValue); + /// Determines if two values are the same. + public static bool operator ==(TelemetryType left, TelemetryType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TelemetryType left, TelemetryType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator TelemetryType(string value) => new TelemetryType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TelemetryType other && Equals(other); + /// + public bool Equals(TelemetryType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.Serialization.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.Serialization.cs new file mode 100644 index 000000000000..97cef47d2b15 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.Serialization.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + internal partial class Trace : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("Message"u8); + writer.WriteStringValue(Message); + } + writer.WritePropertyName("DocumentType"u8); + writer.WriteStringValue(DocumentType.ToString()); + if (Optional.IsCollectionDefined(DocumentStreamIds)) + { + writer.WritePropertyName("DocumentStreamIds"u8); + writer.WriteStartArray(); + foreach (var item in DocumentStreamIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Properties)) + { + writer.WritePropertyName("Properties"u8); + writer.WriteStartArray(); + foreach (var item in Properties) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this); + return content; + } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.cs b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.cs new file mode 100644 index 000000000000..8e57c03ae6f4 --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/Generated/Models/Trace.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; + +namespace Azure.Monitor.OpenTelemetry.LiveMetrics.Models +{ + /// Trace document type. + internal partial class Trace : DocumentIngress + { + /// Initializes a new instance of . + public Trace() + { + DocumentType = DocumentType.Trace; + } + + /// Initializes a new instance of . + /// Telemetry type. Types not defined in enum will get replaced with a 'Unknown' type. + /// An array of document streaming ids. Each id identifies a flow of documents customized by UX customers. + /// Collection of custom properties. + /// Trace message. + internal Trace(DocumentType documentType, IList documentStreamIds, IList properties, string message) : base(documentType, documentStreamIds, properties) + { + Message = message; + DocumentType = documentType; + } + + /// Trace message. + public string Message { get; set; } + } +} diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/autorest.md b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/autorest.md new file mode 100644 index 000000000000..bcea6e40eeea --- /dev/null +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.LiveMetrics/src/autorest.md @@ -0,0 +1,17 @@ +# Generated code configuration + +Run `dotnet build /t:GenerateCode` to generate code. + +``` yaml +input-file: + - https://github.com/Azure/azure-rest-api-specs/blob/665e7c3b6f26b148b3c05e55602621bc293cc0a4/specification/applicationinsights/data-plane/LiveMetrics/preview/2024-04-01-preview/livemetrics.json +generation1-convenience-client: true +``` + +``` yaml +directive: +- from: swagger-document + where: $.definitions.* + transform: > + $["x-accessibility"]="internal" +``` diff --git a/sdk/monitor/Azure.Monitor.OpenTelemetry.sln b/sdk/monitor/Azure.Monitor.OpenTelemetry.sln index 184e404a8a03..a289deb5ff7f 100644 --- a/sdk/monitor/Azure.Monitor.OpenTelemetry.sln +++ b/sdk/monitor/Azure.Monitor.OpenTelemetry.sln @@ -54,7 +54,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Monitor.OpenTelemetry EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Monitor.OpenTelemetry.AspNetCore.Benchmarks", "Azure.Monitor.OpenTelemetry.AspNetCore\tests\AspNetCore.Benchmarks\Azure.Monitor.OpenTelemetry.AspNetCore.Benchmarks.csproj", "{273FDDEB-62E9-4B29-B4C2-5F0F10E9B2C9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Monitor.AspNetCoreTestApp", "Azure.Monitor.OpenTelemetry.AspNetCore\tests\Azure.Monitor.AspNetCoreTestApp\Azure.Monitor.AspNetCoreTestApp.csproj", "{01657383-7C75-4C0A-9278-61755C4E3DC9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Monitor.AspNetCoreTestApp", "Azure.Monitor.OpenTelemetry.AspNetCore\tests\Azure.Monitor.AspNetCoreTestApp\Azure.Monitor.AspNetCoreTestApp.csproj", "{01657383-7C75-4C0A-9278-61755C4E3DC9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Monitor.OpenTelemetry.LiveMetrics", "Azure.Monitor.OpenTelemetry.LiveMetrics\src\Azure.Monitor.OpenTelemetry.LiveMetrics.csproj", "{0C961663-8E54-4560-A71A-74D33936586F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -126,6 +128,10 @@ Global {01657383-7C75-4C0A-9278-61755C4E3DC9}.Debug|Any CPU.Build.0 = Debug|Any CPU {01657383-7C75-4C0A-9278-61755C4E3DC9}.Release|Any CPU.ActiveCfg = Release|Any CPU {01657383-7C75-4C0A-9278-61755C4E3DC9}.Release|Any CPU.Build.0 = Release|Any CPU + {0C961663-8E54-4560-A71A-74D33936586F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0C961663-8E54-4560-A71A-74D33936586F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0C961663-8E54-4560-A71A-74D33936586F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0C961663-8E54-4560-A71A-74D33936586F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md index 47ba53a66641..463fdcc85801 100644 --- a/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md +++ b/sdk/monitor/Azure.Monitor.Query/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.5.0-beta.1 (Unreleased) +## 1.6.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 1.5.0 (2024-08-21) +### Bugs Fixed +- Fix bug in `LogsQueryClient` that defaulted to `Azure.PublicCloud`. `Audience` is now determined from the `endpoint` parameter. + ## 1.4.0 (2024-06-12) ### Features Added diff --git a/sdk/monitor/Azure.Monitor.Query/README.md b/sdk/monitor/Azure.Monitor.Query/README.md index 4a00caaee248..a3f60cb420fb 100644 --- a/sdk/monitor/Azure.Monitor.Query/README.md +++ b/sdk/monitor/Azure.Monitor.Query/README.md @@ -84,12 +84,16 @@ var metricsQueryClient = new MetricsQueryClient( new DefaultAzureCredential(), metricsQueryClientOptions); -// LogsQueryClient +// LogsQueryClient - by default, Azure Public Cloud is used +var logsQueryClient = new LogsQueryClient( + new DefaultAzureCredential()); + +// LogsQueryClient With Audience Set var logsQueryClientOptions = new LogsQueryClientOptions { Audience = LogsQueryAudience.AzureChina }; -var logsQueryClient = new LogsQueryClient( +var logsQueryClientChina = new LogsQueryClient( new DefaultAzureCredential(), logsQueryClientOptions); ``` diff --git a/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs b/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs index ff2a0bbf9653..41e38f81678e 100644 --- a/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs +++ b/sdk/monitor/Azure.Monitor.Query/api/Azure.Monitor.Query.netstandard2.0.cs @@ -29,7 +29,9 @@ public partial class LogsQueryClient protected LogsQueryClient() { } public LogsQueryClient(Azure.Core.TokenCredential credential) { } public LogsQueryClient(Azure.Core.TokenCredential credential, Azure.Monitor.Query.LogsQueryClientOptions options) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public LogsQueryClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public LogsQueryClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Monitor.Query.LogsQueryClientOptions options) { } public System.Uri Endpoint { get { throw null; } } public static string CreateQuery(System.FormattableString query) { throw null; } diff --git a/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj b/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj index 4b98f11baf27..e6fcaa9dbbbf 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj +++ b/sdk/monitor/Azure.Monitor.Query/src/Azure.Monitor.Query.csproj @@ -2,9 +2,9 @@ A library for querying Azure Monitor's Logs and Metrics data sources. Azure Monitor Query client library - 1.5.0-beta.1 + 1.6.0-beta.1 - 1.4.0 + 1.5.0 Azure Monitor Query true $(RequiredTargetFrameworks) diff --git a/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs b/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs index d0b91a607cdc..1d22fe76060e 100644 --- a/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs +++ b/sdk/monitor/Azure.Monitor.Query/src/LogsQueryClient.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Globalization; using System.Text; using System.Text.Json; @@ -56,6 +57,7 @@ public LogsQueryClient(TokenCredential credential, LogsQueryClientOptions option /// /// The service endpoint to use. /// The instance to use for authentication. + [EditorBrowsable(EditorBrowsableState.Never)] public LogsQueryClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, null) { } @@ -66,6 +68,7 @@ public LogsQueryClient(Uri endpoint, TokenCredential credential) : this(endpoint /// The service endpoint to use. /// The instance to use for authentication. /// The instance to use as client configuration. + [EditorBrowsable(EditorBrowsableState.Never)] public LogsQueryClient(Uri endpoint, TokenCredential credential, LogsQueryClientOptions options) { Argument.AssertNotNull(credential, nameof(credential)); @@ -73,8 +76,23 @@ public LogsQueryClient(Uri endpoint, TokenCredential credential, LogsQueryClient Endpoint = endpoint; options ??= new LogsQueryClientOptions(); - var authorizationScope = $"{(string.IsNullOrEmpty(options.Audience?.ToString()) ? LogsQueryAudience.AzurePublicCloud : options.Audience)}"; - authorizationScope += "//.default"; + + // Set authorization scope from Endpoint if Audience is not set. + string authorizationScope = ""; + if (string.IsNullOrEmpty(options.Audience?.ToString())) + { + // Endpoint.AbsoluteUri includes an extra / so only adding one here + authorizationScope = $"{endpoint.AbsoluteUri}/.default"; + } + else if (endpoint.Host != new Uri(options.Audience.ToString()).Host) + { + throw new InvalidOperationException("The endpoint URI and audience do not match. If setting the Audience to a regionally specific value, please use the LogsQueryClient(TokenCredential, LogsQueryClientOptions) constructor."); + } + else + { + authorizationScope = $"{options.Audience}//.default"; + } + var scopes = new List { authorizationScope }; endpoint = new Uri(endpoint, options.GetVersionString()); diff --git a/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientTests.cs b/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientTests.cs index c75bc674bd73..d2cfdcfd5afb 100644 --- a/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientTests.cs +++ b/sdk/monitor/Azure.Monitor.Query/tests/LogsQueryClientTests.cs @@ -287,33 +287,84 @@ public void ValidateMonitorModelFactoryTableCreation() } [Test] - public void Constructor_WhenOptionsIsNull_UsesDefaultEndpoint() + public void Constructor_WhenOptionsAndEndpointIsNull_UsesDefaultEndpoint() { - // Arrange var credential = new DefaultAzureCredential(); - - // Act var client = new LogsQueryClient(credential); - - // Assert Assert.AreEqual(LogsQueryAudience.AzurePublicCloud.ToString(), client.Endpoint.OriginalString); } [Test] - public void Constructor_WhenOptionsIsNotNull_UsesOptionsAudience() + public void Constructor_WhenEndpointIsNull_UsesOptionsAudience() { - // Arrange var credential = new DefaultAzureCredential(); var options = new LogsQueryClientOptions { Audience = "https://custom.audience" }; - // Act var client = new LogsQueryClient(credential, options); - // Assert + // When endpoint is not passed in, use Audience to contstruct the endpoint Assert.AreEqual("https://custom.audience", client.Endpoint.OriginalString); } + + [Test] + public void Constructor_WhenOptionsDoesNotMatchAudience() + { + var endpoint = new Uri("https://custom.audience"); + var credential = new DefaultAzureCredential(); + var options = new LogsQueryClientOptions + { + Audience = "https://customs.audience" + }; + + Assert.ThrowsAsync(async () => await Task.Run(() => new LogsQueryClient(endpoint, credential, options))); + } + + [Test] + public void Constructor_WhenOptionsIsNull_UsesEndpoint() + { + var endpoint = new Uri("https://custom.audience"); + var credential = new DefaultAzureCredential(); + + var client = new LogsQueryClient(endpoint, credential); + + Assert.AreEqual(new Uri("https://custom.audience"), client.Endpoint); + } + + [Test] + public void Constructor_WhenOptionsIsNull_UsesEndpointSlash() + { + var endpoint = new Uri("https://custom.audience//"); + var credential = new DefaultAzureCredential(); + + var client = new LogsQueryClient(endpoint, credential); + + Assert.AreEqual("https://custom.audience//", client.Endpoint.AbsoluteUri); + } + + [Test] + public void Constructor_WhenOptionsIsValid_UsesOptionsAsUri() + { + var credential = new DefaultAzureCredential(); + var options = new LogsQueryClientOptions + { + Audience = LogsQueryAudience.AzureGovernment + }; + + var client = new LogsQueryClient(credential, options); + + Assert.AreEqual(new Uri(LogsQueryAudience.AzureGovernment.ToString()), client.Endpoint); + } + + [Test] + public void Constructor_WhenOptionsIsNull_EndpointIsNull() + { + var credential = new DefaultAzureCredential(); + var client = new LogsQueryClient(credential); + + Assert.AreEqual(new Uri(LogsQueryAudience.AzurePublicCloud.ToString()), client.Endpoint); + } } } diff --git a/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs b/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs index 3dad319381b7..323e2985aa52 100644 --- a/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs +++ b/sdk/monitor/Azure.Monitor.Query/tests/MetricsQueryClientSamples.cs @@ -293,12 +293,16 @@ public void CreateClientsWithOptions() new DefaultAzureCredential(), metricsQueryClientOptions); - // LogsQueryClient + // LogsQueryClient - by default, Azure Public Cloud is used + var logsQueryClient = new LogsQueryClient( + new DefaultAzureCredential()); + + // LogsQueryClient With Audience Set var logsQueryClientOptions = new LogsQueryClientOptions { Audience = LogsQueryAudience.AzureChina }; - var logsQueryClient = new LogsQueryClient( + var logsQueryClientChina = new LogsQueryClient( new DefaultAzureCredential(), logsQueryClientOptions); #endregion diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md b/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md index 5fbd583c138b..359d851efdd3 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md +++ b/sdk/monitor/Azure.ResourceManager.Monitor/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.4.0-beta.1 (Unreleased) +## 1.4.0-beta.2 (Unreleased) ### Features Added @@ -10,6 +10,12 @@ ### Other Changes +## 1.4.0-beta.1 (2024-09-03) + +### Features Added + +- Added azure monitor pipeline group APIs (version `2023-10-01-preview`) + ## 1.3.1 (2024-04-29) ### Features Added diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/api/Azure.ResourceManager.Monitor.netstandard2.0.cs b/sdk/monitor/Azure.ResourceManager.Monitor/api/Azure.ResourceManager.Monitor.netstandard2.0.cs index b1f316e48b80..4a5808a2009f 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/api/Azure.ResourceManager.Monitor.netstandard2.0.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/api/Azure.ResourceManager.Monitor.netstandard2.0.cs @@ -761,6 +761,12 @@ public static partial class MonitorExtensions public static System.Threading.Tasks.Task> GetNotificationStatusAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.Threading.Tasks.Task> GetNotificationStatusAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetPipelineGroup(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPipelineGroupAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Monitor.PipelineGroupResource GetPipelineGroupResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Monitor.PipelineGroupCollection GetPipelineGroups(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetPipelineGroups(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetPipelineGroupsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetPrivateLinkScopeOperationStatus(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string asyncOperationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetPrivateLinkScopeOperationStatusAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string asyncOperationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetScheduledQueryRule(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1021,8 +1027,10 @@ public partial class MonitorWorkspaceResourceData : Azure.ResourceManager.Models public MonitorWorkspaceResourceData(Azure.Core.AzureLocation location) { } public string AccountId { get { throw null; } } public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceDefaultIngestionSettings DefaultIngestionSettings { get { throw null; } } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceIngestionSettings DefaultIngestionSettingsPropertiesDefaultIngestionSettings { get { throw null; } } public Azure.ETag? ETag { get { throw null; } } public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics Metrics { get { throw null; } } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties MetricsPropertiesMetrics { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess? PublicNetworkAccess { get { throw null; } } @@ -1032,6 +1040,65 @@ public MonitorWorkspaceResourceData(Azure.Core.AzureLocation location) { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class PipelineGroupCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected PipelineGroupCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string pipelineGroupName, Azure.ResourceManager.Monitor.PipelineGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string pipelineGroupName, Azure.ResourceManager.Monitor.PipelineGroupData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class PipelineGroupData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupData(Azure.Core.AzureLocation location) { } + public System.Collections.Generic.IList Exporters { get { throw null; } } + public Azure.ResourceManager.Resources.Models.ExtendedLocation ExtendedLocation { get { throw null; } set { } } + public System.Collections.Generic.IList NetworkingConfigurations { get { throw null; } } + public System.Collections.Generic.IList Processors { get { throw null; } } + public Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IList Receivers { get { throw null; } } + public int? Replicas { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupService Service { get { throw null; } set { } } + Azure.ResourceManager.Monitor.PipelineGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.PipelineGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineGroupResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected PipelineGroupResource() { } + public virtual Azure.ResourceManager.Monitor.PipelineGroupData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string pipelineGroupName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Monitor.PipelineGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.PipelineGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Monitor.Models.PipelineGroupPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Monitor.Models.PipelineGroupPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ScheduledQueryRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ScheduledQueryRuleCollection() { } @@ -1170,6 +1237,7 @@ protected MockableMonitorArmClient() { } public virtual Azure.ResourceManager.Monitor.MonitorPrivateLinkScopedResource GetMonitorPrivateLinkScopedResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Monitor.MonitorPrivateLinkScopeResource GetMonitorPrivateLinkScopeResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Monitor.MonitorWorkspaceResource GetMonitorWorkspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Monitor.PipelineGroupResource GetPipelineGroupResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Monitor.ScheduledQueryRuleResource GetScheduledQueryRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Monitor.VmInsightsOnboardingStatusResource GetVmInsightsOnboardingStatus(Azure.Core.ResourceIdentifier scope) { throw null; } public virtual Azure.ResourceManager.Monitor.VmInsightsOnboardingStatusResource GetVmInsightsOnboardingStatusResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -1212,6 +1280,9 @@ protected MockableMonitorResourceGroupResource() { } public virtual Azure.Response GetNotificationStatus(string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> GetNotificationStatusAsync(string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetPipelineGroup(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPipelineGroupAsync(string pipelineGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Monitor.PipelineGroupCollection GetPipelineGroups() { throw null; } public virtual Azure.Response GetPrivateLinkScopeOperationStatus(string asyncOperationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetPrivateLinkScopeOperationStatusAsync(string asyncOperationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetScheduledQueryRule(string ruleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1256,6 +1327,8 @@ protected MockableMonitorSubscriptionResource() { } public virtual Azure.Response GetNotificationStatus(string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public virtual System.Threading.Tasks.Task> GetNotificationStatusAsync(string notificationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetPipelineGroups(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPipelineGroupsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetScheduledQueryRules(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetScheduledQueryRulesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -1451,11 +1524,14 @@ public static partial class ArmMonitorModelFactory public static Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties MonitorWorkspaceMetricProperties(string prometheusQueryEndpoint = null, string internalId = null) { throw null; } public static Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics MonitorWorkspaceMetrics(string prometheusQueryEndpoint = null, string internalId = null) { throw null; } public static Azure.ResourceManager.Monitor.Models.MonitorWorkspacePrivateEndpointConnection MonitorWorkspacePrivateEndpointConnection(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable groupIds = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.Monitor.Models.MonitorPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.Monitor.Models.MonitorPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.Monitor.Models.MonitorPrivateEndpointConnectionProvisioningState?)) { throw null; } - public static Azure.ResourceManager.Monitor.MonitorWorkspaceResourceData MonitorWorkspaceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), string accountId = null, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics metrics = null, Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? provisioningState = default(Azure.ResourceManager.Monitor.Models.MonitorProvisioningState?), Azure.ResourceManager.Monitor.Models.MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess?)) { throw null; } + public static Azure.ResourceManager.Monitor.MonitorWorkspaceResourceData MonitorWorkspaceResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.Monitor.Models.MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = null, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics metrics = null, string accountId = null, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties metricsPropertiesMetrics = null, Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? provisioningState = default(Azure.ResourceManager.Monitor.Models.MonitorProvisioningState?), Azure.ResourceManager.Monitor.Models.MonitorWorkspaceIngestionSettings defaultIngestionSettingsPropertiesDefaultIngestionSettings = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Monitor.MonitorWorkspaceResourceData MonitorWorkspaceResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? etag, string accountId, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics metrics, Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? provisioningState, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings, System.Collections.Generic.IEnumerable privateEndpointConnections, Azure.ResourceManager.Monitor.Models.MonitorWorkspacePublicNetworkAccess? publicNetworkAccess) { throw null; } public static Azure.ResourceManager.Monitor.Models.NotificationActionDetail NotificationActionDetail(string mechanismType = null, string name = null, string status = null, string subState = null, System.DateTimeOffset? sendOn = default(System.DateTimeOffset?), string detail = null) { throw null; } public static Azure.ResourceManager.Monitor.Models.NotificationContent NotificationContent(string alertType = null, System.Collections.Generic.IEnumerable emailReceivers = null, System.Collections.Generic.IEnumerable smsReceivers = null, System.Collections.Generic.IEnumerable webhookReceivers = null, System.Collections.Generic.IEnumerable itsmReceivers = null, System.Collections.Generic.IEnumerable azureAppPushReceivers = null, System.Collections.Generic.IEnumerable automationRunbookReceivers = null, System.Collections.Generic.IEnumerable voiceReceivers = null, System.Collections.Generic.IEnumerable logicAppReceivers = null, System.Collections.Generic.IEnumerable azureFunctionReceivers = null, System.Collections.Generic.IEnumerable armRoleReceivers = null, System.Collections.Generic.IEnumerable eventHubReceivers = null) { throw null; } public static Azure.ResourceManager.Monitor.Models.NotificationContext NotificationContext(string notificationSource = null, string contextType = null) { throw null; } public static Azure.ResourceManager.Monitor.Models.NotificationStatus NotificationStatus(Azure.ResourceManager.Monitor.Models.NotificationContext context = null, string state = null, System.DateTimeOffset? completedOn = default(System.DateTimeOffset?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable actionDetails = null) { throw null; } + public static Azure.ResourceManager.Monitor.PipelineGroupData PipelineGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Resources.Models.ExtendedLocation extendedLocation = null, int? replicas = default(int?), System.Collections.Generic.IEnumerable receivers = null, System.Collections.Generic.IEnumerable processors = null, System.Collections.Generic.IEnumerable exporters = null, Azure.ResourceManager.Monitor.Models.PipelineGroupService service = null, System.Collections.Generic.IEnumerable networkingConfigurations = null, Azure.ResourceManager.Monitor.Models.MonitorProvisioningState? provisioningState = default(Azure.ResourceManager.Monitor.Models.MonitorProvisioningState?)) { throw null; } public static Azure.ResourceManager.Monitor.Models.PredictiveValue PredictiveValue(System.DateTimeOffset timeStamp = default(System.DateTimeOffset), double value = 0) { throw null; } public static Azure.ResourceManager.Monitor.ScheduledQueryRuleData ScheduledQueryRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Monitor.Models.ScheduledQueryRuleKind? kind = default(Azure.ResourceManager.Monitor.Models.ScheduledQueryRuleKind?), Azure.ETag? etag = default(Azure.ETag?), string createdWithApiVersion = null, bool? isLegacyLogAnalyticsRule = default(bool?), string description = null, string displayName = null, Azure.ResourceManager.Monitor.Models.AlertSeverity? severity = default(Azure.ResourceManager.Monitor.Models.AlertSeverity?), bool? isEnabled = default(bool?), System.Collections.Generic.IEnumerable scopes = null, System.TimeSpan? evaluationFrequency = default(System.TimeSpan?), System.TimeSpan? windowSize = default(System.TimeSpan?), System.TimeSpan? overrideQueryTimeRange = default(System.TimeSpan?), System.Collections.Generic.IEnumerable targetResourceTypes = null, System.Collections.Generic.IEnumerable criteriaAllOf = null, System.TimeSpan? muteActionsDuration = default(System.TimeSpan?), Azure.ResourceManager.Monitor.Models.ScheduledQueryRuleActions actions = null, bool? isWorkspaceAlertsStorageConfigured = default(bool?), bool? checkWorkspaceAlertsStorageConfigured = default(bool?), bool? skipQueryValidation = default(bool?), bool? autoMitigate = default(bool?)) { throw null; } public static Azure.ResourceManager.Monitor.Models.ScheduledQueryRulePatch ScheduledQueryRulePatch(System.Collections.Generic.IDictionary tags = null, string createdWithApiVersion = null, bool? isLegacyLogAnalyticsRule = default(bool?), string description = null, string displayName = null, Azure.ResourceManager.Monitor.Models.AlertSeverity? severity = default(Azure.ResourceManager.Monitor.Models.AlertSeverity?), bool? isEnabled = default(bool?), System.Collections.Generic.IEnumerable scopes = null, System.TimeSpan? evaluationFrequency = default(System.TimeSpan?), System.TimeSpan? windowSize = default(System.TimeSpan?), System.TimeSpan? overrideQueryTimeRange = default(System.TimeSpan?), System.Collections.Generic.IEnumerable targetResourceTypes = null, System.Collections.Generic.IEnumerable criteriaAllOf = null, System.TimeSpan? muteActionsDuration = default(System.TimeSpan?), Azure.ResourceManager.Monitor.Models.ScheduledQueryRuleActions actions = null, bool? isWorkspaceAlertsStorageConfigured = default(bool?), bool? checkWorkspaceAlertsStorageConfigured = default(bool?), bool? skipQueryValidation = default(bool?), bool? autoMitigate = default(bool?)) { throw null; } @@ -1570,6 +1646,17 @@ internal AutoscaleSettingPredicativeResult() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class BatchProcessor : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BatchProcessor() { } + public int? BatchSize { get { throw null; } set { } } + public int? Timeout { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.BatchProcessor System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.BatchProcessor System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ConditionFailingPeriods : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ConditionFailingPeriods() { } @@ -3363,9 +3450,101 @@ internal MonitorWorkspaceIngestionSettings() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class MonitorWorkspaceLogsApiConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsApiConfig(System.Uri dataCollectionEndpointUri, string stream, string dataCollectionRule, Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsSchemaMap schema) { } + public System.Uri DataCollectionEndpointUri { get { throw null; } set { } } + public string DataCollectionRule { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsSchemaMap Schema { get { throw null; } set { } } + public string Stream { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsApiConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsApiConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsExporter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsExporter(Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsApiConfig api) { } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsApiConfig Api { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterCacheConfiguration Cache { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterConcurrencyConfiguration Concurrency { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsExporterCacheConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsExporterCacheConfiguration() { } + public int? MaxStorageUsage { get { throw null; } set { } } + public int? RetentionPeriod { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterCacheConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterCacheConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsExporterConcurrencyConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsExporterConcurrencyConfiguration() { } + public int? BatchQueueSize { get { throw null; } set { } } + public int? WorkerCount { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterConcurrencyConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporterConcurrencyConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsRecordMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsRecordMap(string from, string to) { } + public string From { get { throw null; } set { } } + public string To { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsRecordMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsRecordMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsResourceMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsResourceMap(string from, string to) { } + public string From { get { throw null; } set { } } + public string To { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsResourceMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsResourceMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsSchemaMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsSchemaMap(System.Collections.Generic.IEnumerable recordMap) { } + public System.Collections.Generic.IList RecordMap { get { throw null; } } + public System.Collections.Generic.IList ResourceMap { get { throw null; } } + public System.Collections.Generic.IList ScopeMap { get { throw null; } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsSchemaMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsSchemaMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class MonitorWorkspaceLogsScopeMap : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MonitorWorkspaceLogsScopeMap(string from, string to) { } + public string From { get { throw null; } set { } } + public string To { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsScopeMap System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsScopeMap System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class MonitorWorkspaceMetricProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MonitorWorkspaceMetricProperties() { } + public MonitorWorkspaceMetricProperties() { } public string InternalId { get { throw null; } } public string PrometheusQueryEndpoint { get { throw null; } } Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3376,7 +3555,7 @@ internal MonitorWorkspaceMetricProperties() { } } public partial class MonitorWorkspaceMetrics : Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MonitorWorkspaceMetrics() { } + public MonitorWorkspaceMetrics() { } Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetrics System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3385,8 +3564,8 @@ internal MonitorWorkspaceMetrics() { } } public partial class MonitorWorkspacePrivateEndpointConnection : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal MonitorWorkspacePrivateEndpointConnection() { } - public Azure.ResourceManager.Monitor.Models.MonitorPrivateLinkServiceConnectionState ConnectionState { get { throw null; } } + public MonitorWorkspacePrivateEndpointConnection() { } + public Azure.ResourceManager.Monitor.Models.MonitorPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList GroupIds { get { throw null; } } public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } public Azure.ResourceManager.Monitor.Models.MonitorPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } @@ -3417,6 +3596,7 @@ internal MonitorWorkspacePrivateEndpointConnection() { } public partial class MonitorWorkspaceResourcePatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MonitorWorkspaceResourcePatch() { } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceMetricProperties Metrics { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } Azure.ResourceManager.Monitor.Models.MonitorWorkspaceResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -3551,6 +3731,201 @@ public PerfCounterDataSource() { } public static bool operator !=(Azure.ResourceManager.Monitor.Models.PerfCounterDataSourceStream left, Azure.ResourceManager.Monitor.Models.PerfCounterDataSourceStream right) { throw null; } public override string ToString() { throw null; } } + public partial class PipelineGroupExporter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupExporter(Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType exporterType, string name) { } + public Azure.ResourceManager.Monitor.Models.MonitorWorkspaceLogsExporter AzureMonitorWorkspaceLogs { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType ExporterType { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.Uri TcpUri { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.PipelineGroupExporter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupExporter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PipelineGroupExporterType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PipelineGroupExporterType(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType AzureMonitorWorkspaceLogs { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType PipelineGroup { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType left, Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType left, Azure.ResourceManager.Monitor.Models.PipelineGroupExporterType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PipelineGroupExternalNetworkingMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PipelineGroupExternalNetworkingMode(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode LoadBalancerOnly { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode left, Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode left, Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PipelineGroupNetworkingConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupNetworkingConfiguration(Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode externalNetworkingMode, System.Collections.Generic.IEnumerable routes) { } + public Azure.ResourceManager.Monitor.Models.PipelineGroupExternalNetworkingMode ExternalNetworkingMode { get { throw null; } set { } } + public string Host { get { throw null; } set { } } + public System.Collections.Generic.IList Routes { get { throw null; } } + Azure.ResourceManager.Monitor.Models.PipelineGroupNetworkingConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupNetworkingConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineGroupNetworkingRoute : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupNetworkingRoute(string receiver) { } + public string Path { get { throw null; } set { } } + public int? Port { get { throw null; } set { } } + public string Receiver { get { throw null; } set { } } + public string Subdomain { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.PipelineGroupNetworkingRoute System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupNetworkingRoute System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineGroupPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupPatch() { } + public System.Collections.Generic.IList Exporters { get { throw null; } } + public System.Collections.Generic.IList NetworkingConfigurations { get { throw null; } } + public System.Collections.Generic.IList Processors { get { throw null; } } + public System.Collections.Generic.IList Receivers { get { throw null; } } + public int? Replicas { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupService Service { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + Azure.ResourceManager.Monitor.Models.PipelineGroupPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineGroupProcessor : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupProcessor(Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType processorType, string name) { } + public Azure.ResourceManager.Monitor.Models.BatchProcessor Batch { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType ProcessorType { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.PipelineGroupProcessor System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupProcessor System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PipelineGroupProcessorType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PipelineGroupProcessorType(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType Batch { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType left, Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType left, Azure.ResourceManager.Monitor.Models.PipelineGroupProcessorType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PipelineGroupReceiver : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupReceiver(Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType receiverType, string name) { } + public string Name { get { throw null; } set { } } + public string OtlpEndpoint { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType ReceiverType { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.SyslogReceiver Syslog { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.UdpReceiver Udp { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.PipelineGroupReceiver System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupReceiver System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PipelineGroupReceiverType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PipelineGroupReceiverType(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType Ama { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType Otlp { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType PipelineGroup { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType Syslog { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType Udp { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType left, Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType left, Azure.ResourceManager.Monitor.Models.PipelineGroupReceiverType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PipelineGroupService : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupService(System.Collections.Generic.IEnumerable pipelines) { } + public string PersistencePersistentVolumeName { get { throw null; } set { } } + public System.Collections.Generic.IList Pipelines { get { throw null; } } + Azure.ResourceManager.Monitor.Models.PipelineGroupService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupService System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PipelineGroupServicePipeline : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PipelineGroupServicePipeline(string name, Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType pipelineType, System.Collections.Generic.IEnumerable receivers, System.Collections.Generic.IEnumerable exporters) { } + public System.Collections.Generic.IList Exporters { get { throw null; } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType PipelineType { get { throw null; } set { } } + public System.Collections.Generic.IList Processors { get { throw null; } } + public System.Collections.Generic.IList Receivers { get { throw null; } } + Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipeline System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipeline System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PipelineGroupServicePipelineType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PipelineGroupServicePipelineType(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType Logs { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType left, Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType left, Azure.ResourceManager.Monitor.Models.PipelineGroupServicePipelineType right) { throw null; } + public override string ToString() { throw null; } + } public partial class PlatformTelemetryDataSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public PlatformTelemetryDataSource(System.Collections.Generic.IEnumerable streams) { } @@ -3837,6 +4212,28 @@ internal SenderAuthorization() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct StreamEncodingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public StreamEncodingType(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Ascii { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Big5 { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Nop { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Utf16Be { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Utf16Le { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.StreamEncodingType Utf8 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.StreamEncodingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.StreamEncodingType left, Azure.ResourceManager.Monitor.Models.StreamEncodingType right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.StreamEncodingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.StreamEncodingType left, Azure.ResourceManager.Monitor.Models.StreamEncodingType right) { throw null; } + public override string ToString() { throw null; } + } public partial class SubscriptionMonitorMetric : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal SubscriptionMonitorMetric() { } @@ -4000,6 +4397,35 @@ public SyslogDataSource() { } public static bool operator !=(Azure.ResourceManager.Monitor.Models.SyslogDataSourceStream left, Azure.ResourceManager.Monitor.Models.SyslogDataSourceStream right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SyslogProtocol : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SyslogProtocol(string value) { throw null; } + public static Azure.ResourceManager.Monitor.Models.SyslogProtocol Rfc3164 { get { throw null; } } + public static Azure.ResourceManager.Monitor.Models.SyslogProtocol Rfc5424 { get { throw null; } } + public bool Equals(Azure.ResourceManager.Monitor.Models.SyslogProtocol other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Monitor.Models.SyslogProtocol left, Azure.ResourceManager.Monitor.Models.SyslogProtocol right) { throw null; } + public static implicit operator Azure.ResourceManager.Monitor.Models.SyslogProtocol (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Monitor.Models.SyslogProtocol left, Azure.ResourceManager.Monitor.Models.SyslogProtocol right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SyslogReceiver : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SyslogReceiver(string endpoint) { } + public string Endpoint { get { throw null; } set { } } + public Azure.ResourceManager.Monitor.Models.SyslogProtocol? Protocol { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.SyslogReceiver System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.SyslogReceiver System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ThresholdRuleCondition : Azure.ResourceManager.Monitor.Models.AlertRuleCondition, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ThresholdRuleCondition(Azure.ResourceManager.Monitor.Models.MonitorConditionOperator @operator, double threshold) { } @@ -4021,6 +4447,18 @@ public enum ThresholdRuleConditionTimeAggregationType Total = 3, Last = 4, } + public partial class UdpReceiver : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UdpReceiver(string endpoint) { } + public Azure.ResourceManager.Monitor.Models.StreamEncodingType? Encoding { get { throw null; } set { } } + public string Endpoint { get { throw null; } set { } } + public int? ReadQueueLength { get { throw null; } set { } } + Azure.ResourceManager.Monitor.Models.UdpReceiver System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Monitor.Models.UdpReceiver System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class WebhookNotification : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public WebhookNotification() { } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResource.cs index 18ddc6194e06..3fdf5d4d93f2 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResource.cs @@ -16,12 +16,12 @@ namespace Azure.ResourceManager.Monitor.Samples { public partial class Sample_MonitorWorkspaceResource { - // List workspaces by subscription + // List Azure Monitor Workspaces by subscription [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetMonitorWorkspaceResources_ListWorkspacesBySubscription() + public async Task GetMonitorWorkspaceResources_ListAzureMonitorWorkspacesBySubscription() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListBySubscription.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspacesListBySubscription.json // this example is just showing the usage of "AzureMonitorWorkspaces_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -48,12 +48,12 @@ public async Task GetMonitorWorkspaceResources_ListWorkspacesBySubscription() Console.WriteLine($"Succeeded"); } - // Get workspace + // Retrieves an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetWorkspace() + public async Task Get_RetrievesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceGet.json // this example is just showing the usage of "AzureMonitorWorkspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,12 +79,12 @@ public async Task Get_GetWorkspace() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Update workspace + // Updates an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_UpdateWorkspace() + public async Task Update_UpdatesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesUpdate.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceUpdate.json // this example is just showing the usage of "AzureMonitorWorkspaces_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -119,12 +119,12 @@ public async Task Update_UpdateWorkspace() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Delete workspace + // Deletes an Azure Monitor Workspace asynchronously [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteWorkspace() + public async Task Delete_DeletesAnAzureMonitorWorkspaceAsynchronously() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesDelete.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceDelete.json // this example is just showing the usage of "AzureMonitorWorkspaces_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResourceCollection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResourceCollection.cs index dc68f572a387..8118806aef8b 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResourceCollection.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_MonitorWorkspaceResourceCollection.cs @@ -15,12 +15,12 @@ namespace Azure.ResourceManager.Monitor.Samples { public partial class Sample_MonitorWorkspaceResourceCollection { - // List monitor workspaces by resource group + // List Azure Monitor Workspaces by resource group [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListMonitorWorkspacesByResourceGroup() + public async Task GetAll_ListAzureMonitorWorkspacesByResourceGroup() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesListByResourceGroup.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspacesListByResourceGroup.json // this example is just showing the usage of "AzureMonitorWorkspaces_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -51,12 +51,12 @@ public async Task GetAll_ListMonitorWorkspacesByResourceGroup() Console.WriteLine($"Succeeded"); } - // Get workspace + // Retrieves an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetWorkspace() + public async Task Get_RetrievesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceGet.json // this example is just showing the usage of "AzureMonitorWorkspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -85,12 +85,12 @@ public async Task Get_GetWorkspace() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Get workspace + // Retrieves an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetWorkspace() + public async Task Exists_RetrievesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceGet.json // this example is just showing the usage of "AzureMonitorWorkspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -115,12 +115,12 @@ public async Task Exists_GetWorkspace() Console.WriteLine($"Succeeded: {result}"); } - // Get workspace + // Retrieves an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetWorkspace() + public async Task GetIfExists_RetrievesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesGet.json + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceGet.json // this example is just showing the usage of "AzureMonitorWorkspaces_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -157,13 +157,13 @@ public async Task GetIfExists_GetWorkspace() } } - // Create or update workspace + // Creates an Azure Monitor Workspace [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateOrUpdateWorkspace() + public async Task CreateOrUpdate_CreatesAnAzureMonitorWorkspace() { - // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/examples/AzureMonitorWorkspacesCreate.json - // this example is just showing the usage of "AzureMonitorWorkspaces_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/AzureMonitorWorkspaceCreate.json + // this example is just showing the usage of "AzureMonitorWorkspaces_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -172,7 +172,7 @@ public async Task CreateOrUpdate_CreateOrUpdateWorkspace() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "703362b3-f278-4e4b-9179-c76eaf41ffc2"; + string subscriptionId = "00000000-0000-0000-0000-000000000000"; string resourceGroupName = "myResourceGroup"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupCollection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupCollection.cs new file mode 100644 index 000000000000..6c605f8b19ff --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupCollection.cs @@ -0,0 +1,540 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Monitor.Models; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Monitor.Samples +{ + public partial class Sample_PipelineGroupCollection + { + // List Pipeline groups by resource group + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListPipelineGroupsByResourceGroup() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupListByResourceGroup.json + // this example is just showing the usage of "PipelineGroups_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation and iterate over the result + await foreach (PipelineGroupResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Retrieves a PipelineGroup instance by name + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_RetrievesAPipelineGroupInstanceByName() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupGet.json + // this example is just showing the usage of "PipelineGroups_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + PipelineGroupResource result = await collection.GetAsync(pipelineGroupName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Retrieves a PipelineGroup instance by name + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_RetrievesAPipelineGroupInstanceByName() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupGet.json + // this example is just showing the usage of "PipelineGroups_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + bool result = await collection.ExistsAsync(pipelineGroupName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Retrieves a PipelineGroup instance by name + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_RetrievesAPipelineGroupInstanceByName() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupGet.json + // this example is just showing the usage of "PipelineGroups_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + NullableResponse response = await collection.GetIfExistsAsync(pipelineGroupName); + PipelineGroupResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create a PipelineGroup instance using UDP receiver + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAPipelineGroupInstanceUsingUDPReceiver() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupCreateUdp.json + // this example is just showing the usage of "PipelineGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + PipelineGroupData data = new PipelineGroupData(new AzureLocation("eastus2")) + { + ExtendedLocation = new ExtendedLocation() + { + Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/myTestCustomLocation", + }, + Receivers = +{ +new PipelineGroupReceiver(PipelineGroupReceiverType.Udp,"udp-receiver1") +{ +Udp = new UdpReceiver("0.0.0.0:518") +{ +Encoding = StreamEncodingType.Utf8, +}, +} +}, + Processors = +{ +}, + Exporters = +{ +new PipelineGroupExporter(PipelineGroupExporterType.AzureMonitorWorkspaceLogs,"my-workspace-logs-exporter1") +{ +AzureMonitorWorkspaceLogs = new MonitorWorkspaceLogsExporter(new MonitorWorkspaceLogsApiConfig(new Uri("https://logs-myingestion-eb0s.eastus-1.ingest.monitor.azure.com"),"Custom-MyTableRawData_CL","dcr-00000000000000000000000000000000",new MonitorWorkspaceLogsSchemaMap(new MonitorWorkspaceLogsRecordMap[] +{ +new MonitorWorkspaceLogsRecordMap("body","Body"),new MonitorWorkspaceLogsRecordMap("severity_text","SeverityText"),new MonitorWorkspaceLogsRecordMap("time_unix_nano","TimeGenerated") +}))) +{ +Concurrency = new MonitorWorkspaceLogsExporterConcurrencyConfiguration() +{ +WorkerCount = 4, +BatchQueueSize = 100, +}, +}, +} +}, + Service = new PipelineGroupService(new PipelineGroupServicePipeline[] + { +new PipelineGroupServicePipeline("MyPipelineForLogs1",PipelineGroupServicePipelineType.Logs,new string[] +{ +"udp-receiver1" +},new string[] +{ +"my-workspace-logs-exporter1" +}) +{ +Processors = +{ +}, +} + }), + Tags = +{ +["tag1"] = "A", +["tag2"] = "B", +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineGroupName, data); + PipelineGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a PipelineGroup instance using a syslog receiver + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAPipelineGroupInstanceUsingASyslogReceiver() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupCreateSyslogs.json + // this example is just showing the usage of "PipelineGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + PipelineGroupData data = new PipelineGroupData(new AzureLocation("eastus2")) + { + ExtendedLocation = new ExtendedLocation() + { + Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/myTestCustomLocation", + }, + Receivers = +{ +new PipelineGroupReceiver(PipelineGroupReceiverType.Syslog,"syslog-receiver1") +{ +Syslog = new SyslogReceiver("0.0.0.0:514"), +} +}, + Processors = +{ +new PipelineGroupProcessor(PipelineGroupProcessorType.Batch,"batch-processor1") +}, + Exporters = +{ +new PipelineGroupExporter(PipelineGroupExporterType.AzureMonitorWorkspaceLogs,"my-workspace-logs-exporter1") +{ +AzureMonitorWorkspaceLogs = new MonitorWorkspaceLogsExporter(new MonitorWorkspaceLogsApiConfig(new Uri("https://logs-myingestion-eb0s.eastus-1.ingest.monitor.azure.com"),"Custom-MyTableRawData_CL","dcr-00000000000000000000000000000000",new MonitorWorkspaceLogsSchemaMap(new MonitorWorkspaceLogsRecordMap[] +{ +new MonitorWorkspaceLogsRecordMap("body","Body"),new MonitorWorkspaceLogsRecordMap("severity_text","SeverityText"),new MonitorWorkspaceLogsRecordMap("time_unix_nano","TimeGenerated") +}))) +{ +Concurrency = new MonitorWorkspaceLogsExporterConcurrencyConfiguration() +{ +WorkerCount = 4, +BatchQueueSize = 100, +}, +}, +} +}, + Service = new PipelineGroupService(new PipelineGroupServicePipeline[] + { +new PipelineGroupServicePipeline("MyPipelineForLogs1",PipelineGroupServicePipelineType.Logs,new string[] +{ +"syslog-receiver1" +},new string[] +{ +"my-workspace-logs-exporter1" +}) +{ +Processors = +{ +"batch-processor1" +}, +} + }), + Tags = +{ +["tag1"] = "A", +["tag2"] = "B", +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineGroupName, data); + PipelineGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a PipelineGroup instance using a syslog receiver and cache. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAPipelineGroupInstanceUsingASyslogReceiverAndCache() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupCreateSyslogsWithCache.json + // this example is just showing the usage of "PipelineGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + PipelineGroupData data = new PipelineGroupData(new AzureLocation("eastus2")) + { + ExtendedLocation = new ExtendedLocation() + { + Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/myTestCustomLocation", + }, + Receivers = +{ +new PipelineGroupReceiver(PipelineGroupReceiverType.Syslog,"syslog-receiver1") +{ +Syslog = new SyslogReceiver("0.0.0.0:514"), +} +}, + Processors = +{ +new PipelineGroupProcessor(PipelineGroupProcessorType.Batch,"batch-processor1") +}, + Exporters = +{ +new PipelineGroupExporter(PipelineGroupExporterType.AzureMonitorWorkspaceLogs,"my-workspace-logs-exporter1") +{ +AzureMonitorWorkspaceLogs = new MonitorWorkspaceLogsExporter(new MonitorWorkspaceLogsApiConfig(new Uri("https://logs-myingestion-eb0s.eastus-1.ingest.monitor.azure.com"),"Custom-MyTableRawData_CL","dcr-00000000000000000000000000000000",new MonitorWorkspaceLogsSchemaMap(new MonitorWorkspaceLogsRecordMap[] +{ +new MonitorWorkspaceLogsRecordMap("body","Body"),new MonitorWorkspaceLogsRecordMap("severity_text","SeverityText"),new MonitorWorkspaceLogsRecordMap("time_unix_nano","TimeGenerated") +}))) +{ +Concurrency = new MonitorWorkspaceLogsExporterConcurrencyConfiguration() +{ +WorkerCount = 4, +BatchQueueSize = 100, +}, +Cache = new MonitorWorkspaceLogsExporterCacheConfiguration() +{ +MaxStorageUsage = 100, +RetentionPeriod = 10, +}, +}, +} +}, + Service = new PipelineGroupService(new PipelineGroupServicePipeline[] + { +new PipelineGroupServicePipeline("MyPipelineForLogs1",PipelineGroupServicePipelineType.Logs,new string[] +{ +"syslog-receiver1" +},new string[] +{ +"my-workspace-logs-exporter1" +}) +{ +Processors = +{ +"batch-processor1" +}, +} + }), + Tags = +{ +["tag1"] = "A", +["tag2"] = "B", +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineGroupName, data); + PipelineGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create a PipelineGroup instance using a syslog receiver and networking configurations. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAPipelineGroupInstanceUsingASyslogReceiverAndNetworkingConfigurations() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupCreateSyslogsWithNetworking.json + // this example is just showing the usage of "PipelineGroups_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this PipelineGroupResource + PipelineGroupCollection collection = resourceGroupResource.GetPipelineGroups(); + + // invoke the operation + string pipelineGroupName = "plGroup1"; + PipelineGroupData data = new PipelineGroupData(new AzureLocation("eastus2")) + { + ExtendedLocation = new ExtendedLocation() + { + Name = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/myTestCustomLocation", + }, + Receivers = +{ +new PipelineGroupReceiver(PipelineGroupReceiverType.Syslog,"syslog-receiver1") +{ +Syslog = new SyslogReceiver("0.0.0.0:514"), +} +}, + Processors = +{ +}, + Exporters = +{ +new PipelineGroupExporter(PipelineGroupExporterType.AzureMonitorWorkspaceLogs,"my-workspace-logs-exporter1") +{ +AzureMonitorWorkspaceLogs = new MonitorWorkspaceLogsExporter(new MonitorWorkspaceLogsApiConfig(new Uri("https://logs-myingestion-eb0s.eastus-1.ingest.monitor.azure.com"),"Custom-MyTableRawData_CL","dcr-00000000000000000000000000000000",new MonitorWorkspaceLogsSchemaMap(new MonitorWorkspaceLogsRecordMap[] +{ +new MonitorWorkspaceLogsRecordMap("body","Body"),new MonitorWorkspaceLogsRecordMap("severity_text","SeverityText"),new MonitorWorkspaceLogsRecordMap("time_unix_nano","TimeGenerated") +}))) +{ +Concurrency = new MonitorWorkspaceLogsExporterConcurrencyConfiguration() +{ +WorkerCount = 4, +BatchQueueSize = 100, +}, +}, +} +}, + Service = new PipelineGroupService(new PipelineGroupServicePipeline[] + { +new PipelineGroupServicePipeline("MyPipelineForLogs1",PipelineGroupServicePipelineType.Logs,new string[] +{ +"syslog-receiver1" +},new string[] +{ +"my-workspace-logs-exporter1" +}) +{ +Processors = +{ +}, +} + }), + NetworkingConfigurations = +{ +new PipelineGroupNetworkingConfiguration(PipelineGroupExternalNetworkingMode.LoadBalancerOnly,new PipelineGroupNetworkingRoute[] +{ +new PipelineGroupNetworkingRoute("syslog-receiver1") +}) +{ +Host = "azuremonitorpipeline.contoso.com", +} +}, + Tags = +{ +["tag1"] = "A", +["tag2"] = "B", +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pipelineGroupName, data); + PipelineGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupResource.cs new file mode 100644 index 000000000000..c46e30b5d65d --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/samples/Generated/Samples/Sample_PipelineGroupResource.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Monitor.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Monitor.Samples +{ + public partial class Sample_PipelineGroupResource + { + // List Pipeline groups by subscription + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetPipelineGroups_ListPipelineGroupsBySubscription() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupListBySubscription.json + // this example is just showing the usage of "PipelineGroups_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (PipelineGroupResource item in subscriptionResource.GetPipelineGroupsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Retrieves a PipelineGroup instance by name + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_RetrievesAPipelineGroupInstanceByName() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupGet.json + // this example is just showing the usage of "PipelineGroups_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PipelineGroupResource created on azure + // for more information of creating PipelineGroupResource, please refer to the document of PipelineGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string pipelineGroupName = "plGroup1"; + ResourceIdentifier pipelineGroupResourceId = PipelineGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, pipelineGroupName); + PipelineGroupResource pipelineGroup = client.GetPipelineGroupResource(pipelineGroupResourceId); + + // invoke the operation + PipelineGroupResource result = await pipelineGroup.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Updates a PipelineGroup instance + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdatesAPipelineGroupInstance() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupUpdate.json + // this example is just showing the usage of "PipelineGroups_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PipelineGroupResource created on azure + // for more information of creating PipelineGroupResource, please refer to the document of PipelineGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string pipelineGroupName = "plGroup1"; + ResourceIdentifier pipelineGroupResourceId = PipelineGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, pipelineGroupName); + PipelineGroupResource pipelineGroup = client.GetPipelineGroupResource(pipelineGroupResourceId); + + // invoke the operation + PipelineGroupPatch patch = new PipelineGroupPatch() + { + Tags = +{ +["tag1"] = "A", +["tag2"] = "B", +}, + Replicas = 3, + Receivers = +{ +new PipelineGroupReceiver(PipelineGroupReceiverType.Syslog,"syslog-receiver1") +{ +Syslog = new SyslogReceiver("0.0.0.0:514"), +} +}, + Processors = +{ +}, + Exporters = +{ +new PipelineGroupExporter(PipelineGroupExporterType.AzureMonitorWorkspaceLogs,"my-workspace-logs-exporter1") +{ +AzureMonitorWorkspaceLogs = new MonitorWorkspaceLogsExporter(new MonitorWorkspaceLogsApiConfig(new Uri("https://logs-myingestion-eb0s.eastus-1.ingest.monitor.azure.com"),"Custom-MyTableRawData_CL","dcr-00000000000000000000000000000000",new MonitorWorkspaceLogsSchemaMap(new MonitorWorkspaceLogsRecordMap[] +{ +new MonitorWorkspaceLogsRecordMap("body","Body"),new MonitorWorkspaceLogsRecordMap("severity_text","SeverityText"),new MonitorWorkspaceLogsRecordMap("time_unix_nano","TimeGenerated") +}))) +{ +Concurrency = new MonitorWorkspaceLogsExporterConcurrencyConfiguration() +{ +WorkerCount = 4, +BatchQueueSize = 100, +}, +}, +} +}, + Service = new PipelineGroupService(new PipelineGroupServicePipeline[] + { +new PipelineGroupServicePipeline("MyPipelineForLogs1",PipelineGroupServicePipelineType.Logs,new string[] +{ +"syslog-receiver1" +},new string[] +{ +"my-workspace-logs-exporter1" +}) +{ +Processors = +{ +}, +} + }), + }; + ArmOperation lro = await pipelineGroup.UpdateAsync(WaitUntil.Completed, patch); + PipelineGroupResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + PipelineGroupData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Deletes a PipelineGroup instance + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeletesAPipelineGroupInstance() + { + // Generated from example definition: specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/examples/PipelineGroupDelete.json + // this example is just showing the usage of "PipelineGroups_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PipelineGroupResource created on azure + // for more information of creating PipelineGroupResource, please refer to the document of PipelineGroupResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "myResourceGroup"; + string pipelineGroupName = "plGroup1"; + ResourceIdentifier pipelineGroupResourceId = PipelineGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, pipelineGroupName); + PipelineGroupResource pipelineGroup = client.GetPipelineGroupResource(pipelineGroupResourceId); + + // invoke the operation + await pipelineGroup.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Azure.ResourceManager.Monitor.csproj b/sdk/monitor/Azure.ResourceManager.Monitor/src/Azure.ResourceManager.Monitor.csproj index 3ade061ea77a..24e992e52ab6 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Azure.ResourceManager.Monitor.csproj +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Azure.ResourceManager.Monitor.csproj @@ -1,6 +1,6 @@ - 1.4.0-beta.1 + 1.4.0-beta.2 1.3.1 Azure.ResourceManager.Monitor diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ArmMonitorModelFactory.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ArmMonitorModelFactory.cs index 4ce51c136ec3..255a4411f5ee 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ArmMonitorModelFactory.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ArmMonitorModelFactory.cs @@ -7,10 +7,12 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Net; using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Monitor.Models { @@ -1479,14 +1481,16 @@ public static MonitoringAccountDestination MonitoringAccountDestination(Resource /// The tags. /// The location. /// Resource entity tag (ETag). + /// The Data Collection Rule and Endpoint used for ingestion by default. + /// Properties related to the metrics container in the Azure Monitor Workspace. /// The immutable ID of the Azure Monitor workspace. This property is read-only. - /// Information about metrics for the Azure Monitor workspace. + /// Information about metrics for the Azure Monitor workspace. /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - /// The Data Collection Rule and Endpoint used for ingestion by default. + /// The Data Collection Rule and Endpoint used for ingestion by default. /// List of private endpoint connections. /// Gets or sets allow or disallow public network access to workspace. /// A new instance for mocking. - public static MonitorWorkspaceResourceData MonitorWorkspaceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, string accountId = null, MonitorWorkspaceMetrics metrics = null, MonitorProvisioningState? provisioningState = null, MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = null, IEnumerable privateEndpointConnections = null, MonitorWorkspacePublicNetworkAccess? publicNetworkAccess = null) + public static MonitorWorkspaceResourceData MonitorWorkspaceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = null, MonitorWorkspaceMetrics metrics = null, string accountId = null, MonitorWorkspaceMetricProperties metricsPropertiesMetrics = null, MonitorProvisioningState? provisioningState = null, MonitorWorkspaceIngestionSettings defaultIngestionSettingsPropertiesDefaultIngestionSettings = null, IEnumerable privateEndpointConnections = null, MonitorWorkspacePublicNetworkAccess? publicNetworkAccess = null) { tags ??= new Dictionary(); privateEndpointConnections ??= new List(); @@ -1499,24 +1503,17 @@ public static MonitorWorkspaceResourceData MonitorWorkspaceResourceData(Resource tags, location, etag, - accountId, + defaultIngestionSettings, metrics, + accountId, + metricsPropertiesMetrics, provisioningState, - defaultIngestionSettings, + defaultIngestionSettingsPropertiesDefaultIngestionSettings, privateEndpointConnections?.ToList(), publicNetworkAccess, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The Prometheus query endpoint for the workspace. - /// An internal identifier for the metrics container. Only to be used by the system. - /// A new instance for mocking. - public static MonitorWorkspaceMetrics MonitorWorkspaceMetrics(string prometheusQueryEndpoint = null, string internalId = null) - { - return new MonitorWorkspaceMetrics(prometheusQueryEndpoint, internalId, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The Prometheus query endpoint for the workspace. /// An internal identifier for the metrics container. Only to be used by the system. @@ -1526,15 +1523,6 @@ public static MonitorWorkspaceMetricProperties MonitorWorkspaceMetricProperties( return new MonitorWorkspaceMetricProperties(prometheusQueryEndpoint, internalId, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The Azure resource Id of the default data collection rule for this workspace. - /// The Azure resource Id of the default data collection endpoint for this workspace. - /// A new instance for mocking. - public static MonitorWorkspaceDefaultIngestionSettings MonitorWorkspaceDefaultIngestionSettings(ResourceIdentifier dataCollectionRuleResourceId = null, ResourceIdentifier dataCollectionEndpointResourceId = null) - { - return new MonitorWorkspaceDefaultIngestionSettings(dataCollectionRuleResourceId, dataCollectionEndpointResourceId, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The Azure resource Id of the default data collection rule for this workspace. /// The Azure resource Id of the default data collection endpoint for this workspace. @@ -1569,5 +1557,86 @@ public static MonitorWorkspacePrivateEndpointConnection MonitorWorkspacePrivateE provisioningState, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The Azure resource Id of the default data collection rule for this workspace. + /// The Azure resource Id of the default data collection endpoint for this workspace. + /// A new instance for mocking. + public static MonitorWorkspaceDefaultIngestionSettings MonitorWorkspaceDefaultIngestionSettings(ResourceIdentifier dataCollectionRuleResourceId = null, ResourceIdentifier dataCollectionEndpointResourceId = null) + { + return new MonitorWorkspaceDefaultIngestionSettings(dataCollectionRuleResourceId, dataCollectionEndpointResourceId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Prometheus query endpoint for the workspace. + /// An internal identifier for the metrics container. Only to be used by the system. + /// A new instance for mocking. + public static MonitorWorkspaceMetrics MonitorWorkspaceMetrics(string prometheusQueryEndpoint = null, string internalId = null) + { + return new MonitorWorkspaceMetrics(prometheusQueryEndpoint, internalId, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The extended location for given pipeline group. + /// Defines the amount of replicas of the pipeline group instance. + /// The receivers specified for a pipeline group instance. + /// The processors specified for a pipeline group instance. + /// The exporters specified for a pipeline group instance. + /// The service section for a given pipeline group instance. + /// Networking configurations for the pipeline group instance. + /// The provisioning state of a pipeline group instance. Set to Succeeded if everything is healthy. + /// A new instance for mocking. + public static PipelineGroupData PipelineGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ExtendedLocation extendedLocation = null, int? replicas = null, IEnumerable receivers = null, IEnumerable processors = null, IEnumerable exporters = null, PipelineGroupService service = null, IEnumerable networkingConfigurations = null, MonitorProvisioningState? provisioningState = null) + { + tags ??= new Dictionary(); + receivers ??= new List(); + processors ??= new List(); + exporters ??= new List(); + networkingConfigurations ??= new List(); + + return new PipelineGroupData( + id, + name, + resourceType, + systemData, + tags, + location, + extendedLocation, + replicas, + receivers?.ToList(), + processors?.ToList(), + exporters?.ToList(), + service, + networkingConfigurations?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// Resource entity tag (ETag). + /// The immutable ID of the Azure Monitor workspace. This property is read-only. + /// Information about metrics for the Azure Monitor workspace. + /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. + /// The Data Collection Rule and Endpoint used for ingestion by default. + /// List of private endpoint connections. + /// Gets or sets allow or disallow public network access to workspace. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static MonitorWorkspaceResourceData MonitorWorkspaceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, string accountId, MonitorWorkspaceMetrics metrics, MonitorProvisioningState? provisioningState, MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings, IEnumerable privateEndpointConnections, MonitorWorkspacePublicNetworkAccess? publicNetworkAccess) + { + return MonitorWorkspaceResourceData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, etag: etag, defaultIngestionSettings: defaultIngestionSettings, metrics: metrics, accountId: accountId, metricsPropertiesMetrics: default, provisioningState: provisioningState, defaultIngestionSettingsPropertiesDefaultIngestionSettings: default, privateEndpointConnections: privateEndpointConnections, publicNetworkAccess: publicNetworkAccess); + } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorArmClient.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorArmClient.cs index 4cd68abc0769..87e7c957670b 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorArmClient.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorArmClient.cs @@ -740,5 +740,17 @@ public virtual MonitorWorkspaceResource GetMonitorWorkspaceResource(ResourceIden MonitorWorkspaceResource.ValidateResourceId(id); return new MonitorWorkspaceResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual PipelineGroupResource GetPipelineGroupResource(ResourceIdentifier id) + { + PipelineGroupResource.ValidateResourceId(id); + return new PipelineGroupResource(Client, id); + } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorResourceGroupResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorResourceGroupResource.cs index 89cec51deeeb..77a43da33af2 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorResourceGroupResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorResourceGroupResource.cs @@ -682,7 +682,7 @@ public virtual MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources() /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -690,7 +690,7 @@ public virtual MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources() /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -713,7 +713,7 @@ public virtual async Task> GetMonitorWorkspac /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -721,7 +721,7 @@ public virtual async Task> GetMonitorWorkspac /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -731,6 +731,75 @@ public virtual Response GetMonitorWorkspaceResource(st return GetMonitorWorkspaceResources().Get(azureMonitorWorkspaceName, cancellationToken); } + /// Gets a collection of PipelineGroupResources in the ResourceGroupResource. + /// An object representing collection of PipelineGroupResources and their operations over a PipelineGroupResource. + public virtual PipelineGroupCollection GetPipelineGroups() + { + return GetCachedClient(client => new PipelineGroupCollection(client, Id)); + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetPipelineGroupAsync(string pipelineGroupName, CancellationToken cancellationToken = default) + { + return await GetPipelineGroups().GetAsync(pipelineGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetPipelineGroup(string pipelineGroupName, CancellationToken cancellationToken = default) + { + return GetPipelineGroups().Get(pipelineGroupName, cancellationToken); + } + /// /// Get the status of an azure asynchronous operation associated with a private link scope operation. /// diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorSubscriptionResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorSubscriptionResource.cs index d7874bcfd39d..f75f41e8c47c 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorSubscriptionResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MockableMonitorSubscriptionResource.cs @@ -42,6 +42,8 @@ public partial class MockableMonitorSubscriptionResource : ArmResource private DataCollectionRulesRestOperations _dataCollectionRuleRestClient; private ClientDiagnostics _monitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics; private AzureMonitorWorkspacesRestOperations _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient; + private ClientDiagnostics _pipelineGroupClientDiagnostics; + private PipelineGroupsRestOperations _pipelineGroupRestClient; /// Initializes a new instance of the class for mocking. protected MockableMonitorSubscriptionResource() @@ -79,6 +81,8 @@ internal MockableMonitorSubscriptionResource(ArmClient client, ResourceIdentifie private DataCollectionRulesRestOperations DataCollectionRuleRestClient => _dataCollectionRuleRestClient ??= new DataCollectionRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DataCollectionRuleResource.ResourceType)); private ClientDiagnostics MonitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics => _monitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", MonitorWorkspaceResource.ResourceType.Namespace, Diagnostics); private AzureMonitorWorkspacesRestOperations MonitorWorkspaceResourceAzureMonitorWorkspacesRestClient => _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient ??= new AzureMonitorWorkspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(MonitorWorkspaceResource.ResourceType)); + private ClientDiagnostics PipelineGroupClientDiagnostics => _pipelineGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", PipelineGroupResource.ResourceType.Namespace, Diagnostics); + private PipelineGroupsRestOperations PipelineGroupRestClient => _pipelineGroupRestClient ??= new PipelineGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(PipelineGroupResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -880,7 +884,7 @@ public virtual Pageable GetDataCollectionRules(Cance /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -910,7 +914,7 @@ public virtual AsyncPageable GetMonitorWorkspaceResour /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -926,5 +930,65 @@ public virtual Pageable GetMonitorWorkspaceResources(C HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MonitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MonitorWorkspaceResource(Client, MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(e)), MonitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics, Pipeline, "MockableMonitorSubscriptionResource.GetMonitorWorkspaceResources", "value", "nextLink", cancellationToken); } + + /// + /// Lists all workspaces in the specified subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPipelineGroupsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PipelineGroupRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PipelineGroupRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PipelineGroupResource(Client, PipelineGroupData.DeserializePipelineGroupData(e)), PipelineGroupClientDiagnostics, Pipeline, "MockableMonitorSubscriptionResource.GetPipelineGroups", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all workspaces in the specified subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPipelineGroups(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => PipelineGroupRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => PipelineGroupRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PipelineGroupResource(Client, PipelineGroupData.DeserializePipelineGroupData(e)), PipelineGroupClientDiagnostics, Pipeline, "MockableMonitorSubscriptionResource.GetPipelineGroups", "value", "nextLink", cancellationToken); + } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs index 03af2a4c249a..afacedff434d 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs @@ -950,6 +950,25 @@ public static MonitorWorkspaceResource GetMonitorWorkspaceResource(this ArmClien return GetMockableMonitorArmClient(client).GetMonitorWorkspaceResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static PipelineGroupResource GetPipelineGroupResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMonitorArmClient(client).GetPipelineGroupResource(id); + } + /// /// Gets a collection of AutoscaleSettingResources in the ResourceGroupResource. /// @@ -1817,7 +1836,7 @@ public static MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources(th /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -1830,7 +1849,7 @@ public static MonitorWorkspaceResourceCollection GetMonitorWorkspaceResources(th /// /// /// The instance the method will execute against. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1855,7 +1874,7 @@ public static async Task> GetMonitorWorkspace /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -1868,7 +1887,7 @@ public static async Task> GetMonitorWorkspace /// /// /// The instance the method will execute against. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -1880,6 +1899,99 @@ public static Response GetMonitorWorkspaceResource(thi return GetMockableMonitorResourceGroupResource(resourceGroupResource).GetMonitorWorkspaceResource(azureMonitorWorkspaceName, cancellationToken); } + /// + /// Gets a collection of PipelineGroupResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of PipelineGroupResources and their operations over a PipelineGroupResource. + public static PipelineGroupCollection GetPipelineGroups(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMonitorResourceGroupResource(resourceGroupResource).GetPipelineGroups(); + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetPipelineGroupAsync(this ResourceGroupResource resourceGroupResource, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableMonitorResourceGroupResource(resourceGroupResource).GetPipelineGroupAsync(pipelineGroupName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetPipelineGroup(this ResourceGroupResource resourceGroupResource, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMonitorResourceGroupResource(resourceGroupResource).GetPipelineGroup(pipelineGroupName, cancellationToken); + } + /// /// Get the status of an azure asynchronous operation associated with a private link scope operation. /// @@ -2900,7 +3012,7 @@ public static Pageable GetDataCollectionRules(this S /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -2936,7 +3048,7 @@ public static AsyncPageable GetMonitorWorkspaceResourc /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -2959,6 +3071,78 @@ public static Pageable GetMonitorWorkspaceResources(th return GetMockableMonitorSubscriptionResource(subscriptionResource).GetMonitorWorkspaceResources(cancellationToken); } + /// + /// Lists all workspaces in the specified subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetPipelineGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableMonitorSubscriptionResource(subscriptionResource).GetPipelineGroupsAsync(cancellationToken); + } + + /// + /// Lists all workspaces in the specified subscription + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListBySubscription + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetPipelineGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableMonitorSubscriptionResource(subscriptionResource).GetPipelineGroups(cancellationToken); + } + /// /// Get the list of available event categories supported in the Activity Logs Service.<br>The current list includes the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy. /// diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/MonitorWorkspaceResourceOperationSource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/MonitorWorkspaceResourceOperationSource.cs new file mode 100644 index 000000000000..75f67668f68e --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/MonitorWorkspaceResourceOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor +{ + internal class MonitorWorkspaceResourceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MonitorWorkspaceResourceOperationSource(ArmClient client) + { + _client = client; + } + + MonitorWorkspaceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(document.RootElement); + return new MonitorWorkspaceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(document.RootElement); + return new MonitorWorkspaceResource(_client, data); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/PipelineGroupOperationSource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/PipelineGroupOperationSource.cs new file mode 100644 index 000000000000..062afe89cea6 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/PipelineGroupOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor +{ + internal class PipelineGroupOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal PipelineGroupOperationSource(ArmClient client) + { + _client = client; + } + + PipelineGroupResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = PipelineGroupData.DeserializePipelineGroupData(document.RootElement); + return new PipelineGroupResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = PipelineGroupData.DeserializePipelineGroupData(document.RootElement); + return new PipelineGroupResource(_client, data); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.Serialization.cs new file mode 100644 index 000000000000..dac9c71be98c --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class BatchProcessor : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchProcessor)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(BatchSize)) + { + writer.WritePropertyName("batchSize"u8); + writer.WriteNumberValue(BatchSize.Value); + } + if (Optional.IsDefined(Timeout)) + { + writer.WritePropertyName("timeout"u8); + writer.WriteNumberValue(Timeout.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + BatchProcessor IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BatchProcessor)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBatchProcessor(document.RootElement, options); + } + + internal static BatchProcessor DeserializeBatchProcessor(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? batchSize = default; + int? timeout = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("batchSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batchSize = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("timeout"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeout = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new BatchProcessor(batchSize, timeout, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(BatchProcessor)} does not support writing '{options.Format}' format."); + } + } + + BatchProcessor IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeBatchProcessor(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BatchProcessor)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.cs new file mode 100644 index 000000000000..02048d30feb3 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/BatchProcessor.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Batch processor. + public partial class BatchProcessor + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public BatchProcessor() + { + } + + /// Initializes a new instance of . + /// Size of the batch. + /// Timeout in milliseconds. + /// Keeps track of any properties unknown to the library. + internal BatchProcessor(int? batchSize, int? timeout, IDictionary serializedAdditionalRawData) + { + BatchSize = batchSize; + Timeout = timeout; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Size of the batch. + public int? BatchSize { get; set; } + /// Timeout in milliseconds. + public int? Timeout { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorProvisioningState.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorProvisioningState.cs index 4580a70b7d11..74b57e5f368a 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorProvisioningState.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorProvisioningState.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Monitor.Models { - /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. + /// The provisioning state of a resource. public readonly partial struct MonitorProvisioningState : IEquatable { private readonly string _value; @@ -22,22 +22,22 @@ public MonitorProvisioningState(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string CreatingValue = "Creating"; private const string SucceededValue = "Succeeded"; - private const string DeletingValue = "Deleting"; private const string FailedValue = "Failed"; private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; - /// Creating. - public static MonitorProvisioningState Creating { get; } = new MonitorProvisioningState(CreatingValue); - /// Succeeded. + /// Resource has been created. public static MonitorProvisioningState Succeeded { get; } = new MonitorProvisioningState(SucceededValue); - /// Deleting. - public static MonitorProvisioningState Deleting { get; } = new MonitorProvisioningState(DeletingValue); - /// Failed. + /// Resource creation failed. public static MonitorProvisioningState Failed { get; } = new MonitorProvisioningState(FailedValue); - /// Canceled. + /// Resource creation was canceled. public static MonitorProvisioningState Canceled { get; } = new MonitorProvisioningState(CanceledValue); + /// The resource is being created. + public static MonitorProvisioningState Creating { get; } = new MonitorProvisioningState(CreatingValue); + /// The resource is being deleted. + public static MonitorProvisioningState Deleting { get; } = new MonitorProvisioningState(DeletingValue); /// Determines if two values are the same. public static bool operator ==(MonitorProvisioningState left, MonitorProvisioningState right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.Serialization.cs new file mode 100644 index 000000000000..e55f99ed45f7 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsApiConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsApiConfig)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("dataCollectionEndpointUrl"u8); + writer.WriteStringValue(DataCollectionEndpointUri.AbsoluteUri); + writer.WritePropertyName("stream"u8); + writer.WriteStringValue(Stream); + writer.WritePropertyName("dataCollectionRule"u8); + writer.WriteStringValue(DataCollectionRule); + writer.WritePropertyName("schema"u8); + writer.WriteObjectValue(Schema, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsApiConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsApiConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsApiConfig(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsApiConfig DeserializeMonitorWorkspaceLogsApiConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri dataCollectionEndpointUrl = default; + string stream = default; + string dataCollectionRule = default; + MonitorWorkspaceLogsSchemaMap schema = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dataCollectionEndpointUrl"u8)) + { + dataCollectionEndpointUrl = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("stream"u8)) + { + stream = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataCollectionRule"u8)) + { + dataCollectionRule = property.Value.GetString(); + continue; + } + if (property.NameEquals("schema"u8)) + { + schema = MonitorWorkspaceLogsSchemaMap.DeserializeMonitorWorkspaceLogsSchemaMap(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsApiConfig(dataCollectionEndpointUrl, stream, dataCollectionRule, schema, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsApiConfig)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsApiConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsApiConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsApiConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.cs new file mode 100644 index 000000000000..fde7c209418a --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsApiConfig.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Azure Monitor Workspace Logs Api configurations. + public partial class MonitorWorkspaceLogsApiConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Data collection endpoint ingestion url. + /// Stream name in destination. Azure Monitor stream is related to the destination table. + /// Data Collection Rule (DCR) immutable id. + /// The schema mapping for incoming data. + /// , , or is null. + public MonitorWorkspaceLogsApiConfig(Uri dataCollectionEndpointUri, string stream, string dataCollectionRule, MonitorWorkspaceLogsSchemaMap schema) + { + Argument.AssertNotNull(dataCollectionEndpointUri, nameof(dataCollectionEndpointUri)); + Argument.AssertNotNull(stream, nameof(stream)); + Argument.AssertNotNull(dataCollectionRule, nameof(dataCollectionRule)); + Argument.AssertNotNull(schema, nameof(schema)); + + DataCollectionEndpointUri = dataCollectionEndpointUri; + Stream = stream; + DataCollectionRule = dataCollectionRule; + Schema = schema; + } + + /// Initializes a new instance of . + /// Data collection endpoint ingestion url. + /// Stream name in destination. Azure Monitor stream is related to the destination table. + /// Data Collection Rule (DCR) immutable id. + /// The schema mapping for incoming data. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsApiConfig(Uri dataCollectionEndpointUri, string stream, string dataCollectionRule, MonitorWorkspaceLogsSchemaMap schema, IDictionary serializedAdditionalRawData) + { + DataCollectionEndpointUri = dataCollectionEndpointUri; + Stream = stream; + DataCollectionRule = dataCollectionRule; + Schema = schema; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitorWorkspaceLogsApiConfig() + { + } + + /// Data collection endpoint ingestion url. + public Uri DataCollectionEndpointUri { get; set; } + /// Stream name in destination. Azure Monitor stream is related to the destination table. + public string Stream { get; set; } + /// Data Collection Rule (DCR) immutable id. + public string DataCollectionRule { get; set; } + /// The schema mapping for incoming data. + public MonitorWorkspaceLogsSchemaMap Schema { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.Serialization.cs new file mode 100644 index 000000000000..80b1837f6532 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporter.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsExporter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporter)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("api"u8); + writer.WriteObjectValue(Api, options); + if (Optional.IsDefined(Concurrency)) + { + writer.WritePropertyName("concurrency"u8); + writer.WriteObjectValue(Concurrency, options); + } + if (Optional.IsDefined(Cache)) + { + writer.WritePropertyName("cache"u8); + writer.WriteObjectValue(Cache, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsExporter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsExporter(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsExporter DeserializeMonitorWorkspaceLogsExporter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + MonitorWorkspaceLogsApiConfig api = default; + MonitorWorkspaceLogsExporterConcurrencyConfiguration concurrency = default; + MonitorWorkspaceLogsExporterCacheConfiguration cache = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("api"u8)) + { + api = MonitorWorkspaceLogsApiConfig.DeserializeMonitorWorkspaceLogsApiConfig(property.Value, options); + continue; + } + if (property.NameEquals("concurrency"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + concurrency = MonitorWorkspaceLogsExporterConcurrencyConfiguration.DeserializeMonitorWorkspaceLogsExporterConcurrencyConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("cache"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cache = MonitorWorkspaceLogsExporterCacheConfiguration.DeserializeMonitorWorkspaceLogsExporterCacheConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsExporter(api, concurrency, cache, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporter)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsExporter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsExporter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.Serialization.cs new file mode 100644 index 000000000000..392160487704 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsExporterCacheConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterCacheConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(MaxStorageUsage)) + { + writer.WritePropertyName("maxStorageUsage"u8); + writer.WriteNumberValue(MaxStorageUsage.Value); + } + if (Optional.IsDefined(RetentionPeriod)) + { + writer.WritePropertyName("retentionPeriod"u8); + writer.WriteNumberValue(RetentionPeriod.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsExporterCacheConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterCacheConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsExporterCacheConfiguration(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsExporterCacheConfiguration DeserializeMonitorWorkspaceLogsExporterCacheConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? maxStorageUsage = default; + int? retentionPeriod = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maxStorageUsage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maxStorageUsage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("retentionPeriod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retentionPeriod = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsExporterCacheConfiguration(maxStorageUsage, retentionPeriod, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterCacheConfiguration)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsExporterCacheConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsExporterCacheConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterCacheConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.cs new file mode 100644 index 000000000000..d5e6e39b9490 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterCacheConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Cache configurations. + public partial class MonitorWorkspaceLogsExporterCacheConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MonitorWorkspaceLogsExporterCacheConfiguration() + { + } + + /// Initializes a new instance of . + /// Max storage usage in megabytes. + /// Retention period in minutes. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsExporterCacheConfiguration(int? maxStorageUsage, int? retentionPeriod, IDictionary serializedAdditionalRawData) + { + MaxStorageUsage = maxStorageUsage; + RetentionPeriod = retentionPeriod; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Max storage usage in megabytes. + public int? MaxStorageUsage { get; set; } + /// Retention period in minutes. + public int? RetentionPeriod { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.Serialization.cs new file mode 100644 index 000000000000..865a3b8ea9fb --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsExporterConcurrencyConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterConcurrencyConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(WorkerCount)) + { + writer.WritePropertyName("workerCount"u8); + writer.WriteNumberValue(WorkerCount.Value); + } + if (Optional.IsDefined(BatchQueueSize)) + { + writer.WritePropertyName("batchQueueSize"u8); + writer.WriteNumberValue(BatchQueueSize.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsExporterConcurrencyConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterConcurrencyConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsExporterConcurrencyConfiguration(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsExporterConcurrencyConfiguration DeserializeMonitorWorkspaceLogsExporterConcurrencyConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? workerCount = default; + int? batchQueueSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("workerCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workerCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("batchQueueSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + batchQueueSize = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsExporterConcurrencyConfiguration(workerCount, batchQueueSize, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterConcurrencyConfiguration)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsExporterConcurrencyConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsExporterConcurrencyConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsExporterConcurrencyConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.cs new file mode 100644 index 000000000000..4c33766c83a0 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsExporterConcurrencyConfiguration.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Concurrent publishing configuration. + public partial class MonitorWorkspaceLogsExporterConcurrencyConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public MonitorWorkspaceLogsExporterConcurrencyConfiguration() + { + } + + /// Initializes a new instance of . + /// Number of parallel workers processing the log queues. + /// Size of the queue for log batches. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsExporterConcurrencyConfiguration(int? workerCount, int? batchQueueSize, IDictionary serializedAdditionalRawData) + { + WorkerCount = workerCount; + BatchQueueSize = batchQueueSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Number of parallel workers processing the log queues. + public int? WorkerCount { get; set; } + /// Size of the queue for log batches. + public int? BatchQueueSize { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.Serialization.cs new file mode 100644 index 000000000000..be0ac6921b79 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsRecordMap.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsRecordMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsRecordMap)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("from"u8); + writer.WriteStringValue(From); + writer.WritePropertyName("to"u8); + writer.WriteStringValue(To); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsRecordMap IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsRecordMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsRecordMap(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsRecordMap DeserializeMonitorWorkspaceLogsRecordMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string @from = default; + string to = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("from"u8)) + { + @from = property.Value.GetString(); + continue; + } + if (property.NameEquals("to"u8)) + { + to = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsRecordMap(@from, to, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsRecordMap)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsRecordMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsRecordMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsRecordMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.cs new file mode 100644 index 000000000000..eba157ef9957 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsResourceMap.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Resource map for schema in azure monitor. + public partial class MonitorWorkspaceLogsResourceMap + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Resource Map Key. + /// Resource Map Value. + /// or is null. + public MonitorWorkspaceLogsResourceMap(string @from, string to) + { + Argument.AssertNotNull(@from, nameof(@from)); + Argument.AssertNotNull(to, nameof(to)); + + From = @from; + To = to; + } + + /// Initializes a new instance of . + /// Resource Map Key. + /// Resource Map Value. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsResourceMap(string @from, string to, IDictionary serializedAdditionalRawData) + { + From = @from; + To = to; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitorWorkspaceLogsResourceMap() + { + } + + /// Resource Map Key. + public string From { get; set; } + /// Resource Map Value. + public string To { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.Serialization.cs new file mode 100644 index 000000000000..232c9b55097b --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class MonitorWorkspaceLogsSchemaMap : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsSchemaMap)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("recordMap"u8); + writer.WriteStartArray(); + foreach (var item in RecordMap) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(ResourceMap)) + { + writer.WritePropertyName("resourceMap"u8); + writer.WriteStartArray(); + foreach (var item in ResourceMap) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ScopeMap)) + { + writer.WritePropertyName("scopeMap"u8); + writer.WriteStartArray(); + foreach (var item in ScopeMap) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + MonitorWorkspaceLogsSchemaMap IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsSchemaMap)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMonitorWorkspaceLogsSchemaMap(document.RootElement, options); + } + + internal static MonitorWorkspaceLogsSchemaMap DeserializeMonitorWorkspaceLogsSchemaMap(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList recordMap = default; + IList resourceMap = default; + IList scopeMap = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recordMap"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MonitorWorkspaceLogsRecordMap.DeserializeMonitorWorkspaceLogsRecordMap(item, options)); + } + recordMap = array; + continue; + } + if (property.NameEquals("resourceMap"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MonitorWorkspaceLogsResourceMap.DeserializeMonitorWorkspaceLogsResourceMap(item, options)); + } + resourceMap = array; + continue; + } + if (property.NameEquals("scopeMap"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MonitorWorkspaceLogsScopeMap.DeserializeMonitorWorkspaceLogsScopeMap(item, options)); + } + scopeMap = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MonitorWorkspaceLogsSchemaMap(recordMap, resourceMap ?? new ChangeTrackingList(), scopeMap ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsSchemaMap)} does not support writing '{options.Format}' format."); + } + } + + MonitorWorkspaceLogsSchemaMap IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeMonitorWorkspaceLogsSchemaMap(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MonitorWorkspaceLogsSchemaMap)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.cs new file mode 100644 index 000000000000..0b99a79e0837 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsSchemaMap.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Schema map for azure monitor for logs. + public partial class MonitorWorkspaceLogsSchemaMap + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Record Map. + /// is null. + public MonitorWorkspaceLogsSchemaMap(IEnumerable recordMap) + { + Argument.AssertNotNull(recordMap, nameof(recordMap)); + + RecordMap = recordMap.ToList(); + ResourceMap = new ChangeTrackingList(); + ScopeMap = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Record Map. + /// Resource Map captures information about the entity for which telemetry is recorded. For example, metrics exposed by a Kubernetes container can be linked to a resource that specifies the cluster, namespace, pod, and container name.Resource may capture an entire hierarchy of entity identification. It may describe the host in the cloud and specific container or an application running in the process. + /// A scope map is a logical unit of the application code with which the emitted telemetry can be associated. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsSchemaMap(IList recordMap, IList resourceMap, IList scopeMap, IDictionary serializedAdditionalRawData) + { + RecordMap = recordMap; + ResourceMap = resourceMap; + ScopeMap = scopeMap; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitorWorkspaceLogsSchemaMap() + { + } + + /// Record Map. + public IList RecordMap { get; } + /// Resource Map captures information about the entity for which telemetry is recorded. For example, metrics exposed by a Kubernetes container can be linked to a resource that specifies the cluster, namespace, pod, and container name.Resource may capture an entire hierarchy of entity identification. It may describe the host in the cloud and specific container or an application running in the process. + public IList ResourceMap { get; } + /// A scope map is a logical unit of the application code with which the emitted telemetry can be associated. + public IList ScopeMap { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.cs new file mode 100644 index 000000000000..f7e7a6088ddf --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceLogsScopeMap.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Scope map for schema in azure monitor. + public partial class MonitorWorkspaceLogsScopeMap + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Scope Map Key. + /// Scope Map Value. + /// or is null. + public MonitorWorkspaceLogsScopeMap(string @from, string to) + { + Argument.AssertNotNull(@from, nameof(@from)); + Argument.AssertNotNull(to, nameof(to)); + + From = @from; + To = to; + } + + /// Initializes a new instance of . + /// Scope Map Key. + /// Scope Map Value. + /// Keeps track of any properties unknown to the library. + internal MonitorWorkspaceLogsScopeMap(string @from, string to, IDictionary serializedAdditionalRawData) + { + From = @from; + To = to; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal MonitorWorkspaceLogsScopeMap() + { + } + + /// Scope Map Key. + public string From { get; set; } + /// Scope Map Value. + public string To { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetricProperties.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetricProperties.cs index 06eaca3e7f3a..07e2695ccf63 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetricProperties.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetricProperties.cs @@ -46,7 +46,7 @@ public partial class MonitorWorkspaceMetricProperties private protected IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal MonitorWorkspaceMetricProperties() + public MonitorWorkspaceMetricProperties() { } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetrics.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetrics.cs index ffde5a951407..e7dc70fb484b 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetrics.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceMetrics.cs @@ -10,11 +10,11 @@ namespace Azure.ResourceManager.Monitor.Models { - /// Information about metrics for the Azure Monitor workspace. + /// Properties related to the metrics container in the Azure Monitor Workspace. public partial class MonitorWorkspaceMetrics : MonitorWorkspaceMetricProperties { /// Initializes a new instance of . - internal MonitorWorkspaceMetrics() + public MonitorWorkspaceMetrics() { } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePrivateEndpointConnection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePrivateEndpointConnection.cs index 1a70674f04dc..ad55b8582e0e 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePrivateEndpointConnection.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePrivateEndpointConnection.cs @@ -49,7 +49,7 @@ public partial class MonitorWorkspacePrivateEndpointConnection : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal MonitorWorkspacePrivateEndpointConnection() + public MonitorWorkspacePrivateEndpointConnection() { GroupIds = new ChangeTrackingList(); } @@ -76,15 +76,15 @@ internal MonitorWorkspacePrivateEndpointConnection(ResourceIdentifier id, string /// The group ids for the private endpoint resource. public IReadOnlyList GroupIds { get; } /// The private endpoint resource. - internal SubResource PrivateEndpoint { get; } + internal SubResource PrivateEndpoint { get; set; } /// Gets Id. public ResourceIdentifier PrivateEndpointId { - get => PrivateEndpoint?.Id; + get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; } /// A collection of information about the state of the connection between service consumer and provider. - public MonitorPrivateLinkServiceConnectionState ConnectionState { get; } + public MonitorPrivateLinkServiceConnectionState ConnectionState { get; set; } /// The provisioning state of the private endpoint connection resource. public MonitorPrivateEndpointConnectionProvisioningState? ProvisioningState { get; } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePublicNetworkAccess.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePublicNetworkAccess.cs index 860c2618eefd..dd3d91121877 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePublicNetworkAccess.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspacePublicNetworkAccess.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Monitor.Models { - /// Gets or sets allow or disallow public network access to workspace. + /// State of the public network access. public readonly partial struct MonitorWorkspacePublicNetworkAccess : IEquatable { private readonly string _value; @@ -25,9 +25,9 @@ public MonitorWorkspacePublicNetworkAccess(string value) private const string EnabledValue = "Enabled"; private const string DisabledValue = "Disabled"; - /// Enabled. + /// The public network access is enabled. public static MonitorWorkspacePublicNetworkAccess Enabled { get; } = new MonitorWorkspacePublicNetworkAccess(EnabledValue); - /// Disabled. + /// The public network access is disabled. public static MonitorWorkspacePublicNetworkAccess Disabled { get; } = new MonitorWorkspacePublicNetworkAccess(DisabledValue); /// Determines if two values are the same. public static bool operator ==(MonitorWorkspacePublicNetworkAccess left, MonitorWorkspacePublicNetworkAccess right) => left.Equals(right); diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.Serialization.cs index e2dbd6986109..317ff14eb54e 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.Serialization.cs @@ -36,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -77,7 +77,7 @@ internal static MonitorWorkspaceResourceListResult DeserializeMonitorWorkspaceRe return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,7 +94,11 @@ internal static MonitorWorkspaceResourceListResult DeserializeMonitorWorkspaceRe } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.cs index 8bc701d8b4de..8c82142ca1c1 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourceListResult.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Monitor.Models { - /// A pageable list of resources. + /// The response of a AzureMonitorWorkspace list operation. internal partial class MonitorWorkspaceResourceListResult { /// @@ -47,7 +47,7 @@ internal partial class MonitorWorkspaceResourceListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// A list of resources. + /// The AzureMonitorWorkspace items on this page. /// is null. internal MonitorWorkspaceResourceListResult(IEnumerable value) { @@ -57,10 +57,10 @@ internal MonitorWorkspaceResourceListResult(IEnumerable Initializes a new instance of . - /// A list of resources. - /// The URL to use for getting the next set of results. + /// The AzureMonitorWorkspace items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal MonitorWorkspaceResourceListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal MonitorWorkspaceResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -72,9 +72,9 @@ internal MonitorWorkspaceResourceListResult() { } - /// A list of resources. + /// The AzureMonitorWorkspace items on this page. public IReadOnlyList Value { get; } - /// The URL to use for getting the next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.Serialization.cs index ba2a1cf7c589..c318abfb7e0d 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.Serialization.cs @@ -37,6 +37,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteEndObject(); } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteObjectValue(Metrics, options); + } + writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -76,6 +84,7 @@ internal static MonitorWorkspaceResourcePatch DeserializeMonitorWorkspaceResourc return null; } IDictionary tags = default; + MonitorWorkspaceMetricProperties metrics = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -94,13 +103,34 @@ internal static MonitorWorkspaceResourcePatch DeserializeMonitorWorkspaceResourc tags = dictionary; continue; } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("metrics"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metrics = MonitorWorkspaceMetricProperties.DeserializeMonitorWorkspaceMetricProperties(property0.Value, options); + continue; + } + } + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new MonitorWorkspaceResourcePatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new MonitorWorkspaceResourcePatch(tags ?? new ChangeTrackingDictionary(), metrics, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.cs index 30fcd75d8482..fc0d1562c448 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/MonitorWorkspaceResourcePatch.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Monitor.Models { - /// Definition of ARM tracked top level resource properties for update operation. + /// The type used for update operations of the AzureMonitorWorkspace. public partial class MonitorWorkspaceResourcePatch { /// @@ -53,14 +53,18 @@ public MonitorWorkspaceResourcePatch() /// Initializes a new instance of . /// Resource tags. + /// Information about metrics for the Azure Monitor workspace. /// Keeps track of any properties unknown to the library. - internal MonitorWorkspaceResourcePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + internal MonitorWorkspaceResourcePatch(IDictionary tags, MonitorWorkspaceMetricProperties metrics, IDictionary serializedAdditionalRawData) { Tags = tags; + Metrics = metrics; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Resource tags. public IDictionary Tags { get; } + /// Information about metrics for the Azure Monitor workspace. + public MonitorWorkspaceMetricProperties Metrics { get; set; } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.Serialization.cs new file mode 100644 index 000000000000..396553c8a4fe --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + internal partial class OtlpReceiver : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OtlpReceiver)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + OtlpReceiver IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OtlpReceiver)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOtlpReceiver(document.RootElement, options); + } + + internal static OtlpReceiver DeserializeOtlpReceiver(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpoint"u8)) + { + endpoint = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OtlpReceiver(endpoint, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(OtlpReceiver)} does not support writing '{options.Format}' format."); + } + } + + OtlpReceiver IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeOtlpReceiver(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OtlpReceiver)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.cs new file mode 100644 index 000000000000..7353d763248b --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/OtlpReceiver.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// OTLP Receiver. + internal partial class OtlpReceiver + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// OTLP GRPC endpoint definition. Example: 0.0.0.0:<port>. + /// is null. + public OtlpReceiver(string endpoint) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + + Endpoint = endpoint; + } + + /// Initializes a new instance of . + /// OTLP GRPC endpoint definition. Example: 0.0.0.0:<port>. + /// Keeps track of any properties unknown to the library. + internal OtlpReceiver(string endpoint, IDictionary serializedAdditionalRawData) + { + Endpoint = endpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OtlpReceiver() + { + } + + /// OTLP GRPC endpoint definition. Example: 0.0.0.0:<port>. + public string Endpoint { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.cs new file mode 100644 index 000000000000..a518ca42769c --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporter.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Exporter Info. + public partial class PipelineGroupExporter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of exporter. + /// The name of exporter. + /// is null. + public PipelineGroupExporter(PipelineGroupExporterType exporterType, string name) + { + Argument.AssertNotNull(name, nameof(name)); + + ExporterType = exporterType; + Name = name; + } + + /// Initializes a new instance of . + /// The type of exporter. + /// The name of exporter. + /// Azure Monitor Workspace Logs specific configurations. + /// TCP based exporter. Used for pipelineGroup exporter. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupExporter(PipelineGroupExporterType exporterType, string name, MonitorWorkspaceLogsExporter azureMonitorWorkspaceLogs, TcpExporter tcp, IDictionary serializedAdditionalRawData) + { + ExporterType = exporterType; + Name = name; + AzureMonitorWorkspaceLogs = azureMonitorWorkspaceLogs; + Tcp = tcp; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupExporter() + { + } + + /// The type of exporter. + public PipelineGroupExporterType ExporterType { get; set; } + /// The name of exporter. + public string Name { get; set; } + /// Azure Monitor Workspace Logs specific configurations. + public MonitorWorkspaceLogsExporter AzureMonitorWorkspaceLogs { get; set; } + /// TCP based exporter. Used for pipelineGroup exporter. + internal TcpExporter Tcp { get; set; } + /// TCP url to export. + public Uri TcpUri + { + get => Tcp is null ? default : Tcp.Uri; + set => Tcp = new TcpExporter(value); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporterType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporterType.cs new file mode 100644 index 000000000000..834d29802644 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExporterType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The exporter type. + public readonly partial struct PipelineGroupExporterType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PipelineGroupExporterType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AzureMonitorWorkspaceLogsValue = "AzureMonitorWorkspaceLogs"; + private const string PipelineGroupValue = "PipelineGroup"; + + /// Export logs to Azure Monitor Workspace. + public static PipelineGroupExporterType AzureMonitorWorkspaceLogs { get; } = new PipelineGroupExporterType(AzureMonitorWorkspaceLogsValue); + /// Export data to another pipeline group instance. + public static PipelineGroupExporterType PipelineGroup { get; } = new PipelineGroupExporterType(PipelineGroupValue); + /// Determines if two values are the same. + public static bool operator ==(PipelineGroupExporterType left, PipelineGroupExporterType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PipelineGroupExporterType left, PipelineGroupExporterType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PipelineGroupExporterType(string value) => new PipelineGroupExporterType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PipelineGroupExporterType other && Equals(other); + /// + public bool Equals(PipelineGroupExporterType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExternalNetworkingMode.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExternalNetworkingMode.cs new file mode 100644 index 000000000000..f459fcdcd780 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupExternalNetworkingMode.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The mode of the external networking. + public readonly partial struct PipelineGroupExternalNetworkingMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PipelineGroupExternalNetworkingMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LoadBalancerOnlyValue = "LoadBalancerOnly"; + + /// Load balancer only. + public static PipelineGroupExternalNetworkingMode LoadBalancerOnly { get; } = new PipelineGroupExternalNetworkingMode(LoadBalancerOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(PipelineGroupExternalNetworkingMode left, PipelineGroupExternalNetworkingMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PipelineGroupExternalNetworkingMode left, PipelineGroupExternalNetworkingMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PipelineGroupExternalNetworkingMode(string value) => new PipelineGroupExternalNetworkingMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PipelineGroupExternalNetworkingMode other && Equals(other); + /// + public bool Equals(PipelineGroupExternalNetworkingMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.Serialization.cs new file mode 100644 index 000000000000..76bec4b1aa3a --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupNetworkingConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupNetworkingConfiguration)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("externalNetworkingMode"u8); + writer.WriteStringValue(ExternalNetworkingMode.ToString()); + if (Optional.IsDefined(Host)) + { + writer.WritePropertyName("host"u8); + writer.WriteStringValue(Host); + } + writer.WritePropertyName("routes"u8); + writer.WriteStartArray(); + foreach (var item in Routes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupNetworkingConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupNetworkingConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupNetworkingConfiguration(document.RootElement, options); + } + + internal static PipelineGroupNetworkingConfiguration DeserializePipelineGroupNetworkingConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PipelineGroupExternalNetworkingMode externalNetworkingMode = default; + string host = default; + IList routes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("externalNetworkingMode"u8)) + { + externalNetworkingMode = new PipelineGroupExternalNetworkingMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("host"u8)) + { + host = property.Value.GetString(); + continue; + } + if (property.NameEquals("routes"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PipelineGroupNetworkingRoute.DeserializePipelineGroupNetworkingRoute(item, options)); + } + routes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupNetworkingConfiguration(externalNetworkingMode, host, routes, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupNetworkingConfiguration)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupNetworkingConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupNetworkingConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupNetworkingConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.cs new file mode 100644 index 000000000000..27d3bfe7e2c2 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingConfiguration.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Networking configuration for the pipeline group instance. + public partial class PipelineGroupNetworkingConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// External networking mode. + /// Networking routes configuration. + /// is null. + public PipelineGroupNetworkingConfiguration(PipelineGroupExternalNetworkingMode externalNetworkingMode, IEnumerable routes) + { + Argument.AssertNotNull(routes, nameof(routes)); + + ExternalNetworkingMode = externalNetworkingMode; + Routes = routes.ToList(); + } + + /// Initializes a new instance of . + /// External networking mode. + /// The address exposed on the cluster. Example: azuremonitorpipeline.contoso.com. + /// Networking routes configuration. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupNetworkingConfiguration(PipelineGroupExternalNetworkingMode externalNetworkingMode, string host, IList routes, IDictionary serializedAdditionalRawData) + { + ExternalNetworkingMode = externalNetworkingMode; + Host = host; + Routes = routes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupNetworkingConfiguration() + { + } + + /// External networking mode. + public PipelineGroupExternalNetworkingMode ExternalNetworkingMode { get; set; } + /// The address exposed on the cluster. Example: azuremonitorpipeline.contoso.com. + public string Host { get; set; } + /// Networking routes configuration. + public IList Routes { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.Serialization.cs new file mode 100644 index 000000000000..89e90fddc0df --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupNetworkingRoute : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupNetworkingRoute)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("receiver"u8); + writer.WriteStringValue(Receiver); + if (Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port.Value); + } + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"u8); + writer.WriteStringValue(Path); + } + if (Optional.IsDefined(Subdomain)) + { + writer.WritePropertyName("subdomain"u8); + writer.WriteStringValue(Subdomain); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupNetworkingRoute IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupNetworkingRoute)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupNetworkingRoute(document.RootElement, options); + } + + internal static PipelineGroupNetworkingRoute DeserializePipelineGroupNetworkingRoute(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string receiver = default; + int? port = default; + string path = default; + string subdomain = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("receiver"u8)) + { + receiver = property.Value.GetString(); + continue; + } + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("path"u8)) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("subdomain"u8)) + { + subdomain = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupNetworkingRoute(receiver, port, path, subdomain, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupNetworkingRoute)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupNetworkingRoute IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupNetworkingRoute(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupNetworkingRoute)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.cs new file mode 100644 index 000000000000..62835f25833d --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupNetworkingRoute.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Networking route configuration. + public partial class PipelineGroupNetworkingRoute + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The name of the previously defined receiver. + /// is null. + public PipelineGroupNetworkingRoute(string receiver) + { + Argument.AssertNotNull(receiver, nameof(receiver)); + + Receiver = receiver; + } + + /// Initializes a new instance of . + /// The name of the previously defined receiver. + /// The port that will be configured externally. If not specified, it will use the port from the receiver definition. + /// Route path. + /// Route subdomain. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupNetworkingRoute(string receiver, int? port, string path, string subdomain, IDictionary serializedAdditionalRawData) + { + Receiver = receiver; + Port = port; + Path = path; + Subdomain = subdomain; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupNetworkingRoute() + { + } + + /// The name of the previously defined receiver. + public string Receiver { get; set; } + /// The port that will be configured externally. If not specified, it will use the port from the receiver definition. + public int? Port { get; set; } + /// Route path. + public string Path { get; set; } + /// Route subdomain. + public string Subdomain { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.Serialization.cs new file mode 100644 index 000000000000..8e87bc361cbb --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.Serialization.cs @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupPatch)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Replicas)) + { + writer.WritePropertyName("replicas"u8); + writer.WriteNumberValue(Replicas.Value); + } + if (Optional.IsCollectionDefined(Receivers)) + { + writer.WritePropertyName("receivers"u8); + writer.WriteStartArray(); + foreach (var item in Receivers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Processors)) + { + writer.WritePropertyName("processors"u8); + writer.WriteStartArray(); + foreach (var item in Processors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Exporters)) + { + writer.WritePropertyName("exporters"u8); + writer.WriteStartArray(); + foreach (var item in Exporters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Service)) + { + writer.WritePropertyName("service"u8); + writer.WriteObjectValue(Service, options); + } + if (Optional.IsCollectionDefined(NetworkingConfigurations)) + { + writer.WritePropertyName("networkingConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in NetworkingConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupPatch(document.RootElement, options); + } + + internal static PipelineGroupPatch DeserializePipelineGroupPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + int? replicas = default; + IList receivers = default; + IList processors = default; + IList exporters = default; + PipelineGroupService service = default; + IList networkingConfigurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("replicas"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + replicas = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("receivers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupReceiver.DeserializePipelineGroupReceiver(item, options)); + } + receivers = array; + continue; + } + if (property0.NameEquals("processors"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupProcessor.DeserializePipelineGroupProcessor(item, options)); + } + processors = array; + continue; + } + if (property0.NameEquals("exporters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupExporter.DeserializePipelineGroupExporter(item, options)); + } + exporters = array; + continue; + } + if (property0.NameEquals("service"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + service = PipelineGroupService.DeserializePipelineGroupService(property0.Value, options); + continue; + } + if (property0.NameEquals("networkingConfigurations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupNetworkingConfiguration.DeserializePipelineGroupNetworkingConfiguration(item, options)); + } + networkingConfigurations = array; + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupPatch( + tags ?? new ChangeTrackingDictionary(), + replicas, + receivers ?? new ChangeTrackingList(), + processors ?? new ChangeTrackingList(), + exporters ?? new ChangeTrackingList(), + service, + networkingConfigurations ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupPatch)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.cs new file mode 100644 index 000000000000..b275ee25a2ab --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupPatch.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The type used for update operations of the PipelineGroup. + public partial class PipelineGroupPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public PipelineGroupPatch() + { + Tags = new ChangeTrackingDictionary(); + Receivers = new ChangeTrackingList(); + Processors = new ChangeTrackingList(); + Exporters = new ChangeTrackingList(); + NetworkingConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Defines the amount of replicas of the pipeline group instance. + /// The receivers specified for a pipeline group instance. + /// The processors specified for a pipeline group instance. + /// The exporters specified for a pipeline group instance. + /// The service section for a given pipeline group instance. + /// Networking configurations for the pipeline group instance. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupPatch(IDictionary tags, int? replicas, IList receivers, IList processors, IList exporters, PipelineGroupService service, IList networkingConfigurations, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Replicas = replicas; + Receivers = receivers; + Processors = processors; + Exporters = exporters; + Service = service; + NetworkingConfigurations = networkingConfigurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// Defines the amount of replicas of the pipeline group instance. + public int? Replicas { get; set; } + /// The receivers specified for a pipeline group instance. + public IList Receivers { get; } + /// The processors specified for a pipeline group instance. + public IList Processors { get; } + /// The exporters specified for a pipeline group instance. + public IList Exporters { get; } + /// The service section for a given pipeline group instance. + public PipelineGroupService Service { get; set; } + /// Networking configurations for the pipeline group instance. + public IList NetworkingConfigurations { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessorType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessorType.cs new file mode 100644 index 000000000000..c6d676cb5e20 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupProcessorType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The processor type. + public readonly partial struct PipelineGroupProcessorType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PipelineGroupProcessorType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BatchValue = "Batch"; + + /// Batch processor. + public static PipelineGroupProcessorType Batch { get; } = new PipelineGroupProcessorType(BatchValue); + /// Determines if two values are the same. + public static bool operator ==(PipelineGroupProcessorType left, PipelineGroupProcessorType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PipelineGroupProcessorType left, PipelineGroupProcessorType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PipelineGroupProcessorType(string value) => new PipelineGroupProcessorType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PipelineGroupProcessorType other && Equals(other); + /// + public bool Equals(PipelineGroupProcessorType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.Serialization.cs new file mode 100644 index 000000000000..9ffe893a9635 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupReceiver : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupReceiver)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ReceiverType.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (Optional.IsDefined(Syslog)) + { + writer.WritePropertyName("syslog"u8); + writer.WriteObjectValue(Syslog, options); + } + if (Optional.IsDefined(Otlp)) + { + writer.WritePropertyName("otlp"u8); + writer.WriteObjectValue(Otlp, options); + } + if (Optional.IsDefined(Udp)) + { + writer.WritePropertyName("udp"u8); + writer.WriteObjectValue(Udp, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupReceiver IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupReceiver)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupReceiver(document.RootElement, options); + } + + internal static PipelineGroupReceiver DeserializePipelineGroupReceiver(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PipelineGroupReceiverType type = default; + string name = default; + SyslogReceiver syslog = default; + OtlpReceiver otlp = default; + UdpReceiver udp = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new PipelineGroupReceiverType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("syslog"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + syslog = SyslogReceiver.DeserializeSyslogReceiver(property.Value, options); + continue; + } + if (property.NameEquals("otlp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + otlp = OtlpReceiver.DeserializeOtlpReceiver(property.Value, options); + continue; + } + if (property.NameEquals("udp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + udp = UdpReceiver.DeserializeUdpReceiver(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupReceiver( + type, + name, + syslog, + otlp, + udp, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupReceiver)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupReceiver IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupReceiver(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupReceiver)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.cs new file mode 100644 index 000000000000..5133fce1a71c --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiver.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Receiver Info. + public partial class PipelineGroupReceiver + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The type of receiver. + /// The name of receiver. + /// is null. + public PipelineGroupReceiver(PipelineGroupReceiverType receiverType, string name) + { + Argument.AssertNotNull(name, nameof(name)); + + ReceiverType = receiverType; + Name = name; + } + + /// Initializes a new instance of . + /// The type of receiver. + /// The name of receiver. + /// Syslog configurations. This field is mandatory for syslog type receivers. + /// OTLP receiver configurations. This field is mandatory for OTLP and pipelineGroup receivers. + /// UDP receiver configurations. This field is mandatory for UDP receivers. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupReceiver(PipelineGroupReceiverType receiverType, string name, SyslogReceiver syslog, OtlpReceiver otlp, UdpReceiver udp, IDictionary serializedAdditionalRawData) + { + ReceiverType = receiverType; + Name = name; + Syslog = syslog; + Otlp = otlp; + Udp = udp; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupReceiver() + { + } + + /// The type of receiver. + public PipelineGroupReceiverType ReceiverType { get; set; } + /// The name of receiver. + public string Name { get; set; } + /// Syslog configurations. This field is mandatory for syslog type receivers. + public SyslogReceiver Syslog { get; set; } + /// OTLP receiver configurations. This field is mandatory for OTLP and pipelineGroup receivers. + internal OtlpReceiver Otlp { get; set; } + /// OTLP GRPC endpoint definition. Example: 0.0.0.0:<port>. + public string OtlpEndpoint + { + get => Otlp is null ? default : Otlp.Endpoint; + set => Otlp = new OtlpReceiver(value); + } + + /// UDP receiver configurations. This field is mandatory for UDP receivers. + public UdpReceiver Udp { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiverType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiverType.cs new file mode 100644 index 000000000000..2eb569845bbf --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupReceiverType.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The receiver type. + public readonly partial struct PipelineGroupReceiverType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PipelineGroupReceiverType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SyslogValue = "Syslog"; + private const string AmaValue = "Ama"; + private const string PipelineGroupValue = "PipelineGroup"; + private const string OtlpValue = "OTLP"; + private const string UdpValue = "UDP"; + + /// Linux syslog. + public static PipelineGroupReceiverType Syslog { get; } = new PipelineGroupReceiverType(SyslogValue); + /// Receives data from azure monitor agent receiver. + public static PipelineGroupReceiverType Ama { get; } = new PipelineGroupReceiverType(AmaValue); + /// Receives data from another pipeline group. + public static PipelineGroupReceiverType PipelineGroup { get; } = new PipelineGroupReceiverType(PipelineGroupValue); + /// Receives data from a OTLP collector. + public static PipelineGroupReceiverType Otlp { get; } = new PipelineGroupReceiverType(OtlpValue); + /// Receives data from an UDP collector. + public static PipelineGroupReceiverType Udp { get; } = new PipelineGroupReceiverType(UdpValue); + /// Determines if two values are the same. + public static bool operator ==(PipelineGroupReceiverType left, PipelineGroupReceiverType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PipelineGroupReceiverType left, PipelineGroupReceiverType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PipelineGroupReceiverType(string value) => new PipelineGroupReceiverType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PipelineGroupReceiverType other && Equals(other); + /// + public bool Equals(PipelineGroupReceiverType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.Serialization.cs new file mode 100644 index 000000000000..3111989661ac --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupService : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupService)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("pipelines"u8); + writer.WriteStartArray(); + foreach (var item in Pipelines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(Persistence)) + { + writer.WritePropertyName("persistence"u8); + writer.WriteObjectValue(Persistence, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupService IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupService)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupService(document.RootElement, options); + } + + internal static PipelineGroupService DeserializePipelineGroupService(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList pipelines = default; + PipelineGroupServicePersistenceConfigurations persistence = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pipelines"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PipelineGroupServicePipeline.DeserializePipelineGroupServicePipeline(item, options)); + } + pipelines = array; + continue; + } + if (property.NameEquals("persistence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + persistence = PipelineGroupServicePersistenceConfigurations.DeserializePipelineGroupServicePersistenceConfigurations(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupService(pipelines, persistence, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupService)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupService IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupService(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupService)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.cs new file mode 100644 index 000000000000..1f4f8eb1b249 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupService.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Service Info. + public partial class PipelineGroupService + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Pipelines belonging to a given pipeline group. + /// is null. + public PipelineGroupService(IEnumerable pipelines) + { + Argument.AssertNotNull(pipelines, nameof(pipelines)); + + Pipelines = pipelines.ToList(); + } + + /// Initializes a new instance of . + /// Pipelines belonging to a given pipeline group. + /// Persistence options to all pipelines in the instance. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupService(IList pipelines, PipelineGroupServicePersistenceConfigurations persistence, IDictionary serializedAdditionalRawData) + { + Pipelines = pipelines; + Persistence = persistence; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupService() + { + } + + /// Pipelines belonging to a given pipeline group. + public IList Pipelines { get; } + /// Persistence options to all pipelines in the instance. + internal PipelineGroupServicePersistenceConfigurations Persistence { get; set; } + /// The name of the mounted persistent volume. + public string PersistencePersistentVolumeName + { + get => Persistence is null ? default : Persistence.PersistentVolumeName; + set => Persistence = new PipelineGroupServicePersistenceConfigurations(value); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.Serialization.cs new file mode 100644 index 000000000000..dd5f67c1cd10 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePersistenceConfigurations.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + internal partial class PipelineGroupServicePersistenceConfigurations : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupServicePersistenceConfigurations)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("persistentVolumeName"u8); + writer.WriteStringValue(PersistentVolumeName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupServicePersistenceConfigurations IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupServicePersistenceConfigurations)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupServicePersistenceConfigurations(document.RootElement, options); + } + + internal static PipelineGroupServicePersistenceConfigurations DeserializePipelineGroupServicePersistenceConfigurations(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string persistentVolumeName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("persistentVolumeName"u8)) + { + persistentVolumeName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupServicePersistenceConfigurations(persistentVolumeName, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupServicePersistenceConfigurations)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupServicePersistenceConfigurations IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupServicePersistenceConfigurations(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupServicePersistenceConfigurations)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.Serialization.cs new file mode 100644 index 000000000000..ddf3ed28f0ce --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class PipelineGroupServicePipeline : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupServicePipeline)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(PipelineType.ToString()); + writer.WritePropertyName("receivers"u8); + writer.WriteStartArray(); + foreach (var item in Receivers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (Optional.IsCollectionDefined(Processors)) + { + writer.WritePropertyName("processors"u8); + writer.WriteStartArray(); + foreach (var item in Processors) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("exporters"u8); + writer.WriteStartArray(); + foreach (var item in Exporters) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupServicePipeline IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupServicePipeline)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupServicePipeline(document.RootElement, options); + } + + internal static PipelineGroupServicePipeline DeserializePipelineGroupServicePipeline(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + PipelineGroupServicePipelineType type = default; + IList receivers = default; + IList processors = default; + IList exporters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new PipelineGroupServicePipelineType(property.Value.GetString()); + continue; + } + if (property.NameEquals("receivers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + receivers = array; + continue; + } + if (property.NameEquals("processors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + processors = array; + continue; + } + if (property.NameEquals("exporters"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + exporters = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupServicePipeline( + name, + type, + receivers, + processors ?? new ChangeTrackingList(), + exporters, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupServicePipeline)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupServicePipeline IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupServicePipeline(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupServicePipeline)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.cs new file mode 100644 index 000000000000..cc91c7001948 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipeline.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Pipeline Info. + public partial class PipelineGroupServicePipeline + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the pipeline. + /// The type of pipeline. + /// Reference to receivers configured for the pipeline. + /// Reference to exporters configured for the pipeline. + /// , or is null. + public PipelineGroupServicePipeline(string name, PipelineGroupServicePipelineType pipelineType, IEnumerable receivers, IEnumerable exporters) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(receivers, nameof(receivers)); + Argument.AssertNotNull(exporters, nameof(exporters)); + + Name = name; + PipelineType = pipelineType; + Receivers = receivers.ToList(); + Processors = new ChangeTrackingList(); + Exporters = exporters.ToList(); + } + + /// Initializes a new instance of . + /// Name of the pipeline. + /// The type of pipeline. + /// Reference to receivers configured for the pipeline. + /// Reference to processors configured for the pipeline. + /// Reference to exporters configured for the pipeline. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupServicePipeline(string name, PipelineGroupServicePipelineType pipelineType, IList receivers, IList processors, IList exporters, IDictionary serializedAdditionalRawData) + { + Name = name; + PipelineType = pipelineType; + Receivers = receivers; + Processors = processors; + Exporters = exporters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupServicePipeline() + { + } + + /// Name of the pipeline. + public string Name { get; set; } + /// The type of pipeline. + public PipelineGroupServicePipelineType PipelineType { get; set; } + /// Reference to receivers configured for the pipeline. + public IList Receivers { get; } + /// Reference to processors configured for the pipeline. + public IList Processors { get; } + /// Reference to exporters configured for the pipeline. + public IList Exporters { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipelineType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipelineType.cs new file mode 100644 index 000000000000..e1e2db11c883 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/PipelineGroupServicePipelineType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The pipeline type. + public readonly partial struct PipelineGroupServicePipelineType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PipelineGroupServicePipelineType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LogsValue = "logs"; + + /// Pipeline for logs telemetry. + public static PipelineGroupServicePipelineType Logs { get; } = new PipelineGroupServicePipelineType(LogsValue); + /// Determines if two values are the same. + public static bool operator ==(PipelineGroupServicePipelineType left, PipelineGroupServicePipelineType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PipelineGroupServicePipelineType left, PipelineGroupServicePipelineType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PipelineGroupServicePipelineType(string value) => new PipelineGroupServicePipelineType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PipelineGroupServicePipelineType other && Equals(other); + /// + public bool Equals(PipelineGroupServicePipelineType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/StreamEncodingType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/StreamEncodingType.cs new file mode 100644 index 000000000000..8df0a11e46eb --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/StreamEncodingType.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The encoding of the stream being received. + public readonly partial struct StreamEncodingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public StreamEncodingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NopValue = "nop"; + private const string Utf8Value = "utf-8"; + private const string Utf16LeValue = "utf-16le"; + private const string Utf16BeValue = "utf-16be"; + private const string AsciiValue = "ascii"; + private const string Big5Value = "big5"; + + /// No encoding validation. Treats the file as a stream of raw bytes. + public static StreamEncodingType Nop { get; } = new StreamEncodingType(NopValue); + /// UTF-8 encoding. + public static StreamEncodingType Utf8 { get; } = new StreamEncodingType(Utf8Value); + /// UTF-16 encoding with little-endian byte order. + public static StreamEncodingType Utf16Le { get; } = new StreamEncodingType(Utf16LeValue); + /// UTF-16 encoding with little-endian byte order. + public static StreamEncodingType Utf16Be { get; } = new StreamEncodingType(Utf16BeValue); + /// ASCII encoding. + public static StreamEncodingType Ascii { get; } = new StreamEncodingType(AsciiValue); + /// The Big5 Chinese character encoding. + public static StreamEncodingType Big5 { get; } = new StreamEncodingType(Big5Value); + /// Determines if two values are the same. + public static bool operator ==(StreamEncodingType left, StreamEncodingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(StreamEncodingType left, StreamEncodingType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator StreamEncodingType(string value) => new StreamEncodingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is StreamEncodingType other && Equals(other); + /// + public bool Equals(StreamEncodingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogProtocol.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogProtocol.cs new file mode 100644 index 000000000000..f156f71c9c83 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogProtocol.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Protocol to parse syslog messages. Default rfc3164. + public readonly partial struct SyslogProtocol : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SyslogProtocol(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string Rfc3164Value = "rfc3164"; + private const string Rfc5424Value = "rfc5424"; + + /// rfc3164 protocol. + public static SyslogProtocol Rfc3164 { get; } = new SyslogProtocol(Rfc3164Value); + /// rfc5424 protocol. + public static SyslogProtocol Rfc5424 { get; } = new SyslogProtocol(Rfc5424Value); + /// Determines if two values are the same. + public static bool operator ==(SyslogProtocol left, SyslogProtocol right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SyslogProtocol left, SyslogProtocol right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator SyslogProtocol(string value) => new SyslogProtocol(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SyslogProtocol other && Equals(other); + /// + public bool Equals(SyslogProtocol other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.cs new file mode 100644 index 000000000000..25ae7aba7f9d --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/SyslogReceiver.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Base receiver using TCP as transport protocol. + public partial class SyslogReceiver + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Syslog receiver endpoint definition. Example: 0.0.0.0:<port>. + /// is null. + public SyslogReceiver(string endpoint) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + + Endpoint = endpoint; + } + + /// Initializes a new instance of . + /// Syslog receiver endpoint definition. Example: 0.0.0.0:<port>. + /// Protocol to parse syslog messages. Default rfc3164. + /// Keeps track of any properties unknown to the library. + internal SyslogReceiver(string endpoint, SyslogProtocol? protocol, IDictionary serializedAdditionalRawData) + { + Endpoint = endpoint; + Protocol = protocol; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SyslogReceiver() + { + } + + /// Syslog receiver endpoint definition. Example: 0.0.0.0:<port>. + public string Endpoint { get; set; } + /// Protocol to parse syslog messages. Default rfc3164. + public SyslogProtocol? Protocol { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.Serialization.cs new file mode 100644 index 000000000000..086526f2d749 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + internal partial class TcpExporter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TcpExporter)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Uri.AbsoluteUri); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + TcpExporter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TcpExporter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTcpExporter(document.RootElement, options); + } + + internal static TcpExporter DeserializeTcpExporter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri url = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TcpExporter(url, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TcpExporter)} does not support writing '{options.Format}' format."); + } + } + + TcpExporter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTcpExporter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TcpExporter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.cs new file mode 100644 index 000000000000..f1ee8992cfd2 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TcpExporter.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Base exporter using TCP as transport protocol. + internal partial class TcpExporter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// TCP url to export. + /// is null. + public TcpExporter(Uri uri) + { + Argument.AssertNotNull(uri, nameof(uri)); + + Uri = uri; + } + + /// Initializes a new instance of . + /// TCP url to export. + /// Keeps track of any properties unknown to the library. + internal TcpExporter(Uri uri, IDictionary serializedAdditionalRawData) + { + Uri = uri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TcpExporter() + { + } + + /// TCP url to export. + public Uri Uri { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.Serialization.cs new file mode 100644 index 000000000000..24c8862f8337 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.Serialization.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class UdpReceiver : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UdpReceiver)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint); + if (Optional.IsDefined(Encoding)) + { + writer.WritePropertyName("encoding"u8); + writer.WriteStringValue(Encoding.Value.ToString()); + } + if (Optional.IsDefined(ReadQueueLength)) + { + writer.WritePropertyName("readQueueLength"u8); + writer.WriteNumberValue(ReadQueueLength.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + UdpReceiver IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UdpReceiver)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUdpReceiver(document.RootElement, options); + } + + internal static UdpReceiver DeserializeUdpReceiver(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string endpoint = default; + StreamEncodingType? encoding = default; + int? readQueueLength = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("endpoint"u8)) + { + endpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("encoding"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encoding = new StreamEncodingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("readQueueLength"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + readQueueLength = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UdpReceiver(endpoint, encoding, readQueueLength, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UdpReceiver)} does not support writing '{options.Format}' format."); + } + } + + UdpReceiver IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUdpReceiver(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UdpReceiver)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.cs new file mode 100644 index 000000000000..91500e6e1331 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/UdpReceiver.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Receiver using UDP as transport protocol. + public partial class UdpReceiver + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// TCP endpoint definition. Example: 0.0.0.0:<port>. + /// is null. + public UdpReceiver(string endpoint) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + + Endpoint = endpoint; + } + + /// Initializes a new instance of . + /// TCP endpoint definition. Example: 0.0.0.0:<port>. + /// The encoding of the stream being received. + /// Max read queue length. + /// Keeps track of any properties unknown to the library. + internal UdpReceiver(string endpoint, StreamEncodingType? encoding, int? readQueueLength, IDictionary serializedAdditionalRawData) + { + Endpoint = endpoint; + Encoding = encoding; + ReadQueueLength = readQueueLength; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UdpReceiver() + { + } + + /// TCP endpoint definition. Example: 0.0.0.0:<port>. + public string Endpoint { get; set; } + /// The encoding of the stream being received. + public StreamEncodingType? Encoding { get; set; } + /// Max read queue length. + public int? ReadQueueLength { get; set; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResource.cs index 673f0e8371e4..b17244812a07 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -275,7 +275,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// - /// The payload. + /// The resource properties to be updated. /// The cancellation token to use. /// is null. public virtual async Task> UpdateAsync(MonitorWorkspaceResourcePatch patch, CancellationToken cancellationToken = default) @@ -309,7 +309,7 @@ public virtual async Task> UpdateAsync(Monito /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> UpdateAsync(Monito /// /// /// - /// The payload. + /// The resource properties to be updated. /// The cancellation token to use. /// is null. public virtual Response Update(MonitorWorkspaceResourcePatch patch, CancellationToken cancellationToken = default) @@ -351,7 +351,7 @@ public virtual Response Update(MonitorWorkspaceResourc /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -413,7 +413,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -475,7 +475,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -532,7 +532,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -589,7 +589,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -649,7 +649,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceCollection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceCollection.cs index 33f8d4e860f4..1395ba889a3d 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceCollection.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceCollection.cs @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// AzureMonitorWorkspaces_Create + /// AzureMonitorWorkspaces_CreateOrUpdate /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -74,8 +74,8 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the Azure Monitor workspace. The name is case insensitive. - /// Properties that need to be specified to create a new workspace. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// Resource create parameters. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. @@ -88,10 +88,8 @@ public virtual async Task> CreateOrUpdate scope.Start(); try { - var response = await _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data, cancellationToken).ConfigureAwait(false); - var uri = _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new MonitorArmOperation(Response.FromValue(new MonitorWorkspaceResource(Client, response), response.GetRawResponse()), rehydrationToken); + var response = await _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data, cancellationToken).ConfigureAwait(false); + var operation = new MonitorArmOperation(new MonitorWorkspaceResourceOperationSource(Client), _monitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics, Pipeline, _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -112,11 +110,11 @@ public virtual async Task> CreateOrUpdate /// /// /// Operation Id - /// AzureMonitorWorkspaces_Create + /// AzureMonitorWorkspaces_CreateOrUpdate /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -125,8 +123,8 @@ public virtual async Task> CreateOrUpdate /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the Azure Monitor workspace. The name is case insensitive. - /// Properties that need to be specified to create a new workspace. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// Resource create parameters. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. @@ -139,10 +137,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w scope.Start(); try { - var response = _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data, cancellationToken); - var uri = _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new MonitorArmOperation(Response.FromValue(new MonitorWorkspaceResource(Client, response), response.GetRawResponse()), rehydrationToken); + var response = _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data, cancellationToken); + var operation = new MonitorArmOperation(new MonitorWorkspaceResourceOperationSource(Client), _monitorWorkspaceResourceAzureMonitorWorkspacesClientDiagnostics, Pipeline, _monitorWorkspaceResourceAzureMonitorWorkspacesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, azureMonitorWorkspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -167,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -175,7 +171,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -212,7 +208,7 @@ public virtual async Task> GetAsync(string az /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -220,7 +216,7 @@ public virtual async Task> GetAsync(string az /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -257,7 +253,7 @@ public virtual Response Get(string azureMonitorWorkspa /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -287,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -317,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -325,7 +321,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -360,7 +356,7 @@ public virtual async Task> ExistsAsync(string azureMonitorWorkspa /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -368,7 +364,7 @@ public virtual async Task> ExistsAsync(string azureMonitorWorkspa /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -403,7 +399,7 @@ public virtual Response Exists(string azureMonitorWorkspaceName, Cancellat /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -411,7 +407,7 @@ public virtual Response Exists(string azureMonitorWorkspaceName, Cancellat /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -448,7 +444,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2023-04-03 + /// 2023-10-01-preview /// /// /// Resource @@ -456,7 +452,7 @@ public virtual async Task> GetIfExist /// /// /// - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.Serialization.cs index 985eddc1fda5..69b603e58cb3 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.Serialization.cs @@ -33,6 +33,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } + if (options.Format != "W" && Optional.IsDefined(DefaultIngestionSettings)) + { + writer.WritePropertyName("defaultIngestionSettings"u8); + writer.WriteObjectValue(DefaultIngestionSettings, options); + } + if (options.Format != "W" && Optional.IsDefined(Metrics)) + { + writer.WritePropertyName("metrics"u8); + writer.WriteObjectValue(Metrics, options); + } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -73,20 +83,20 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WritePropertyName("accountId"u8); writer.WriteStringValue(AccountId); } - if (options.Format != "W" && Optional.IsDefined(Metrics)) + if (Optional.IsDefined(MetricsPropertiesMetrics)) { writer.WritePropertyName("metrics"u8); - writer.WriteObjectValue(Metrics, options); + writer.WriteObjectValue(MetricsPropertiesMetrics, options); } if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(DefaultIngestionSettings)) + if (options.Format != "W" && Optional.IsDefined(DefaultIngestionSettingsPropertiesDefaultIngestionSettings)) { writer.WritePropertyName("defaultIngestionSettings"u8); - writer.WriteObjectValue(DefaultIngestionSettings, options); + writer.WriteObjectValue(DefaultIngestionSettingsPropertiesDefaultIngestionSettings, options); } if (options.Format != "W" && Optional.IsCollectionDefined(PrivateEndpointConnections)) { @@ -143,6 +153,8 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource return null; } ETag? etag = default; + MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = default; + MonitorWorkspaceMetrics metrics = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -150,9 +162,9 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource ResourceType type = default; SystemData systemData = default; string accountId = default; - MonitorWorkspaceMetrics metrics = default; + MonitorWorkspaceMetricProperties metrics0 = default; MonitorProvisioningState? provisioningState = default; - MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings = default; + MonitorWorkspaceIngestionSettings defaultIngestionSettings0 = default; IReadOnlyList privateEndpointConnections = default; MonitorWorkspacePublicNetworkAccess? publicNetworkAccess = default; IDictionary serializedAdditionalRawData = default; @@ -168,6 +180,24 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource etag = new ETag(property.Value.GetString()); continue; } + if (property.NameEquals("defaultIngestionSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultIngestionSettings = MonitorWorkspaceDefaultIngestionSettings.DeserializeMonitorWorkspaceDefaultIngestionSettings(property.Value, options); + continue; + } + if (property.NameEquals("metrics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + metrics = MonitorWorkspaceMetrics.DeserializeMonitorWorkspaceMetrics(property.Value, options); + continue; + } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -231,7 +261,7 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource { continue; } - metrics = MonitorWorkspaceMetrics.DeserializeMonitorWorkspaceMetrics(property0.Value, options); + metrics0 = MonitorWorkspaceMetricProperties.DeserializeMonitorWorkspaceMetricProperties(property0.Value, options); continue; } if (property0.NameEquals("provisioningState"u8)) @@ -249,7 +279,7 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource { continue; } - defaultIngestionSettings = MonitorWorkspaceDefaultIngestionSettings.DeserializeMonitorWorkspaceDefaultIngestionSettings(property0.Value, options); + defaultIngestionSettings0 = MonitorWorkspaceIngestionSettings.DeserializeMonitorWorkspaceIngestionSettings(property0.Value, options); continue; } if (property0.NameEquals("privateEndpointConnections"u8)) @@ -292,10 +322,12 @@ internal static MonitorWorkspaceResourceData DeserializeMonitorWorkspaceResource tags ?? new ChangeTrackingDictionary(), location, etag, - accountId, + defaultIngestionSettings, metrics, + accountId, + metrics0, provisioningState, - defaultIngestionSettings, + defaultIngestionSettings0, privateEndpointConnections ?? new ChangeTrackingList(), publicNetworkAccess, serializedAdditionalRawData); diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.cs index d2a7a7dc5a5c..596c7878d646 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/MonitorWorkspaceResourceData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.Monitor { /// /// A class representing the MonitorWorkspaceResource data model. - /// An Azure Monitor Workspace definition + /// An Azure Monitor Workspace definition. /// public partial class MonitorWorkspaceResourceData : TrackedResourceData { @@ -66,20 +66,24 @@ public MonitorWorkspaceResourceData(AzureLocation location) : base(location) /// The tags. /// The location. /// Resource entity tag (ETag). + /// The Data Collection Rule and Endpoint used for ingestion by default. + /// Properties related to the metrics container in the Azure Monitor Workspace. /// The immutable ID of the Azure Monitor workspace. This property is read-only. - /// Information about metrics for the Azure Monitor workspace. + /// Information about metrics for the Azure Monitor workspace. /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. - /// The Data Collection Rule and Endpoint used for ingestion by default. + /// The Data Collection Rule and Endpoint used for ingestion by default. /// List of private endpoint connections. /// Gets or sets allow or disallow public network access to workspace. /// Keeps track of any properties unknown to the library. - internal MonitorWorkspaceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, string accountId, MonitorWorkspaceMetrics metrics, MonitorProvisioningState? provisioningState, MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings, IReadOnlyList privateEndpointConnections, MonitorWorkspacePublicNetworkAccess? publicNetworkAccess, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal MonitorWorkspaceResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, MonitorWorkspaceDefaultIngestionSettings defaultIngestionSettings, MonitorWorkspaceMetrics metrics, string accountId, MonitorWorkspaceMetricProperties metricsPropertiesMetrics, MonitorProvisioningState? provisioningState, MonitorWorkspaceIngestionSettings defaultIngestionSettingsPropertiesDefaultIngestionSettings, IReadOnlyList privateEndpointConnections, MonitorWorkspacePublicNetworkAccess? publicNetworkAccess, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { ETag = etag; - AccountId = accountId; + DefaultIngestionSettings = defaultIngestionSettings; Metrics = metrics; + AccountId = accountId; + MetricsPropertiesMetrics = metricsPropertiesMetrics; ProvisioningState = provisioningState; - DefaultIngestionSettings = defaultIngestionSettings; + DefaultIngestionSettingsPropertiesDefaultIngestionSettings = defaultIngestionSettingsPropertiesDefaultIngestionSettings; PrivateEndpointConnections = privateEndpointConnections; PublicNetworkAccess = publicNetworkAccess; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -92,14 +96,18 @@ internal MonitorWorkspaceResourceData() /// Resource entity tag (ETag). public ETag? ETag { get; } + /// The Data Collection Rule and Endpoint used for ingestion by default. + public MonitorWorkspaceDefaultIngestionSettings DefaultIngestionSettings { get; } + /// Properties related to the metrics container in the Azure Monitor Workspace. + public MonitorWorkspaceMetrics Metrics { get; } /// The immutable ID of the Azure Monitor workspace. This property is read-only. public string AccountId { get; } /// Information about metrics for the Azure Monitor workspace. - public MonitorWorkspaceMetrics Metrics { get; } + public MonitorWorkspaceMetricProperties MetricsPropertiesMetrics { get; set; } /// The provisioning state of the Azure Monitor workspace. Set to Succeeded if everything is healthy. public MonitorProvisioningState? ProvisioningState { get; } /// The Data Collection Rule and Endpoint used for ingestion by default. - public MonitorWorkspaceDefaultIngestionSettings DefaultIngestionSettings { get; } + public MonitorWorkspaceIngestionSettings DefaultIngestionSettingsPropertiesDefaultIngestionSettings { get; } /// List of private endpoint connections. public IReadOnlyList PrivateEndpointConnections { get; } /// Gets or sets allow or disallow public network access to workspace. diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupCollection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupCollection.cs new file mode 100644 index 000000000000..6050b377cb5e --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Monitor +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetPipelineGroups method from an instance of . + /// + public partial class PipelineGroupCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _pipelineGroupClientDiagnostics; + private readonly PipelineGroupsRestOperations _pipelineGroupRestClient; + + /// Initializes a new instance of the class for mocking. + protected PipelineGroupCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal PipelineGroupCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _pipelineGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Monitor", PipelineGroupResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(PipelineGroupResource.ResourceType, out string pipelineGroupApiVersion); + _pipelineGroupRestClient = new PipelineGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, pipelineGroupApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create or update a pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of pipeline group. The name is case insensitive. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string pipelineGroupName, PipelineGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, data, cancellationToken).ConfigureAwait(false); + var operation = new MonitorArmOperation(new PipelineGroupOperationSource(Client), _pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of pipeline group. The name is case insensitive. + /// Resource create parameters. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string pipelineGroupName, PipelineGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, data, cancellationToken); + var operation = new MonitorArmOperation(new PipelineGroupOperationSource(Client), _pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.Get"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.Get"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists all workspaces in the specified resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _pipelineGroupRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _pipelineGroupRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new PipelineGroupResource(Client, PipelineGroupData.DeserializePipelineGroupData(e)), _pipelineGroupClientDiagnostics, Pipeline, "PipelineGroupCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists all workspaces in the specified resource group + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups + /// + /// + /// Operation Id + /// PipelineGroups_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _pipelineGroupRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _pipelineGroupRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new PipelineGroupResource(Client, PipelineGroupData.DeserializePipelineGroupData(e)), _pipelineGroupClientDiagnostics, Pipeline, "PipelineGroupCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.Exists"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.Exists"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupCollection.GetIfExists"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, pipelineGroupName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.Serialization.cs new file mode 100644 index 000000000000..7007912d908f --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.Serialization.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Monitor.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Monitor +{ + public partial class PipelineGroupData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(ExtendedLocation)) + { + writer.WritePropertyName("extendedLocation"u8); + JsonSerializer.Serialize(writer, ExtendedLocation); + } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(Replicas)) + { + writer.WritePropertyName("replicas"u8); + writer.WriteNumberValue(Replicas.Value); + } + if (Optional.IsCollectionDefined(Receivers)) + { + writer.WritePropertyName("receivers"u8); + writer.WriteStartArray(); + foreach (var item in Receivers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Processors)) + { + writer.WritePropertyName("processors"u8); + writer.WriteStartArray(); + foreach (var item in Processors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Exporters)) + { + writer.WritePropertyName("exporters"u8); + writer.WriteStartArray(); + foreach (var item in Exporters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Service)) + { + writer.WritePropertyName("service"u8); + writer.WriteObjectValue(Service, options); + } + if (Optional.IsCollectionDefined(NetworkingConfigurations)) + { + writer.WritePropertyName("networkingConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in NetworkingConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PipelineGroupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PipelineGroupData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePipelineGroupData(document.RootElement, options); + } + + internal static PipelineGroupData DeserializePipelineGroupData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ExtendedLocation extendedLocation = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + int? replicas = default; + IList receivers = default; + IList processors = default; + IList exporters = default; + PipelineGroupService service = default; + IList networkingConfigurations = default; + MonitorProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("extendedLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + extendedLocation = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("replicas"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + replicas = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("receivers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupReceiver.DeserializePipelineGroupReceiver(item, options)); + } + receivers = array; + continue; + } + if (property0.NameEquals("processors"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupProcessor.DeserializePipelineGroupProcessor(item, options)); + } + processors = array; + continue; + } + if (property0.NameEquals("exporters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupExporter.DeserializePipelineGroupExporter(item, options)); + } + exporters = array; + continue; + } + if (property0.NameEquals("service"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + service = PipelineGroupService.DeserializePipelineGroupService(property0.Value, options); + continue; + } + if (property0.NameEquals("networkingConfigurations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PipelineGroupNetworkingConfiguration.DeserializePipelineGroupNetworkingConfiguration(item, options)); + } + networkingConfigurations = array; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new MonitorProvisioningState(property0.Value.GetString()); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PipelineGroupData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + extendedLocation, + replicas, + receivers ?? new ChangeTrackingList(), + processors ?? new ChangeTrackingList(), + exporters ?? new ChangeTrackingList(), + service, + networkingConfigurations ?? new ChangeTrackingList(), + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PipelineGroupData)} does not support writing '{options.Format}' format."); + } + } + + PipelineGroupData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePipelineGroupData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PipelineGroupData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.cs new file mode 100644 index 000000000000..ab4bf5a73c9b --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupData.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Monitor.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.Monitor +{ + /// + /// A class representing the PipelineGroup data model. + /// A pipeline group definition. + /// + public partial class PipelineGroupData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public PipelineGroupData(AzureLocation location) : base(location) + { + Receivers = new ChangeTrackingList(); + Processors = new ChangeTrackingList(); + Exporters = new ChangeTrackingList(); + NetworkingConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The extended location for given pipeline group. + /// Defines the amount of replicas of the pipeline group instance. + /// The receivers specified for a pipeline group instance. + /// The processors specified for a pipeline group instance. + /// The exporters specified for a pipeline group instance. + /// The service section for a given pipeline group instance. + /// Networking configurations for the pipeline group instance. + /// The provisioning state of a pipeline group instance. Set to Succeeded if everything is healthy. + /// Keeps track of any properties unknown to the library. + internal PipelineGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ExtendedLocation extendedLocation, int? replicas, IList receivers, IList processors, IList exporters, PipelineGroupService service, IList networkingConfigurations, MonitorProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ExtendedLocation = extendedLocation; + Replicas = replicas; + Receivers = receivers; + Processors = processors; + Exporters = exporters; + Service = service; + NetworkingConfigurations = networkingConfigurations; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PipelineGroupData() + { + } + + /// The extended location for given pipeline group. + public ExtendedLocation ExtendedLocation { get; set; } + /// Defines the amount of replicas of the pipeline group instance. + public int? Replicas { get; set; } + /// The receivers specified for a pipeline group instance. + public IList Receivers { get; } + /// The processors specified for a pipeline group instance. + public IList Processors { get; } + /// The exporters specified for a pipeline group instance. + public IList Exporters { get; } + /// The service section for a given pipeline group instance. + public PipelineGroupService Service { get; set; } + /// Networking configurations for the pipeline group instance. + public IList NetworkingConfigurations { get; } + /// The provisioning state of a pipeline group instance. Set to Succeeded if everything is healthy. + public MonitorProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.Serialization.cs new file mode 100644 index 000000000000..39adfb4a8ecc --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Monitor +{ + public partial class PipelineGroupResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + PipelineGroupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + PipelineGroupData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.cs new file mode 100644 index 000000000000..68e159872fa5 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/PipelineGroupResource.cs @@ -0,0 +1,707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Monitor.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Monitor +{ + /// + /// A Class representing a PipelineGroup along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetPipelineGroupResource method. + /// Otherwise you can get one from its parent resource using the GetPipelineGroup method. + /// + public partial class PipelineGroupResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The pipelineGroupName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string pipelineGroupName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _pipelineGroupClientDiagnostics; + private readonly PipelineGroupsRestOperations _pipelineGroupRestClient; + private readonly PipelineGroupData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Monitor/pipelineGroups"; + + /// Initializes a new instance of the class for mocking. + protected PipelineGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal PipelineGroupResource(ArmClient client, PipelineGroupData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal PipelineGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _pipelineGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Monitor", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string pipelineGroupApiVersion); + _pipelineGroupRestClient = new PipelineGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, pipelineGroupApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual PipelineGroupData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Get"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the specific pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Get"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new PipelineGroupResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Delete + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Delete"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new MonitorArmOperation(_pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a pipeline group instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Delete + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Delete"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new MonitorArmOperation(_pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a pipeline group instance + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Update + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, PipelineGroupPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Update"); + scope.Start(); + try + { + var response = await _pipelineGroupRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new MonitorArmOperation(new PipelineGroupOperationSource(Client), _pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a pipeline group instance + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Update + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, PipelineGroupPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.Update"); + scope.Start(); + try + { + var response = _pipelineGroupRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new MonitorArmOperation(new PipelineGroupOperationSource(Client), _pipelineGroupClientDiagnostics, Pipeline, _pipelineGroupRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PipelineGroupPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PipelineGroupPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PipelineGroupPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PipelineGroupPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _pipelineGroupRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new PipelineGroupPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Monitor/pipelineGroups/{pipelineGroupName} + /// + /// + /// Operation Id + /// PipelineGroups_Get + /// + /// + /// Default Api Version + /// 2023-10-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _pipelineGroupClientDiagnostics.CreateScope("PipelineGroupResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _pipelineGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new PipelineGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new PipelineGroupPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/AzureMonitorWorkspacesRestOperations.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/AzureMonitorWorkspacesRestOperations.cs index a9bab10a3378..05d8a595a8ce 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/AzureMonitorWorkspacesRestOperations.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/AzureMonitorWorkspacesRestOperations.cs @@ -32,24 +32,22 @@ public AzureMonitorWorkspacesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-04-03"; + _apiVersion = apiVersion ?? "2023-10-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Monitor/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -58,8 +56,6 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Monitor/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; @@ -68,18 +64,16 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Lists all workspaces in the specified resource group. + /// Lists all workspaces in the specified subscription. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -95,18 +89,16 @@ public async Task> ListByResourceGr } } - /// Lists all workspaces in the specified resource group. + /// Lists all workspaces in the specified subscription. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -122,18 +114,20 @@ public Response ListByResourceGroup(string s } } - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Monitor/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -142,6 +136,8 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Monitor/accounts", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; @@ -150,16 +146,18 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// Lists all workspaces in the specified subscription. + /// Lists all workspaces in the specified resource group. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -175,16 +173,18 @@ public async Task> ListBySubscripti } } - /// Lists all workspaces in the specified subscription. + /// Lists all workspaces in the specified resource group. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -237,7 +237,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// Returns the specific Azure Monitor workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -268,7 +268,7 @@ public async Task> GetAsync(string subscr /// Returns the specific Azure Monitor workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -296,7 +296,7 @@ public Response Get(string subscriptionId, string } } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -310,7 +310,7 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -337,30 +337,25 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG /// Create or update a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. - /// Properties that need to be specified to create a new workspace. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// Resource create parameters. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(azureMonitorWorkspaceName, nameof(azureMonitorWorkspaceName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, azureMonitorWorkspaceName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, azureMonitorWorkspaceName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 201: - { - MonitorWorkspaceResourceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -369,30 +364,25 @@ public async Task> CreateAsync(string sub /// Create or update a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. - /// Properties that need to be specified to create a new workspace. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// Resource create parameters. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string azureMonitorWorkspaceName, MonitorWorkspaceResourceData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(azureMonitorWorkspaceName, nameof(azureMonitorWorkspaceName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, azureMonitorWorkspaceName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, azureMonitorWorkspaceName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 201: - { - MonitorWorkspaceResourceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MonitorWorkspaceResourceData.DeserializeMonitorWorkspaceResourceData(document.RootElement); - return Response.FromValue(value, message.Response); - } + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -439,8 +429,8 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// Updates part of a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. - /// The payload. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The resource properties to be updated. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -470,8 +460,8 @@ public async Task> UpdateAsync(string sub /// Updates part of a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. - /// The payload. + /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The resource properties to be updated. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -535,7 +525,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG /// Delete a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -560,7 +550,7 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr /// Delete a workspace. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the Azure Monitor workspace. The name is case insensitive. + /// The name of the Azure Monitor workspace. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -582,7 +572,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string a } } - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -590,7 +580,7 @@ internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string ne return uri; } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -604,20 +594,18 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// Lists all workspaces in the specified resource group. + /// Lists all workspaces in the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -633,20 +621,18 @@ public async Task> ListByResourceGr } } - /// Lists all workspaces in the specified resource group. + /// Lists all workspaces in the specified subscription. /// The URL to the next page of results. /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -662,7 +648,7 @@ public Response ListByResourceGroupNextPage( } } - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -670,7 +656,7 @@ internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nex return uri; } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -684,18 +670,20 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// Lists all workspaces in the specified subscription. + /// Lists all workspaces in the specified resource group. /// The URL to the next page of results. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -711,18 +699,20 @@ public async Task> ListBySubscripti } } - /// Lists all workspaces in the specified subscription. + /// Lists all workspaces in the specified resource group. /// The URL to the next page of results. /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/PipelineGroupsRestOperations.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/PipelineGroupsRestOperations.cs new file mode 100644 index 000000000000..d43ea5b693f9 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/PipelineGroupsRestOperations.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Monitor.Models; + +namespace Azure.ResourceManager.Monitor +{ + internal partial class PipelineGroupsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PipelineGroupsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public PipelineGroupsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-10-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all workspaces in the specified subscription. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all workspaces in the specified subscription. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all workspaces in the specified resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all workspaces in the specified resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string pipelineGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string pipelineGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns the specific pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, pipelineGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineGroupData.DeserializePipelineGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PipelineGroupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns the specific pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, pipelineGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineGroupData.DeserializePipelineGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((PipelineGroupData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, pipelineGroupName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// Resource create parameters. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, pipelineGroupName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, pipelineGroupName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The resource properties to be updated. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string pipelineGroupName, PipelineGroupPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, pipelineGroupName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string pipelineGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string pipelineGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Monitor/pipelineGroups/", false); + uri.AppendPath(pipelineGroupName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, pipelineGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a pipeline group instance. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of pipeline group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string pipelineGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(pipelineGroupName, nameof(pipelineGroupName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, pipelineGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all workspaces in the specified subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all workspaces in the specified subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists all workspaces in the specified resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists all workspaces in the specified resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PipelineGroupListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = PipelineGroupListResult.DeserializePipelineGroupListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md b/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md index 01ff6fd4a383..7f432edc6213 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md @@ -7,7 +7,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: Monitor namespace: Azure.ResourceManager.Monitor -require: https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/cf406046c304ec528a84ae1a151f3d1a647058a2/specification/monitor/resource-manager/readme.md tag: package-track2-stable output-folder: $(this-folder)/Generated clear-output-folder: true @@ -62,6 +62,7 @@ acronym-mapping: HH: Hh DD: Dd SS: Ss + UDP: Udp irregular-plural-words: status: status @@ -290,16 +291,16 @@ rename-mapping: StorageTableDestination: DataCollectionRuleStorageTableDestination ActionType: MonitorWorkspaceActionType Metrics: MonitorWorkspaceMetricProperties - AzureMonitorWorkspaceResource: MonitorWorkspaceResource - AzureMonitorWorkspaceResourceCollection: MonitorWorkspaceResourceCollection - AzureMonitorWorkspaceResourceData: MonitorWorkspaceResourceData + AzureMonitorWorkspace: MonitorWorkspaceResource + AzureMonitorWorkspaceCollection: MonitorWorkspaceResourceCollection + AzureMonitorWorkspaceData: MonitorWorkspaceResourceData IngestionSettings: MonitorWorkspaceIngestionSettings IngestionSettings.dataCollectionEndpointResourceId: -|arm-id IngestionSettings.dataCollectionRuleResourceId: -|arm-id AzureMonitorWorkspaceDefaultIngestionSettings: MonitorWorkspaceDefaultIngestionSettings AzureMonitorWorkspaceMetrics: MonitorWorkspaceMetrics - AzureMonitorWorkspaceResourcePatch: MonitorWorkspaceResourcePatch - AzureMonitorWorkspaceResourceListResult: MonitorWorkspaceResourceListResult + AzureMonitorWorkspacePatch: MonitorWorkspaceResourcePatch + AzureMonitorWorkspaceListResult: MonitorWorkspaceResourceListResult MetricDefinition: MonitorMetricDefinition AggregationType: MonitorAggregationType BaselineMetadata: MonitorBaselineMetadata @@ -314,6 +315,28 @@ rename-mapping: SingleMetricBaseline: MonitorSingleMetricBaseline TimeSeriesBaseline: MonitorTimeSeriesBaseline Unit: MonitorMetricUnit + CacheConfiguration: MonitorWorkspaceLogsExporterCacheConfiguration + ConcurrencyConfiguration: MonitorWorkspaceLogsExporterConcurrencyConfiguration + SchemaMap: MonitorWorkspaceLogsSchemaMap + RecordMap: MonitorWorkspaceLogsRecordMap + ResourceMap: MonitorWorkspaceLogsResourceMap + ScopeMap: MonitorWorkspaceLogsScopeMap + Receiver: PipelineGroupReceiver + ReceiverType: PipelineGroupReceiverType + Processor: PipelineGroupProcessor + ProcessorType: PipelineGroupProcessorType + Exporter: PipelineGroupExporter + ExporterType: PipelineGroupExporterType + Service: PipelineGroupService + Pipeline: PipelineGroupServicePipeline + PipelineType: PipelineGroupServicePipelineType + PersistenceConfigurations: PipelineGroupServicePersistenceConfigurations + NetworkingConfiguration: PipelineGroupNetworkingConfiguration + NetworkingRoute: PipelineGroupNetworkingRoute + ExternalNetworkingMode: PipelineGroupExternalNetworkingMode + AzureResourceManagerCommonTypesExtendedLocation: Azure.ResourceManager.CommonTypes.ExtendedLocation + AzureMonitorWorkspaceLogsApiConfig: MonitorWorkspaceLogsApiConfig + AzureMonitorWorkspaceLogsExporter: MonitorWorkspaceLogsExporter suppress-abstract-base-class: - MetricAlertCriteria @@ -383,6 +406,9 @@ directive: - from: v3/types.json where: $.definitions.ErrorResponse transform: $["x-ms-client-name"] = "CommonErrorResponseV3" + - from: v4/types.json + where: $.definitions.ErrorResponse + transform: $["x-ms-client-name"] = "CommonErrorResponseV4" - from: v2/types.json where: $.definitions.ErrorDetail transform: $["x-ms-client-name"] = "CommonErrorDetail" @@ -444,6 +470,33 @@ directive: "modelAsString": true } }; + - from: azuremonitor.json + where: $.definitions.AzureMonitorWorkspace.properties + transform: > + $.defaultIngestionSettings = { + "description": "The Data Collection Rule and Endpoint used for ingestion by default.", + "allOf": [ + { + "$ref": "#/definitions/IngestionSettings" + } + ], + "readOnly": true, + "x-ms-mutability": [ + "read" + ] + }; + $.metrics = { + "description": "Properties related to the metrics container in the Azure Monitor Workspace", + "allOf": [ + { + "$ref": "#/definitions/Metrics" + } + ], + "readOnly": true, + "x-ms-mutability": [ + "read" + ] + }; ``` ## Tag: package-track2-stable @@ -477,6 +530,6 @@ input-file: - https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/dataCollectionEndpoints_API.json - https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/dataCollectionRuleAssociations_API.json - https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/Microsoft.Insights/stable/2022-06-01/dataCollectionRules_API.json -- https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/monitoringAccounts_API.json +- https://github.com/Azure/azure-rest-api-specs/blob/cf406046c304ec528a84ae1a151f3d1a647058a2/specification/monitor/resource-manager/Microsoft.Monitor/preview/2023-10-01-preview/azuremonitor.json # - https://github.com/Azure/azure-rest-api-specs/blob/2491b616cde43277fae339604f03f59412e016aa/specification/monitor/resource-manager/Microsoft.Monitor/stable/2023-04-03/operations_API.json # we do not need to support this ``` diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md b/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md index 12d701005665..ecdf34098fd1 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md +++ b/sdk/netapp/Azure.ResourceManager.NetApp/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.8.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.7.0 (2024-08-16) ### Features Added @@ -182,4 +192,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). diff --git a/sdk/netapp/Azure.ResourceManager.NetApp/src/Azure.ResourceManager.NetApp.csproj b/sdk/netapp/Azure.ResourceManager.NetApp/src/Azure.ResourceManager.NetApp.csproj index b16bbba235c9..451cf047aeea 100644 --- a/sdk/netapp/Azure.ResourceManager.NetApp/src/Azure.ResourceManager.NetApp.csproj +++ b/sdk/netapp/Azure.ResourceManager.NetApp/src/Azure.ResourceManager.NetApp.csproj @@ -1,8 +1,8 @@ - 1.7.0 + 1.8.0-beta.1 - 1.6.0 + 1.7.0 Azure.ResourceManager.NetApp Microsoft Azure Resource Manager client SDK for Azure resource provider Microsoft.NetApp. azure;management;arm;resource manager;netapp diff --git a/sdk/openai/Azure.AI.OpenAI/.gitignore b/sdk/openai/.gitignore similarity index 74% rename from sdk/openai/Azure.AI.OpenAI/.gitignore rename to sdk/openai/.gitignore index 852a4791f1ab..ecc762b5c51b 100644 --- a/sdk/openai/Azure.AI.OpenAI/.gitignore +++ b/sdk/openai/.gitignore @@ -1,4 +1,6 @@ package-lock.json TempTypeSpecFiles/ +tests/SessionRecords +external/ **/Generated/cadl.json **/Generated/configuration.json \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI.Assistants/.gitignore b/sdk/openai/Azure.AI.OpenAI.Assistants/.gitignore deleted file mode 100644 index 5ff7b673e645..000000000000 --- a/sdk/openai/Azure.AI.OpenAI.Assistants/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -package-lock.json -TempTypeSpecFiles/ -tests/SessionRecords -**/Generated/configuration.json diff --git a/sdk/openai/Azure.AI.OpenAI.Assistants/src/Azure.AI.OpenAI.Assistants.csproj b/sdk/openai/Azure.AI.OpenAI.Assistants/src/Azure.AI.OpenAI.Assistants.csproj index 50238e0a57e1..306eca75e078 100644 --- a/sdk/openai/Azure.AI.OpenAI.Assistants/src/Azure.AI.OpenAI.Assistants.csproj +++ b/sdk/openai/Azure.AI.OpenAI.Assistants/src/Azure.AI.OpenAI.Assistants.csproj @@ -16,7 +16,6 @@ - diff --git a/sdk/openai/Azure.AI.OpenAI/Azure.AI.OpenAI.sln b/sdk/openai/Azure.AI.OpenAI/Azure.AI.OpenAI.sln index a3254137c6da..61c110a928cd 100644 --- a/sdk/openai/Azure.AI.OpenAI/Azure.AI.OpenAI.sln +++ b/sdk/openai/Azure.AI.OpenAI/Azure.AI.OpenAI.sln @@ -7,7 +7,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.AI.OpenAI", "src\Azur EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.AI.OpenAI.Tests", "tests\Azure.AI.OpenAI.Tests.csproj", "{4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{439F1494-8E96-4931-AB0A-5BBA7EBA15D2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenAI.TestFramework", "..\tools\TestFramework\src\OpenAI.TestFramework.csproj", "{2D90AB0E-E458-4B28-97F7-33A70136EA2B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,10 +23,10 @@ Global {4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}.Debug|Any CPU.Build.0 = Debug|Any CPU {4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}.Release|Any CPU.ActiveCfg = Release|Any CPU {4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}.Release|Any CPU.Build.0 = Release|Any CPU - {439F1494-8E96-4931-AB0A-5BBA7EBA15D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {439F1494-8E96-4931-AB0A-5BBA7EBA15D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {439F1494-8E96-4931-AB0A-5BBA7EBA15D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {439F1494-8E96-4931-AB0A-5BBA7EBA15D2}.Release|Any CPU.Build.0 = Release|Any CPU + {2D90AB0E-E458-4B28-97F7-33A70136EA2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D90AB0E-E458-4B28-97F7-33A70136EA2B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D90AB0E-E458-4B28-97F7-33A70136EA2B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D90AB0E-E458-4B28-97F7-33A70136EA2B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md index 0a01e3c9e629..083408502da0 100644 --- a/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md +++ b/sdk/openai/Azure.AI.OpenAI/CHANGELOG.md @@ -1,13 +1,42 @@ # Release History -## 2.0.0-beta.3 (Unreleased) +## 2.0.0-beta.4 (2024-08-30) + +This small release increments library compatibility to the latest `OpenAI 2.0.0-beta.10`. Prior to this update, interactions with the two breaking changes described below prevented full interoperability. + +### Breaking Changes + +- `AudioClient`'s `GenerateSpeechFromText()` method is renamed to `GenerateSpeech()` +- `OpenAIFileInfo`'s `SizeInBytes` is now of type `int?` (previously `long?`) + +## 2.0.0-beta.3 (2024-08-23) + +This change updates the library for compatibility with the latest `2.0.0-beta.9` of the `OpenAI` package and the `2024-07-01-preview` Azure OpenAI service API version label, as published on 8/5. ### Features Added - The library now directly supports alternative authentication audiences, including Azure Government. This can be specified by providing an appropriate `AzureOpenAIAudience` value to the `AzureOpenAIClientOptions.Audience` property when creating a client. See the client configuration section of the README for more details. +Additional new features from the `OpenAI` package can be found in [the OpenAI changelog](https://github.com/openai/openai-dotnet/blob/main/CHANGELOG.md). + +**Please note**: Structured Outputs support is not yet available with the `2024-07-01-preview` service API version. This means that attempting to use the feature with this library version will fail with an unrecognized property for either `response_format` or `strict` in request payloads; all existing functionality is unaffected. Azure OpenAI support for Structured Outputs is coming soon. + ### Breaking Changes +No Azure-specific breaking changes are present in this update. + +The update from `OpenAI` `2.0.0-beta.7` to `2.0.0-beta.9` does bring a number of breaking changes, however, as described in [the OpenAI changelog](https://github.com/openai/openai-dotnet/blob/main/CHANGELOG.md): + +- Removed client constructors that do not explicitly take an API key parameter or an endpoint via an `OpenAIClientOptions` parameter, making it clearer how to appropriately instantiate a client. ([13a9c68](https://github.com/openai/openai-dotnet/commit/13a9c68647c8d54475f1529a63b13ad711bd4ba6)) +- Removed the endpoint parameter from all client constructors, making it clearer that an alternative endpoint must be specified via the `OpenAIClientOptions` parameter. ([13a9c68](https://github.com/openai/openai-dotnet/commit/13a9c68647c8d54475f1529a63b13ad711bd4ba6)) +- Removed `OpenAIClient`'s `Endpoint` `protected` property. ([13a9c68](https://github.com/openai/openai-dotnet/commit/13a9c68647c8d54475f1529a63b13ad711bd4ba6)) +- Made `OpenAIClient`'s constructor that takes a `ClientPipeline` parameter `protected internal` instead of just `protected`. ([13a9c68](https://github.com/openai/openai-dotnet/commit/13a9c68647c8d54475f1529a63b13ad711bd4ba6)) +- Renamed the `User` property in applicable Options classes to `EndUserId`, making its purpose clearer. ([13a9c68](https://github.com/openai/openai-dotnet/commit/13a9c68647c8d54475f1529a63b13ad711bd4ba6)) +- Changed name of return types from methods returning streaming collections from `ResultCollection` to `CollectionResult`. ([7bdecfd](https://github.com/openai/openai-dotnet/commit/7bdecfd8d294be933c7779c7e5b6435ba8a8eab0)) +- Changed return types from methods returning paginated collections from `PageableCollection` to `PageCollection`. ([7bdecfd](https://github.com/openai/openai-dotnet/commit/7bdecfd8d294be933c7779c7e5b6435ba8a8eab0)) +- Users must now call `GetAllValues` on the collection of pages to enumerate collection items directly. Corresponding protocol methods return `IEnumerable` where each collection item represents a single service response holding a page of values. ([7bdecfd](https://github.com/openai/openai-dotnet/commit/7bdecfd8d294be933c7779c7e5b6435ba8a8eab0)) +- Updated `VectorStoreFileCounts` and `VectorStoreFileAssociationError` types from `readonly struct` to `class`. ([58f93c8](https://github.com/openai/openai-dotnet/commit/58f93c8d5ea080adfee8b37ae3cc034ebb06c79f)) + ### Bugs Fixed - Removed an inappropriate null check in `FileClient.GetFiles()` (azure-sdk-for-net 44912) @@ -16,7 +45,7 @@ - Automatic retry behavior will now honor header-based intervals from `Retry-After` and related response headers - The client will now originate an `x-ms-client-request-id` header to match prior library behavior and facilitate troubleshooting -### Other Changes +Additional, non-Azure-specific bug fixes can be found in [the OpenAI changelog](https://github.com/openai/openai-dotnet/blob/main/CHANGELOG.md). ## 2.0.0-beta.2 (2024-06-14) diff --git a/sdk/openai/Azure.AI.OpenAI/Directory.Build.props b/sdk/openai/Azure.AI.OpenAI/Directory.Build.props index 1a9611bd4924..34f0ec9782bf 100644 --- a/sdk/openai/Azure.AI.OpenAI/Directory.Build.props +++ b/sdk/openai/Azure.AI.OpenAI/Directory.Build.props @@ -1,4 +1,19 @@  + + + + + diff --git a/sdk/openai/Azure.AI.OpenAI/README.md b/sdk/openai/Azure.AI.OpenAI/README.md index fd8b2bdb4eea..3a201aa89096 100644 --- a/sdk/openai/Azure.AI.OpenAI/README.md +++ b/sdk/openai/Azure.AI.OpenAI/README.md @@ -169,7 +169,7 @@ Console.WriteLine($"{completion.Role}: {completion.Content[0].Text}"); ### Stream chat messages -Streaming chat completions use the `CompleteChatStreaming` and `CompleteChatStreamingAsync` method, which return a `ResultCollection` or `AsyncResultCollection` instead of a `ClientResult`. These result collections can be iterated over using `foreach` or `await foreach`, with each update arriving as new data is available from the streamed response. +Streaming chat completions use the `CompleteChatStreaming` and `CompleteChatStreamingAsync` method, which return a `ResultCollection` or `AsyncCollectionResult` instead of a `ClientResult`. These result collections can be iterated over using `foreach` or `await foreach`, with each update arriving as new data is available from the streamed response. ```C# Snippet:StreamChatMessages AzureOpenAIClient azureClient = new( @@ -177,7 +177,7 @@ AzureOpenAIClient azureClient = new( new DefaultAzureCredential()); ChatClient chatClient = azureClient.GetChatClient("my-gpt-35-turbo-deployment"); -ResultCollection completionUpdates = chatClient.CompleteChatStreaming( +CollectionResult completionUpdates = chatClient.CompleteChatStreaming( [ new SystemChatMessage("You are a helpful assistant that talks like a pirate."), new UserChatMessage("Hi, can you help me?"), @@ -533,4 +533,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con [code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/ [email_opencode]: mailto:opencode@microsoft.com -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/openai/Azure.AI.OpenAI/README.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/openai/Azure.AI.OpenAI/README.png) \ No newline at end of file diff --git a/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs b/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs index b2d9b8d09ca6..2a47a4534fee 100644 --- a/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs +++ b/sdk/openai/Azure.AI.OpenAI/api/Azure.AI.OpenAI.netstandard2.0.cs @@ -37,11 +37,13 @@ public static partial class AzureGeneratedImageExtensions public partial class AzureOpenAIClient : OpenAI.OpenAIClient { protected AzureOpenAIClient() { } - public AzureOpenAIClient(Azure.AI.OpenAI.AzureOpenAIClientOptions options = null) { } protected AzureOpenAIClient(System.ClientModel.Primitives.ClientPipeline pipeline, System.Uri endpoint, Azure.AI.OpenAI.AzureOpenAIClientOptions options) { } - public AzureOpenAIClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options = null) { } + public AzureOpenAIClient(System.Uri endpoint, Azure.AzureKeyCredential credential) { } + public AzureOpenAIClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options) { } + public AzureOpenAIClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } public AzureOpenAIClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options = null) { } - public AzureOpenAIClient(System.Uri endpoint, System.ClientModel.ApiKeyCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options = null) { } + public AzureOpenAIClient(System.Uri endpoint, System.ClientModel.ApiKeyCredential credential) { } + public AzureOpenAIClient(System.Uri endpoint, System.ClientModel.ApiKeyCredential credential, Azure.AI.OpenAI.AzureOpenAIClientOptions options) { } public override OpenAI.Assistants.AssistantClient GetAssistantClient() { throw null; } public override OpenAI.Audio.AudioClient GetAudioClient(string deploymentName) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -60,7 +62,7 @@ public AzureOpenAIClient(System.Uri endpoint, System.ClientModel.ApiKeyCredentia } public partial class AzureOpenAIClientOptions : System.ClientModel.Primitives.ClientPipelineOptions { - public AzureOpenAIClientOptions(Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion version = Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion.V2024_05_01_Preview) { } + public AzureOpenAIClientOptions(Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion version = Azure.AI.OpenAI.AzureOpenAIClientOptions.ServiceVersion.V2024_07_01_Preview) { } public string ApplicationId { get { throw null; } set { } } public Azure.AI.OpenAI.AzureOpenAIAudience? Audience { get { throw null; } set { } } public enum ServiceVersion @@ -68,6 +70,7 @@ public enum ServiceVersion V2024_04_01_Preview = 7, V2024_05_01_Preview = 8, V2024_06_01 = 9, + V2024_07_01_Preview = 10, } } public static partial class AzureStreamingChatCompletionUpdateExtensions @@ -256,7 +259,7 @@ internal AzureChatRetrievedDocument() { } public string Content { get { throw null; } } public int DataSourceIndex { get { throw null; } } public string Filepath { get { throw null; } } - public string FilterReason { get { throw null; } } + public Azure.AI.OpenAI.Chat.AzureChatRetrievedDocumentFilterReason? FilterReason { get { throw null; } } public double? OriginalSearchScore { get { throw null; } } public double? RerankScore { get { throw null; } } public System.Collections.Generic.IReadOnlyList SearchQueries { get { throw null; } } diff --git a/sdk/openai/Azure.AI.OpenAI/assets.json b/sdk/openai/Azure.AI.OpenAI/assets.json index ca993e4d2833..39d86235b486 100644 --- a/sdk/openai/Azure.AI.OpenAI/assets.json +++ b/sdk/openai/Azure.AI.OpenAI/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/openai/Azure.AI.OpenAI", - "Tag": "net/openai/Azure.AI.OpenAI_495c397a52" + "Tag": "net/openai/Azure.AI.OpenAI_23ae923738" } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj b/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj index f42413e324b5..015e0a8ca4f5 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj +++ b/sdk/openai/Azure.AI.OpenAI/src/Azure.AI.OpenAI.csproj @@ -5,27 +5,61 @@ Azure OpenAI's official extension package for using OpenAI's .NET library with the Azure OpenAI Service. Azure.AI.OpenAI Client Library - 2.0.0-beta.3 + 2.0.0 + beta.4 Microsoft Azure OpenAI true $(RequiredTargetFrameworks) true $(NoWarn);CS1591;AZC0012;AZC0102;CS8002;CS0436;AZC0112 - true enable preview disable - - - - - 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.Protocol.cs index 2246b43712d1..36e30a5d6478 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.Protocol.cs @@ -27,16 +27,16 @@ public override ClientResult CreateAssistant(BinaryContent content, RequestOptio return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); } - public override async Task GetAssistantsAsync(int? limit, string order, string after, string before, RequestOptions options) + public override IAsyncEnumerable GetAssistantsAsync(int? limit, string order, string after, string before, RequestOptions options) { - using PipelineMessage message = CreateGetAssistantsRequest(limit, order, after, before, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureAssistantsPageEnumerator enumerator = new(Pipeline, _endpoint, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - public override ClientResult GetAssistants(int? limit, string order, string after, string before, RequestOptions options) + public override IEnumerable GetAssistants(int? limit, string order, string after, string before, RequestOptions options) { - using PipelineMessage message = CreateGetAssistantsRequest(limit, order, after, before, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureAssistantsPageEnumerator enumerator = new(Pipeline, _endpoint, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } public override async Task GetAssistantAsync(string assistantId, RequestOptions options) @@ -107,22 +107,21 @@ public override ClientResult CreateMessage(string threadId, BinaryContent conten return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); } - /// - public override async Task GetMessagesAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) + /// + public override IAsyncEnumerable GetMessagesAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); - using PipelineMessage message = CreateGetMessagesRequest(threadId, limit, order, after, before, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureMessagesPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - /// - public override ClientResult GetMessages(string threadId, int? limit, string order, string after, string before, RequestOptions options) + public override IEnumerable GetMessages(string threadId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); - using PipelineMessage message = CreateGetMessagesRequest(threadId, limit, order, after, before, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureMessagesPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } /// @@ -259,22 +258,20 @@ public override ClientResult CreateRun(string threadId, BinaryContent content, R } } - /// - public override async Task GetRunsAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) + public override IAsyncEnumerable GetRunsAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); - using PipelineMessage message = CreateGetRunsRequest(threadId, limit, order, after, before, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureRunsPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - /// - public override ClientResult GetRuns(string threadId, int? limit, string order, string after, string before, RequestOptions options) + public override IEnumerable GetRuns(string threadId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); - using PipelineMessage message = CreateGetRunsRequest(threadId, limit, order, after, before, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureRunsPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } /// @@ -379,24 +376,22 @@ public override ClientResult SubmitToolOutputsToRun(string threadId, string runI } } - /// - public override async Task GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) + public override IAsyncEnumerable GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); - using PipelineMessage message = CreateGetRunStepsRequest(threadId, runId, limit, order, after, before, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureRunStepsPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, runId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - /// - public override ClientResult GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) + public override IEnumerable GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) { Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); Argument.AssertNotNullOrEmpty(runId, nameof(runId)); - using PipelineMessage message = CreateGetRunStepsRequest(threadId, runId, limit, order, after, before, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureRunStepsPageEnumerator enumerator = new(Pipeline, _endpoint, threadId, runId, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } /// @@ -492,9 +487,6 @@ public override ClientResult DeleteThread(string threadId, RequestOptions option private new PipelineMessage CreateCreateAssistantRequest(BinaryContent content, RequestOptions options = null) => NewJsonPostBuilder(content, options).WithPath("assistants").Build(); - private new PipelineMessage CreateGetAssistantsRequest(int? limit, string order, string after, string before, RequestOptions options) - => NewGetListBuilder(limit, order, after, before, options).WithPath("assistants").Build(); - private new PipelineMessage CreateGetAssistantRequest(string assistantId, RequestOptions options) => NewJsonGetBuilder(options).WithPath("assistants", assistantId).Build(); @@ -522,9 +514,6 @@ private PipelineMessage CreateDeleteThreadRequest(string threadId, RequestOption private PipelineMessage CreateCreateMessageRequest(string threadId, BinaryContent content, RequestOptions options) => NewJsonPostBuilder(content, options).WithPath("threads", threadId, "messages").Build(); - private PipelineMessage CreateGetMessagesRequest(string threadId, int? limit, string order, string after, string before, RequestOptions options) - => NewGetListBuilder(limit, order, after, before, options).WithPath("threads", threadId, "messages").Build(); - private PipelineMessage CreateGetMessageRequest(string threadId, string messageId, RequestOptions options) => NewJsonGetBuilder(options).WithPath("threads", threadId, "messages", messageId).Build(); @@ -540,9 +529,6 @@ private PipelineMessage CreateCreateThreadAndRunRequest(BinaryContent content, R private PipelineMessage CreateCreateRunRequest(string threadId, BinaryContent content, RequestOptions options) => NewJsonPostBuilder(content, options).WithPath("threads", threadId, "runs").Build(); - private PipelineMessage CreateGetRunsRequest(string threadId, int? limit, string order, string after, string before, RequestOptions options) - => NewGetListBuilder(limit, order, after, before, options).WithPath("threads", threadId, "runs").Build(); - private PipelineMessage CreateGetRunRequest(string threadId, string runId, RequestOptions options) => NewJsonGetBuilder(options).WithPath("threads", threadId, "runs", runId).Build(); @@ -555,16 +541,14 @@ private PipelineMessage CreateCancelRunRequest(string threadId, string runId, Re private PipelineMessage CreateSubmitToolOutputsToRunRequest(string threadId, string runId, BinaryContent content, RequestOptions options) => NewJsonPostBuilder(content, options).WithPath("threads", threadId, "runs", runId, "submit_tool_outputs").Build(); - private PipelineMessage CreateGetRunStepsRequest(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) - => NewGetListBuilder(limit, order, after, before, options).WithPath("threads", threadId, "runs", runId, "steps").Build(); - private PipelineMessage CreateGetRunStepRequest(string threadId, string runId, string stepId, RequestOptions options) => NewJsonGetBuilder(options).WithPath("threads", threadId, "runs", runId, "steps", stepId).Build(); private AzureOpenAIPipelineMessageBuilder NewBuilder(RequestOptions options) => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) - .WithHeader(s_OpenAIBetaFeatureHeader, s_OpenAIBetaAssistantsV2HeaderValue) + .WithAssistantsHeader() .WithOptions(options); + private AzureOpenAIPipelineMessageBuilder NewJsonPostBuilder(BinaryContent content, RequestOptions options) => NewBuilder(options) .WithMethod("POST") @@ -583,11 +567,5 @@ private AzureOpenAIPipelineMessageBuilder NewJsonDeleteBuilder(RequestOptions op private AzureOpenAIPipelineMessageBuilder NewGetListBuilder(int? limit, string order, string after, string before, RequestOptions options) => NewJsonGetBuilder(options) - .WithOptionalQueryParameter("limit", limit) - .WithOptionalQueryParameter("order", order) - .WithOptionalQueryParameter("after", after) - .WithOptionalQueryParameter("before", before); - - private static readonly string s_OpenAIBetaFeatureHeader = "OpenAI-Beta"; - private static readonly string s_OpenAIBetaAssistantsV2HeaderValue = "assistants=v2"; + .WithCommonListParameters(limit, order, after, before); } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.cs index 1d1b3b840f15..c8b48f925c28 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/AzureAssistantClient.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using OpenAI.Assistants; using System.ClientModel.Primitives; namespace Azure.AI.OpenAI.Assistants; @@ -17,13 +16,13 @@ internal partial class AzureAssistantClient : AssistantClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureAssistantClient( - ClientPipeline pipeline, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + internal AzureAssistantClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _endpoint = endpoint; _apiVersion = options.Version; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureAssistantsPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureAssistantsPageEnumerator.cs new file mode 100644 index 000000000000..f351279a7f04 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureAssistantsPageEnumerator.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +#nullable enable + +namespace Azure.AI.OpenAI.Assistants; + +internal partial class AzureAssistantsPageEnumerator : AssistantsPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureAssistantsPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + int? limit, string order, string after, string before, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, limit, order, after, before, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetAssistantsAsync(int? limit, string order, string after, string before, RequestOptions options) + { + using PipelineMessage message = CreateGetAssistantsRequest(limit, order, after, before, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetAssistants(int? limit, string order, string after, string before, RequestOptions options) + { + using PipelineMessage message = CreateGetAssistantsRequest(limit, order, after, before, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private PipelineMessage CreateGetAssistantsRequest(int? limit, string order, string after, string before, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithPath("assistants") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureMessagesPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureMessagesPageEnumerator.cs new file mode 100644 index 000000000000..79ad28d13aa4 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureMessagesPageEnumerator.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.Assistants; + +internal partial class AzureMessagesPageEnumerator : MessagesPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureMessagesPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + string threadId, + int? limit, string order, string after, string before, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, threadId, limit, order, after, before, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetMessagesAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + + using PipelineMessage message = CreateGetMessagesRequest(threadId, limit, order, after, before, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetMessages(string threadId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + + using PipelineMessage message = CreateGetMessagesRequest(threadId, limit, order, after, before, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private PipelineMessage CreateGetMessagesRequest(string threadId, int? limit, string order, string after, string before, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithPath("threads", threadId, "messages") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunStepsPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunStepsPageEnumerator.cs new file mode 100644 index 000000000000..e7f6ae90293f --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunStepsPageEnumerator.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.Assistants; + +internal partial class AzureRunStepsPageEnumerator : RunStepsPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureRunStepsPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + string threadId, string runId, + int? limit, string order, string after, string before, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, threadId, runId, limit, order, after, before, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + Argument.AssertNotNullOrEmpty(runId, nameof(runId)); + + using PipelineMessage message = CreateGetRunStepsRequest(threadId, runId, limit, order, after, before, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + Argument.AssertNotNullOrEmpty(runId, nameof(runId)); + + using PipelineMessage message = CreateGetRunStepsRequest(threadId, runId, limit, order, after, before, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private PipelineMessage CreateGetRunStepsRequest(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithPath("threads", threadId, "runs", runId, "steps") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunsPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunsPageEnumerator.cs new file mode 100644 index 000000000000..65afbca20db1 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Assistants/Internal/Pagination/AzureRunsPageEnumerator.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.Assistants; + +internal partial class AzureRunsPageEnumerator : RunsPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureRunsPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + string threadId, int? limit, string order, string after, string before, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, threadId, limit, order, after, before, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetRunsAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + + using PipelineMessage message = CreateGetRunsRequest(threadId, limit, order, after, before, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetRuns(string threadId, int? limit, string order, string after, string before, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(threadId, nameof(threadId)); + + using PipelineMessage message = CreateGetRunsRequest(threadId, limit, order, after, before, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private PipelineMessage CreateGetRunsRequest(string threadId, int? limit, string order, string after, string before, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithPath("threads", threadId, "runs") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.Protocol.cs index 98275f6870a4..874b4f3bef32 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.Protocol.cs @@ -41,14 +41,14 @@ public override async Task TranslateAudioAsync(BinaryContent conte } [EditorBrowsable(EditorBrowsableState.Never)] - public override ClientResult GenerateSpeechFromText(BinaryContent content, RequestOptions options = null) + public override ClientResult GenerateSpeech(BinaryContent content, RequestOptions options = null) { using PipelineMessage message = CreateGenerateSpeechFromTextRequestMessage(content, options); return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); } [EditorBrowsable(EditorBrowsableState.Never)] - public override async Task GenerateSpeechFromTextAsync(BinaryContent content, RequestOptions options = null) + public override async Task GenerateSpeechAsync(BinaryContent content, RequestOptions options = null) { using PipelineMessage message = CreateGenerateSpeechFromTextRequestMessage(content, options); PipelineResponse response = await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.cs index 30cfa6429471..f15480951d1a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Audio/AzureAudioClient.cs @@ -18,14 +18,14 @@ internal partial class AzureAudioClient : AudioClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureAudioClient( - ClientPipeline pipeline, - string deploymentName, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, model: deploymentName, endpoint, null) + internal AzureAudioClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, model: deploymentName, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _deploymentName = deploymentName; _endpoint = endpoint; _apiVersion = options.Version; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs index c44bac27f129..9569b4ef6abd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs @@ -1,6 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +global using OpenAI; +global using OpenAI.Assistants; +global using OpenAI.Audio; +global using OpenAI.Batch; +global using OpenAI.Chat; +global using OpenAI.Embeddings; +global using OpenAI.Files; +global using OpenAI.FineTuning; +global using OpenAI.Images; +global using OpenAI.Models; +global using OpenAI.Moderations; +global using OpenAI.VectorStores; + using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; @@ -15,18 +28,6 @@ using Azure.AI.OpenAI.Images; using Azure.AI.OpenAI.VectorStores; using Azure.Core; -using OpenAI; -using OpenAI.Assistants; -using OpenAI.Audio; -using OpenAI.Batch; -using OpenAI.Chat; -using OpenAI.Embeddings; -using OpenAI.Files; -using OpenAI.FineTuning; -using OpenAI.Images; -using OpenAI.Models; -using OpenAI.Moderations; -using OpenAI.VectorStores; #pragma warning disable AZC0007 @@ -40,6 +41,7 @@ namespace Azure.AI.OpenAI; /// public partial class AzureOpenAIClient : OpenAIClient { + private readonly Uri _endpoint; private readonly AzureOpenAIClientOptions _options; /// @@ -52,64 +54,77 @@ public partial class AzureOpenAIClient : OpenAIClient /// /// /// - /// - /// - /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. - /// + /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com. + /// The API key to authenticate with the service. + public AzureOpenAIClient(Uri endpoint, ApiKeyCredential credential) : this(endpoint, credential, new AzureOpenAIClientOptions()) + { + } + + /// + /// Creates a new instance of that will connect to a specified Azure OpenAI + /// service resource endpoint using an API key. + /// + /// /// - /// Example: https://my-resource.openai.azure.com + /// For token-based authentication, including the use of managed identity, please use the alternate constructor: + /// /// - /// - /// The API key to use when authenticating with the specified endpoint. - /// Additional options for the client. - public AzureOpenAIClient(Uri endpoint, ApiKeyCredential credential, AzureOpenAIClientOptions options = null) - : this( - CreatePipeline(GetApiKey(credential, requireExplicitCredential: true), options), - GetEndpoint(endpoint, requireExplicitEndpoint: true), - options) - {} - - /// - public AzureOpenAIClient(Uri endpoint, AzureKeyCredential credential, AzureOpenAIClientOptions options = null) - : this( - CreatePipeline(GetApiKey(new ApiKeyCredential(credential?.Key), requireExplicitCredential: true), options), - GetEndpoint(endpoint, requireExplicitEndpoint: true), - options) - {} + /// + /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com. + /// The API key to authenticate with the service. + public AzureOpenAIClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AzureOpenAIClientOptions()) + { + } /// /// Creates a new instance of that will connect to an Azure OpenAI service resource - /// using endpoint and authentication settings from available configuration information. + /// using token authentication, including for tokens issued via managed identity. + /// + /// + /// For API-key-based authentication, please use the alternate constructor: + /// + /// + /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com. + /// The token credential to authenticate with the service. + public AzureOpenAIClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AzureOpenAIClientOptions()) + { + } + + /// + /// Creates a new instance of that will connect to a specified Azure OpenAI + /// service resource endpoint using an API key. /// /// /// /// For token-based authentication, including the use of managed identity, please use the alternate constructor: /// /// + /// + /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com. + /// The API key to authenticate with the service. + /// The options to configure the client. + public AzureOpenAIClient(Uri endpoint, ApiKeyCredential credential, AzureOpenAIClientOptions options) + : this(CreatePipeline(credential, options), endpoint, options) + { + } + + /// + /// Creates a new instance of that will connect to a specified Azure OpenAI + /// service resource endpoint using an API key. + /// + /// /// - /// The client selects its resource endpoint in the following order of precedence: - /// - /// The property on , if available - /// The setting in an applicable IConfiguration instance, if available - /// The value of the AZURE_OPENAI_ENDPOINT environment variable, if present - /// - /// - /// The client selects its API key credential in the following order of precedence: - /// - /// The setting in an applicable IConfiguration instance, if available - /// The value of the AZURE_OPENAI_API_KEY environment variable, if present - /// - /// - /// Note: resource endpoints should not include model deployment or operation information. - /// - /// - /// Example: https://my-resource.openai.azure.com + /// For token-based authentication, including the use of managed identity, please use the alternate constructor: + /// /// /// - /// Additional options for the client. - public AzureOpenAIClient(AzureOpenAIClientOptions options = null) - : this(CreatePipeline(GetApiKey(), options), GetEndpoint(), options) - {} + /// The Azure OpenAI resource endpoint to use. This should not include model deployment or operation information. For example: https://my-resource.openai.azure.com. + /// The API key to authenticate with the service. + /// The options to configure the client. + public AzureOpenAIClient(Uri endpoint, AzureKeyCredential credential, AzureOpenAIClientOptions options) + : this(CreatePipeline(credential?.Key, options), endpoint, options) + { + } /// /// Creates a new instance of that will connect to an Azure OpenAI service resource @@ -127,15 +142,11 @@ public AzureOpenAIClient(AzureOpenAIClientOptions options = null) /// Example: https://my-resource.openai.azure.com /// /// - /// - /// - /// The API key to use when authenticating with the provided endpoint. - /// - /// + /// The API key to use when authenticating with the provided endpoint. /// The scenario-independent options to use. public AzureOpenAIClient(Uri endpoint, TokenCredential credential, AzureOpenAIClientOptions options = null) - : this(CreatePipeline(credential, options), GetEndpoint(endpoint, requireExplicitEndpoint: true), options) - {} + : this(CreatePipeline(credential, options), endpoint, options) + { } /// /// Creates a new instance of . @@ -144,8 +155,13 @@ public AzureOpenAIClient(Uri endpoint, TokenCredential credential, AzureOpenAICl /// The endpoint to use. /// The additional client options to use. protected AzureOpenAIClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); + options ??= new(); + + _endpoint = endpoint; _options = options; } @@ -161,7 +177,7 @@ protected AzureOpenAIClient() /// A new instance. [Experimental("OPENAI001")] public override AssistantClient GetAssistantClient() - => new AzureAssistantClient(Pipeline, Endpoint, _options); + => new AzureAssistantClient(Pipeline, _endpoint, _options); /// /// Gets a new instance configured for audio operation use with the Azure OpenAI service. @@ -169,7 +185,7 @@ public override AssistantClient GetAssistantClient() /// The model deployment name to use for the new client's audio operations. /// A new instance. public override AudioClient GetAudioClient(string deploymentName) - => new AzureAudioClient(Pipeline, deploymentName, Endpoint, _options); + => new AzureAudioClient(Pipeline, deploymentName, _endpoint, _options); /// /// Gets a new instance configured for batch operation use with the Azure OpenAI service. @@ -177,7 +193,7 @@ public override AudioClient GetAudioClient(string deploymentName) /// The model deployment name to use for the new client's audio operations. /// A new instance. public BatchClient GetBatchClient(string deploymentName) - => new AzureBatchClient(Pipeline, deploymentName, Endpoint, _options); + => new AzureBatchClient(Pipeline, deploymentName, _endpoint, _options); /// /// This method is unsupported for Azure OpenAI. Please use the alternate @@ -192,7 +208,7 @@ public BatchClient GetBatchClient(string deploymentName) /// The model deployment name to use for the new client's chat completion operations. /// A new instance. public override ChatClient GetChatClient(string deploymentName) - => new AzureChatClient(Pipeline, deploymentName, Endpoint, _options); + => new AzureChatClient(Pipeline, deploymentName, _endpoint, _options); /// /// Gets a new instance configured for embedding operation use with the Azure OpenAI service. @@ -200,21 +216,21 @@ public override ChatClient GetChatClient(string deploymentName) /// The model deployment name to use for the new client's embedding operations. /// A new instance. public override EmbeddingClient GetEmbeddingClient(string deploymentName) - => new AzureEmbeddingClient(Pipeline, deploymentName, Endpoint, _options); + => new AzureEmbeddingClient(Pipeline, deploymentName, _endpoint, _options); /// /// Gets a new instance configured for file operation use with the Azure OpenAI service. /// /// A new instance. public override FileClient GetFileClient() - => new AzureFileClient(Pipeline, Endpoint, _options); + => new AzureFileClient(Pipeline, _endpoint, _options); /// /// Gets a new instance configured for fine-tuning operation use with the Azure OpenAI service. /// /// A new instance. public override FineTuningClient GetFineTuningClient() - => new AzureFineTuningClient(Pipeline, Endpoint, _options); + => new AzureFineTuningClient(Pipeline, _endpoint, _options); /// /// Gets a new instance configured for image operation use with the Azure OpenAI service. @@ -222,7 +238,7 @@ public override FineTuningClient GetFineTuningClient() /// The model deployment name to use for the new client's image operations. /// A new instance. public override ImageClient GetImageClient(string deploymentName) - => new AzureImageClient(Pipeline, deploymentName, Endpoint, _options); + => new AzureImageClient(Pipeline, deploymentName, _endpoint, _options); /// /// Model management operations are not supported with Azure OpenAI. @@ -248,7 +264,7 @@ public override ModerationClient GetModerationClient(string _) /// A new instance. [Experimental("OPENAI001")] public override VectorStoreClient GetVectorStoreClient() - => new AzureVectorStoreClient(Pipeline, Endpoint, _options); + => new AzureVectorStoreClient(Pipeline, _endpoint, _options); private static ClientPipeline CreatePipeline(PipelinePolicy authenticationPolicy, AzureOpenAIClientOptions options) => ClientPipeline.Create( @@ -278,84 +294,33 @@ internal static ClientPipeline CreatePipeline(TokenCredential credential, AzureO return CreatePipeline(new AzureTokenAuthenticationPolicy(credential, [authorizationScope]), options); } - internal static new ApiKeyCredential GetApiKey(ApiKeyCredential explicitCredential = null, bool requireExplicitCredential = false) - { - if (explicitCredential is not null) - { - return explicitCredential; - } - // To do: IConfiguration support - else if (requireExplicitCredential) - { - throw new ArgumentNullException(nameof(explicitCredential), $"A non-null credential value is required."); - } - else - { - string environmentApiKey = Environment.GetEnvironmentVariable(s_aoaiApiKeyEnvironmentVariable); - if (string.IsNullOrEmpty(environmentApiKey)) - { - throw new InvalidOperationException( - $"No environment variable value was found for AZURE_OPENAI_API_KEY. " - + "Please either populate this environment variable or provide authentication information directly " - + "to the client constructor."); - } - return new(environmentApiKey); - } - } - - internal static Uri GetEndpoint(Uri explicitEndpoint = null, bool requireExplicitEndpoint = false, AzureOpenAIClientOptions options = null) - { - if (explicitEndpoint is not null) - { - return explicitEndpoint; - } - // To do: IConfiguration support - else if (requireExplicitEndpoint) - { - throw new ArgumentNullException(nameof(explicitEndpoint), $"A non-null endpoint value is required."); - } - else - { - string environmentApiKey = Environment.GetEnvironmentVariable(s_aoaiEndpointEnvironmentVariable); - if (string.IsNullOrEmpty(environmentApiKey)) - { - throw new InvalidOperationException( - $"No environment variable value was found for AZURE_OPENAI_ENDPOINT. " - + "Please either populate this environment variable or provide endpoint information directly " - + "to the client constructor."); - } - return new(environmentApiKey); - } - } - private static PipelinePolicy CreateAddUserAgentHeaderPolicy(AzureOpenAIClientOptions options = null) { Core.TelemetryDetails telemetryDetails = new(typeof(AzureOpenAIClient).Assembly, options?.ApplicationId); - return new GenericActionPipelinePolicy(message => - { - if (message?.Request?.Headers?.TryGetValue(s_userAgentHeaderKey, out string _) == false) + return new GenericActionPipelinePolicy( + requestAction: request => { - message.Request.Headers.Set(s_userAgentHeaderKey, telemetryDetails.ToString()); - } - }); + if (request?.Headers?.TryGetValue(s_userAgentHeaderKey, out string _) == false) + { + request.Headers.Set(s_userAgentHeaderKey, telemetryDetails.ToString()); + } + }); } private static PipelinePolicy CreateAddClientRequestIdHeaderPolicy() { - return new GenericActionPipelinePolicy(message => + return new GenericActionPipelinePolicy(request => { - if (message?.Request?.Headers is not null) + if (request?.Headers is not null) { - string requestId = message.Request.Headers.TryGetValue(s_clientRequestIdHeaderKey, out string existingHeader) == true + string requestId = request.Headers.TryGetValue(s_clientRequestIdHeaderKey, out string existingHeader) == true ? existingHeader : Guid.NewGuid().ToString().ToLowerInvariant(); - message.Request.Headers.Set(s_clientRequestIdHeaderKey, requestId); + request.Headers.Set(s_clientRequestIdHeaderKey, requestId); } }); } - private static readonly string s_aoaiEndpointEnvironmentVariable = "AZURE_OPENAI_ENDPOINT"; - private static readonly string s_aoaiApiKeyEnvironmentVariable = "AZURE_OPENAI_API_KEY"; private static readonly string s_userAgentHeaderKey = "User-Agent"; private static readonly string s_clientRequestIdHeaderKey = "x-ms-client-request-id"; private static PipelineMessageClassifier s_pipelineMessageClassifier; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs index 35149393235b..1b2989bfb2f3 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClientOptions.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System.ClientModel.Primitives; -using OpenAI; namespace Azure.AI.OpenAI; @@ -56,6 +55,7 @@ public AzureOpenAIClientOptions(ServiceVersion version = LatestVersion) ServiceVersion.V2024_04_01_Preview => "2024-04-01-preview", ServiceVersion.V2024_05_01_Preview => "2024-05-01-preview", ServiceVersion.V2024_06_01 => "2024-06-01", + ServiceVersion.V2024_07_01_Preview => "2024-07-01-preview", _ => throw new NotSupportedException() }; RetryPolicy = new RetryWithDelaysPolicy(); @@ -68,6 +68,7 @@ public enum ServiceVersion V2024_04_01_Preview = 7, V2024_05_01_Preview = 8, V2024_06_01 = 9, + V2024_07_01_Preview = 10, } internal class RetryWithDelaysPolicy : ClientRetryPolicy @@ -98,5 +99,5 @@ protected override TimeSpan GetNextDelay(PipelineMessage message, int tryCount) } } - private const ServiceVersion LatestVersion = ServiceVersion.V2024_05_01_Preview; + private const ServiceVersion LatestVersion = ServiceVersion.V2024_07_01_Preview; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs index f2777135e638..e04d9daf972b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Batch/AzureBatchClient.cs @@ -18,15 +18,14 @@ internal partial class AzureBatchClient : BatchClient private readonly string _deploymentName; private readonly string _apiVersion; - internal AzureBatchClient( - ClientPipeline pipeline, - string deploymentName, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + internal AzureBatchClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { - options ??= new(); + Argument.AssertNotNull(pipeline, nameof(pipeline)); Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); + options ??= new(); + _deploymentName = deploymentName; _endpoint = endpoint; _apiVersion = options.Version; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatClient.cs index 8b1df86399f5..73ee82a0398b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatClient.cs @@ -21,24 +21,24 @@ internal partial class AzureChatClient : ChatClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureChatClient( - ClientPipeline pipeline, - string deploymentName, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, model: deploymentName, endpoint, null) + internal AzureChatClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, model: deploymentName, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _deploymentName = deploymentName; - _endpoint = endpoint; _apiVersion = options.Version; + _endpoint = endpoint; } protected AzureChatClient() { } /// - public override AsyncResultCollection CompleteChatStreamingAsync(IEnumerable messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default) + public override AsyncCollectionResult CompleteChatStreamingAsync(IEnumerable messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default) { options ??= new(); options.StreamOptions = null; @@ -46,7 +46,7 @@ public override AsyncResultCollection CompleteCha } /// - public override ResultCollection CompleteChatStreaming(IEnumerable messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default) + public override CollectionResult CompleteChatStreaming(IEnumerable messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default) { options ??= new(); options.StreamOptions = null; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletion.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletion.cs index 104fa3770be3..299f2dea3a59 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletion.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletion.cs @@ -16,7 +16,7 @@ public static partial class AzureChatCompletionExtensions public static ContentFilterResultForPrompt GetContentFilterResultForPrompt(this ChatCompletion chatCompletion) { return AdditionalPropertyHelpers.GetAdditionalListProperty( - chatCompletion._serializedAdditionalRawData, + chatCompletion.SerializedAdditionalRawData, "prompt_filter_results")?[0]; } @@ -24,7 +24,7 @@ public static ContentFilterResultForPrompt GetContentFilterResultForPrompt(this public static ContentFilterResultForResponse GetContentFilterResultForResponse(this ChatCompletion chatCompletion) { return AdditionalPropertyHelpers.GetAdditionalProperty( - chatCompletion.Choices?[0]?._serializedAdditionalRawData, + chatCompletion.Choices?[0]?.SerializedAdditionalRawData, "content_filter_results"); } @@ -32,7 +32,7 @@ public static ContentFilterResultForResponse GetContentFilterResultForResponse(t public static AzureChatMessageContext GetAzureMessageContext(this ChatCompletion chatCompletion) { return AdditionalPropertyHelpers.GetAdditionalProperty( - chatCompletion.Choices?[0]?.Message?._serializedAdditionalRawData, + chatCompletion.Choices?[0]?.Message?.SerializedAdditionalRawData, "context"); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletionOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletionOptions.cs index d452e882995b..54ab5606ebbb 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletionOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureChatCompletionOptions.cs @@ -4,7 +4,6 @@ using System.Diagnostics.CodeAnalysis; using Azure.AI.OpenAI.Chat; using Azure.AI.OpenAI.Internal; -using OpenAI.Chat; namespace Azure.AI.OpenAI; @@ -13,15 +12,16 @@ public static partial class AzureChatCompletionOptionsExtensions [Experimental("AOAI001")] public static void AddDataSource(this ChatCompletionOptions options, AzureChatDataSource dataSource) { - options._serializedAdditionalRawData ??= new ChangeTrackingDictionary(); + options.SerializedAdditionalRawData ??= new Dictionary(); + IList existingSources = AdditionalPropertyHelpers.GetAdditionalListProperty( - options._serializedAdditionalRawData, + options.SerializedAdditionalRawData, "data_sources") ?? new ChangeTrackingList(); existingSources.Add(dataSource); AdditionalPropertyHelpers.SetAdditionalProperty( - options._serializedAdditionalRawData, + options.SerializedAdditionalRawData, "data_sources", existingSources); } @@ -30,7 +30,7 @@ IList existingSources public static IReadOnlyList GetDataSources(this ChatCompletionOptions options) { return AdditionalPropertyHelpers.GetAdditionalListProperty( - options._serializedAdditionalRawData, + options.SerializedAdditionalRawData, "data_sources") as IReadOnlyList; } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureStreamingChatCompletionUpdate.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureStreamingChatCompletionUpdate.cs index 3799a9068247..9de53f530bc3 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureStreamingChatCompletionUpdate.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/AzureStreamingChatCompletionUpdate.cs @@ -18,7 +18,7 @@ public static AzureChatMessageContext GetAzureMessageContext(this StreamingChatC if (chatUpdate.Choices?.Count > 0) { return AdditionalPropertyHelpers.GetAdditionalProperty( - chatUpdate.Choices[0].Delta?._serializedAdditionalRawData, + chatUpdate.Choices[0].Delta?.SerializedAdditionalRawData, "context"); } return null; @@ -28,7 +28,7 @@ public static AzureChatMessageContext GetAzureMessageContext(this StreamingChatC public static ContentFilterResultForPrompt GetContentFilterResultForPrompt(this StreamingChatCompletionUpdate chatUpdate) { return AdditionalPropertyHelpers.GetAdditionalListProperty( - chatUpdate._serializedAdditionalRawData, + chatUpdate.SerializedAdditionalRawData, "prompt_filter_results")?[0]; } @@ -36,7 +36,7 @@ public static ContentFilterResultForPrompt GetContentFilterResultForPrompt(this public static ContentFilterResultForResponse GetContentFilterResultForResponse(this StreamingChatCompletionUpdate chatUpdate) { return AdditionalPropertyHelpers.GetAdditionalProperty( - chatUpdate?.Choices?.ElementAtOrDefault(0)?._serializedAdditionalRawData, + chatUpdate?.Choices?.ElementAtOrDefault(0)?.SerializedAdditionalRawData, "content_filter_results"); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/GeneratorStubs.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/GeneratorStubs.cs index 50801d605640..368320c83313 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/GeneratorStubs.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/GeneratorStubs.cs @@ -6,6 +6,6 @@ namespace Azure.AI.OpenAI.Chat; [CodeGenModel("AzureChatDataSource")] public abstract partial class AzureChatDataSource { } [CodeGenModel("AzureChatMessageContextCitation")] public partial class AzureChatCitation { } [CodeGenModel("AzureChatMessageContextAllRetrievedDocuments")] public partial class AzureChatRetrievedDocument { } +[CodeGenModel("AzureChatMessageContextAllRetrievedDocumentsFilterReason")] public readonly partial struct AzureChatRetrievedDocumentFilterReason { } [CodeGenModel("AzureChatMessageContext")] public partial class AzureChatMessageContext { } -[CodeGenModel("InternalAzureSearchChatDataSourceParametersQueryType")] public readonly partial struct DataSourceQueryType { } -[CodeGenModel("AzureChatRetrievedDocumentFilterReason")] public readonly partial struct AzureChatRetrievedDocumentFilterReason { } +[CodeGenModel("AzureSearchChatDataSourceParametersQueryType")] public readonly partial struct DataSourceQueryType { } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/GeneratorStubs.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/GeneratorStubs.cs index 8e3ce0996c52..4a2bb2bcdbb4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/GeneratorStubs.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/Internal/GeneratorStubs.cs @@ -12,6 +12,7 @@ namespace Azure.AI.OpenAI.Chat; [CodeGenModel("AzureChatDataSourceModelIdVectorizationSource")] internal partial class InternalAzureChatDataSourceModelIdVectorizationSource { } [CodeGenModel("AzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions")] internal partial class InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions { } [CodeGenModel("AzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions")] internal partial class InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions { } +[CodeGenModel("AzureSearchChatDataSourceParametersIncludeContext")] internal readonly partial struct InternalAzureSearchChatDataSourceParametersIncludeContext { } [CodeGenModel("UnknownAzureChatDataSource")] internal partial class InternalUnknownAzureChatDataSource { } [CodeGenModel("UnknownAzureChatDataSourceAuthenticationOptions")] internal partial class InternalUnknownAzureChatDataSourceAuthenticationOptions { } [CodeGenModel("UnknownAzureChatDataSourceVectorizationSource")] internal partial class InternalUnknownAzureChatDataSourceVectorizationSource { } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBChatDataSource.cs similarity index 84% rename from sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBDataSource.cs rename to sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBChatDataSource.cs index 4db71eab73f1..9f3933cdec69 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureCosmosDBChatDataSource.cs @@ -105,11 +105,19 @@ public DataSourceOutputContextFlags? OutputContextFlags /// /// Initializes a new instance of . /// - public AzureCosmosDBChatDataSource() + public AzureCosmosDBChatDataSource() : base(type: "azure_cosmos_db", serializedAdditionalRawData: null) { - Type = "azure_cosmos_db"; InternalParameters = new(); - _serializedAdditionalRawData = new ChangeTrackingDictionary(); + } + + // CUSTOM: Made internal. + /// Initializes a new instance of . + /// The parameter information to control the use of the Azure CosmosDB data source. + /// is null. + internal AzureCosmosDBChatDataSource(InternalAzureCosmosDBChatDataSourceParameters internalParameters) : this() + { + Argument.AssertNotNull(internalParameters, nameof(internalParameters)); + InternalParameters = internalParameters; } /// Initializes a new instance of . @@ -117,7 +125,8 @@ public AzureCosmosDBChatDataSource() /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal AzureCosmosDBChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureCosmosDBChatDataSourceParameters internalParameters) : base(type, serializedAdditionalRawData) + internal AzureCosmosDBChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureCosmosDBChatDataSourceParameters internalParameters) + : base(type, serializedAdditionalRawData) { InternalParameters = internalParameters; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningIndexChatDataSource.cs similarity index 83% rename from sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningChatDataSource.cs rename to sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningIndexChatDataSource.cs index 0d44d8f3a2f0..cd0550e0fa91 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureMachineLearningIndexChatDataSource.cs @@ -98,11 +98,19 @@ public string Filter /// /// Creates a new instance of . /// - public AzureMachineLearningIndexChatDataSource() + public AzureMachineLearningIndexChatDataSource() : base(type: "azure_ml_index", serializedAdditionalRawData: null) { - Type = "azure_ml_index"; InternalParameters = new(); - _serializedAdditionalRawData = new ChangeTrackingDictionary(); + } + + // CUSTOM: Made internal. + /// Initializes a new instance of . + /// The parameter information to control the use of the Azure Machine Learning Index data source. + /// is null. + internal AzureMachineLearningIndexChatDataSource(InternalAzureMachineLearningIndexChatDataSourceParameters internalParameters) + { + Argument.AssertNotNull(internalParameters, nameof(internalParameters)); + InternalParameters = internalParameters; } /// Initializes a new instance of . @@ -110,7 +118,8 @@ public AzureMachineLearningIndexChatDataSource() /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal AzureMachineLearningIndexChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureMachineLearningIndexChatDataSourceParameters internalParameters) : base(type, serializedAdditionalRawData) + internal AzureMachineLearningIndexChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureMachineLearningIndexChatDataSourceParameters internalParameters) + : base(type, serializedAdditionalRawData) { InternalParameters = internalParameters; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureSearchChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureSearchChatDataSource.cs index 698a04331b18..799cc13dc82d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureSearchChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/AzureSearchChatDataSource.cs @@ -119,11 +119,19 @@ public DataSourceVectorizer VectorizationSource /// /// Creates a new instance of . /// - public AzureSearchChatDataSource() + public AzureSearchChatDataSource() : base(type: "azure_search", serializedAdditionalRawData: null) { - Type = "azure_search"; InternalParameters = new(); - _serializedAdditionalRawData = new ChangeTrackingDictionary(); + } + + // CUSTOM: Made internal. + /// Initializes a new instance of . + /// The parameter information to control the use of the Azure Search data source. + /// is null. + internal AzureSearchChatDataSource(InternalAzureSearchChatDataSourceParameters internalParameters) : this() + { + Argument.AssertNotNull(internalParameters, nameof(internalParameters)); + InternalParameters = internalParameters; } /// Initializes a new instance of . @@ -131,7 +139,8 @@ public AzureSearchChatDataSource() /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal AzureSearchChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureSearchChatDataSourceParameters internalParameters) : base(type, serializedAdditionalRawData) + internal AzureSearchChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalAzureSearchChatDataSourceParameters internalParameters) + : base(type, serializedAdditionalRawData) { InternalParameters = internalParameters; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs index f65d0aff1665..8ded23802340 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/ElasticsearchChatDataSource.cs @@ -102,11 +102,20 @@ public DataSourceVectorizer VectorizationSource init => InternalParameters.VectorizationSource = value; } - public ElasticsearchChatDataSource() + public ElasticsearchChatDataSource() : base(type: "elasticsearch", serializedAdditionalRawData: null) { - Type = "elasticsearch"; InternalParameters = new(); - _serializedAdditionalRawData = new ChangeTrackingDictionary(); + } + + // CUSTOM: Made internal. + /// Initializes a new instance of . + /// The parameter information to control the use of the Elasticsearch data source. + /// is null. + internal ElasticsearchChatDataSource(InternalElasticsearchChatDataSourceParameters internalParameters) + : this() + { + Argument.AssertNotNull(internalParameters, nameof(internalParameters)); + InternalParameters = internalParameters; } /// Initializes a new instance of . @@ -114,7 +123,8 @@ public ElasticsearchChatDataSource() /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal ElasticsearchChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalElasticsearchChatDataSourceParameters internalParameters) : base(type, serializedAdditionalRawData) + internal ElasticsearchChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalElasticsearchChatDataSourceParameters internalParameters) + : base(type, serializedAdditionalRawData) { InternalParameters = internalParameters; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs index e4b20f1c168a..fd7106040de3 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Chat/OnYourData/PineconeChatDataSource.cs @@ -95,11 +95,19 @@ public DataSourceOutputContextFlags? OutputContextFlags init => InternalParameters.OutputContextFlags = value; } - public PineconeChatDataSource() + public PineconeChatDataSource() : base(type: "pinecone", serializedAdditionalRawData: null) { - Type = "pinecone"; InternalParameters = new(); - _serializedAdditionalRawData = new ChangeTrackingDictionary(); + } + + // CUSTOM: Made internal. + /// Initializes a new instance of . + /// The parameter information to control the use of the Pinecone data source. + /// is null. + internal PineconeChatDataSource(InternalPineconeChatDataSourceParameters internalParameters) : this() + { + Argument.AssertNotNull(internalParameters, nameof(internalParameters)); + InternalParameters = internalParameters; } /// Initializes a new instance of . @@ -107,7 +115,8 @@ public PineconeChatDataSource() /// Keeps track of any properties unknown to the library. /// The parameter information to control the use of the Azure Search data source. [SetsRequiredMembers] - internal PineconeChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalPineconeChatDataSourceParameters internalParameters) : base(type, serializedAdditionalRawData) + internal PineconeChatDataSource(string type, IDictionary serializedAdditionalRawData, InternalPineconeChatDataSourceParameters internalParameters) + : base(type, serializedAdditionalRawData) { InternalParameters = internalParameters; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs index 7aa29e337ee0..6c52e65392e0 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/GeneratorStubs.cs @@ -8,7 +8,7 @@ namespace Azure.AI.OpenAI; [CodeGenModel("AzureContentFilterResultForChoiceProtectedMaterialCodeCitation")] public partial class ContentFilterProtectedMaterialCitedResult { } [CodeGenModel("AzureContentFilterResultForPromptContentFilterResults")] internal partial class InternalAzureContentFilterResultForPromptContentFilterResults { } [CodeGenModel("AzureContentFilterResultForPromptContentFilterResultsError")] internal partial class InternalAzureContentFilterResultForPromptContentFilterResultsError { } -[CodeGenModel("ContentFilterSeverityResultSeverity")] public readonly partial struct ContentFilterSeverity { } +[CodeGenModel("AzureContentFilterSeverityResultSeverity")] public readonly partial struct ContentFilterSeverity { } [CodeGenModel("AzureContentFilterSeverityResult")] public partial class ContentFilterSeverityResult { [CodeGenMember("Severity")] diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/PageableResultHelpers.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/PageableResultHelpers.cs deleted file mode 100644 index c3112acda70c..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Common/PageableResultHelpers.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.ClientModel; - -#nullable enable - -namespace Azure.AI.OpenAI; - -internal class PageableResultHelpers -{ - public static PageableCollection Create(Func> firstPageFunc, Func>? nextPageFunc, int? pageSize = default) where T : notnull - { - ResultPage first(string? _, int? pageSizeHint) => firstPageFunc(pageSizeHint); - return new FuncPageable(first, nextPageFunc, pageSize); - } - - public static AsyncPageableCollection Create(Func>> firstPageFunc, Func>>? nextPageFunc, int? pageSize = default) where T : notnull - { - Task> first(string? _, int? pageSizeHint) => firstPageFunc(pageSizeHint); - return new FuncAsyncPageable(first, nextPageFunc, pageSize); - } - - private class FuncAsyncPageable : AsyncPageableCollection where T : notnull - { - private readonly Func>> _firstPageFunc; - private readonly Func>>? _nextPageFunc; - private readonly int? _defaultPageSize; - - public FuncAsyncPageable(Func>> firstPageFunc, Func>>? nextPageFunc, int? defaultPageSize = default) - { - _firstPageFunc = firstPageFunc; - _nextPageFunc = nextPageFunc; - _defaultPageSize = defaultPageSize; - } - - public override async IAsyncEnumerable> AsPages(string? continuationToken = default, int? pageSizeHint = default) - { - Func>>? pageFunc = string.IsNullOrEmpty(continuationToken) ? _firstPageFunc : _nextPageFunc; - - if (pageFunc == null) - { - yield break; - } - - int? pageSize = pageSizeHint ?? _defaultPageSize; - do - { - ResultPage page = await pageFunc(continuationToken, pageSize).ConfigureAwait(false); - SetRawResponse(page.GetRawResponse()); - yield return page; - continuationToken = page.ContinuationToken; - pageFunc = _nextPageFunc; - } - while (!string.IsNullOrEmpty(continuationToken) && pageFunc != null); - } - } - - private class FuncPageable : PageableCollection where T : notnull - { - private readonly Func> _firstPageFunc; - private readonly Func>? _nextPageFunc; - private readonly int? _defaultPageSize; - - public FuncPageable(Func> firstPageFunc, Func>? nextPageFunc, int? defaultPageSize = default) - { - _firstPageFunc = firstPageFunc; - _nextPageFunc = nextPageFunc; - _defaultPageSize = defaultPageSize; - } - - public override IEnumerable> AsPages(string? continuationToken = default, int? pageSizeHint = default) - { - Func>? pageFunc = string.IsNullOrEmpty(continuationToken) ? _firstPageFunc : _nextPageFunc; - - if (pageFunc == null) - { - yield break; - } - - int? pageSize = pageSizeHint ?? _defaultPageSize; - do - { - ResultPage page = pageFunc(continuationToken, pageSize); - SetRawResponse(page.GetRawResponse()); - yield return page; - continuationToken = page.ContinuationToken; - pageFunc = _nextPageFunc; - } - while (!string.IsNullOrEmpty(continuationToken) && pageFunc != null); - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Embeddings/AzureEmbeddingClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Embeddings/AzureEmbeddingClient.cs index 3748eedb0596..7bbdf247739a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Embeddings/AzureEmbeddingClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Embeddings/AzureEmbeddingClient.cs @@ -18,14 +18,14 @@ internal partial class AzureEmbeddingClient : EmbeddingClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureEmbeddingClient( - ClientPipeline pipeline, - string deploymentName, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, model: deploymentName, endpoint, null) + internal AzureEmbeddingClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, model: deploymentName, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _deploymentName = deploymentName; _endpoint = endpoint; _apiVersion = options.Version; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs index 60f5fc29764f..07b8d3ccfbdd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.Protocol.cs @@ -4,7 +4,6 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.ComponentModel; -using OpenAI.Files; namespace Azure.AI.OpenAI.Files; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs index b47727038bfc..60eb3403f0df 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Files/AzureFileClient.cs @@ -18,13 +18,13 @@ internal partial class AzureFileClient : FileClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureFileClient( - ClientPipeline pipeline, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + internal AzureFileClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _endpoint = endpoint; _apiVersion = options.Version; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningClient.cs index f1bb5dd67bbf..5c69e1bdd296 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/FineTuning/AzureFineTuningClient.cs @@ -17,13 +17,13 @@ internal partial class AzureFineTuningClient : FineTuningClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureFineTuningClient( - ClientPipeline pipeline, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + internal AzureFineTuningClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _endpoint = endpoint; _apiVersion = options.Version; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureGeneratedImage.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureGeneratedImage.cs index ea7447c1833a..d0adc6fa0db5 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureGeneratedImage.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureGeneratedImage.cs @@ -13,7 +13,7 @@ public static class AzureGeneratedImageExtensions public static ImageContentFilterResultForPrompt GetContentFilterResultForPrompt(this GeneratedImage image) { return AdditionalPropertyHelpers.GetAdditionalProperty( - image._serializedAdditionalRawData, + image.SerializedAdditionalRawData, "prompt_filter_results"); } @@ -21,7 +21,7 @@ public static ImageContentFilterResultForPrompt GetContentFilterResultForPrompt( public static ImageContentFilterResultForResponse GetContentFilterResultForResponse(this GeneratedImage image) { return AdditionalPropertyHelpers.GetAdditionalProperty( - image._serializedAdditionalRawData, + image.SerializedAdditionalRawData, "content_filter_results"); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureImageClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureImageClient.cs index be08662285f8..ebeda9dae8bd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureImageClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Images/AzureImageClient.cs @@ -18,14 +18,14 @@ internal partial class AzureImageClient : ImageClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureImageClient( - ClientPipeline pipeline, - string deploymentName, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, model: deploymentName, endpoint, null) + internal AzureImageClient(ClientPipeline pipeline, string deploymentName, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, model: deploymentName, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNullOrEmpty(deploymentName, nameof(deploymentName)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _deploymentName = deploymentName; _endpoint = endpoint; _apiVersion = options.Version; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/GeneratorStubs.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/GeneratorStubs.cs index 902382748c8b..ba8c821f4e1a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/GeneratorStubs.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/Internal/GeneratorStubs.cs @@ -3,6 +3,6 @@ namespace Azure.AI.OpenAI; -[CodeGenModel("AzureOpenAIErrorResponseAzureOpenAiChatError")] internal partial class AzureOpenAIChatErrorResponse { } +[CodeGenModel("AzureOpenAIChatErrorResponse")] internal partial class AzureOpenAIChatErrorResponse { } -[CodeGenModel("AzureOpenAIErrorResponseAzureOpenAiDalleError")] internal partial class AzureOpenAIDalleErrorResponse { } +[CodeGenModel("AzureOpenAIDalleErrorResponse")] internal partial class AzureOpenAIDalleErrorResponse { } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.Protocol.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.Protocol.cs index f76eba0893eb..b14c3b56e6e2 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.Protocol.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.Protocol.cs @@ -9,16 +9,16 @@ namespace Azure.AI.OpenAI.VectorStores; internal partial class AzureVectorStoreClient : VectorStoreClient { - public override async Task GetVectorStoresAsync(int? limit, string order, string after, string before, RequestOptions options) + public override IAsyncEnumerable GetVectorStoresAsync(int? limit, string order, string after, string before, RequestOptions options) { - using PipelineMessage message = CreateGetVectorStoresRequest(limit, order, after, before, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureVectorStoresPageEnumerator enumerator = new(Pipeline, _endpoint, limit, order, after, before, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - public override ClientResult GetVectorStores(int? limit, string order, string after, string before, RequestOptions options) + public override IEnumerable GetVectorStores(int? limit, string order, string after, string before, RequestOptions options) { - using PipelineMessage message = CreateGetVectorStoresRequest(limit, order, after, before, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureVectorStoresPageEnumerator enumerator = new(Pipeline, _endpoint, limit, order, after, before, _apiVersion,options); + return PageCollectionHelpers.Create(enumerator); } public override async Task CreateVectorStoreAsync(BinaryContent content, RequestOptions options = null) @@ -83,18 +83,20 @@ public override ClientResult DeleteVectorStore(string vectorStoreId, RequestOpti return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); } - public override async Task GetFileAssociationsAsync(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) + public override IAsyncEnumerable GetFileAssociationsAsync(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) { - using PipelineMessage message = CreateGetVectorStoreFilesRequest(vectorStoreId, limit, order, after, before, filter, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); + + AzureVectorStoreFilesPageEnumerator enumerator = new(Pipeline, _endpoint, vectorStoreId, limit, order, after, before, filter, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - public override ClientResult GetFileAssociations(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) + public override IEnumerable GetFileAssociations(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); - using PipelineMessage message = CreateGetVectorStoreFilesRequest(vectorStoreId, limit, order, after, before, filter, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureVectorStoreFilesPageEnumerator enumerator = new(Pipeline, _endpoint, vectorStoreId, limit, order, after, before, filter, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } public override async Task AddFileToVectorStoreAsync(string vectorStoreId, BinaryContent content, RequestOptions options = null) @@ -205,36 +207,24 @@ public override ClientResult CancelBatchFileJob(string vectorStoreId, string bat return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); } - public override async Task GetFileAssociationsAsync(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) + public override IAsyncEnumerable GetFileAssociationsAsync(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); - using PipelineMessage message = CreateGetFilesInVectorStoreBatchesRequest(vectorStoreId, batchId, limit, order, after, before, filter, options); - return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + AzureVectorStoreFileBatchesPageEnumerator enumerator = new(Pipeline, _endpoint, vectorStoreId, batchId, limit, order, after, before, filter, _apiVersion, options); + return PageCollectionHelpers.CreateAsync(enumerator); } - public override ClientResult GetFileAssociations(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) + public override IEnumerable GetFileAssociations(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) { Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); - using PipelineMessage message = CreateGetFilesInVectorStoreBatchesRequest(vectorStoreId, batchId, limit, order, after, before, filter, options); - return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + AzureVectorStoreFileBatchesPageEnumerator enumerator = new(Pipeline, _endpoint, vectorStoreId, batchId, limit, order, after, before, filter, _apiVersion, options); + return PageCollectionHelpers.Create(enumerator); } - private new PipelineMessage CreateGetVectorStoresRequest(int? limit, string order, string after, string before, RequestOptions options) - => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) - .WithMethod("GET") - .WithPath("vector_stores") - .WithOptionalQueryParameter("limit", limit) - .WithOptionalQueryParameter("order", order) - .WithOptionalQueryParameter("after", after) - .WithOptionalQueryParameter("before", before) - .WithAccept("application/json") - .WithOptions(options) - .Build(); - private new PipelineMessage CreateCreateVectorStoreRequest(BinaryContent content, RequestOptions options) => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) .WithMethod("POST") @@ -269,19 +259,6 @@ public override ClientResult GetFileAssociations(string vectorStoreId, string ba .WithOptions(options) .Build(); - private new PipelineMessage CreateGetVectorStoreFilesRequest(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) - => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) - .WithMethod("GET") - .WithPath("vector_stores", vectorStoreId, "files") - .WithOptionalQueryParameter("limit", limit) - .WithOptionalQueryParameter("order", order) - .WithOptionalQueryParameter("after", after) - .WithOptionalQueryParameter("before", before) - .WithOptionalQueryParameter("filter", filter) - .WithAccept("application/json") - .WithOptions(options) - .Build(); - private new PipelineMessage CreateCreateVectorStoreFileRequest(string vectorStoreId, BinaryContent content, RequestOptions options) => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) .WithMethod("POST") @@ -331,17 +308,4 @@ public override ClientResult GetFileAssociations(string vectorStoreId, string ba .WithAccept("application/json") .WithOptions(options) .Build(); - - private new PipelineMessage CreateGetFilesInVectorStoreBatchesRequest(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) - => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) - .WithMethod("GET") - .WithPath("vector_stores", vectorStoreId, "file_batches", batchId, "files") - .WithOptionalQueryParameter("limit", limit) - .WithOptionalQueryParameter("order", order) - .WithOptionalQueryParameter("after", after) - .WithOptionalQueryParameter("before", before) - .WithOptionalQueryParameter("filter", filter) - .WithAccept("application/json") - .WithOptions(options) - .Build(); } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.cs index 356598e13973..52b07ee81b6c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/AzureVectorStoreClient.cs @@ -19,13 +19,13 @@ internal partial class AzureVectorStoreClient : VectorStoreClient private readonly Uri _endpoint; private readonly string _apiVersion; - internal AzureVectorStoreClient( - ClientPipeline pipeline, - Uri endpoint, - AzureOpenAIClientOptions options) - : base(pipeline, endpoint, null) + internal AzureVectorStoreClient(ClientPipeline pipeline, Uri endpoint, AzureOpenAIClientOptions options) + : base(pipeline, new OpenAIClientOptions() { Endpoint = endpoint }) { + Argument.AssertNotNull(pipeline, nameof(pipeline)); + Argument.AssertNotNull(endpoint, nameof(endpoint)); options ??= new(); + _endpoint = endpoint; _apiVersion = options.Version; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFileBatchesPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFileBatchesPageEnumerator.cs new file mode 100644 index 000000000000..21ee0a3fbcf3 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFileBatchesPageEnumerator.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.VectorStores; + +internal partial class AzureVectorStoreFileBatchesPageEnumerator : VectorStoreFileBatchesPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureVectorStoreFileBatchesPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, vectorStoreId, batchId, limit, order, after, before, filter, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetFileAssociationsAsync(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + using PipelineMessage message = CreateGetFilesInVectorStoreBatchesRequest(vectorStoreId, batchId, limit, order, after, before, filter, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetFileAssociations(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); + Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); + + using PipelineMessage message = CreateGetFilesInVectorStoreBatchesRequest(vectorStoreId, batchId, limit, order, after, before, filter, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private new PipelineMessage CreateGetFilesInVectorStoreBatchesRequest(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithOptionalQueryParameter("filter", filter) + .WithPath("vector_stores", vectorStoreId, "file_batches", batchId, "files") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFilesPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFilesPageEnumerator.cs new file mode 100644 index 000000000000..4152a4869afa --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoreFilesPageEnumerator.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.VectorStores; + +internal partial class AzureVectorStoreFilesPageEnumerator : VectorStoreFilesPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureVectorStoreFilesPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + string vectorStoreId, + int? limit, string order, string after, string before, string filter, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, vectorStoreId, limit, order, after, before, filter, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetFileAssociationsAsync(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); + + using PipelineMessage message = CreateGetVectorStoreFilesRequest(vectorStoreId, limit, order, after, before, filter, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetFileAssociations(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) + { + Argument.AssertNotNullOrEmpty(vectorStoreId, nameof(vectorStoreId)); + + using PipelineMessage message = CreateGetVectorStoreFilesRequest(vectorStoreId, limit, order, after, before, filter, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private new PipelineMessage CreateGetVectorStoreFilesRequest(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithOptionalQueryParameter("filter", filter) + .WithPath("vector_stores", vectorStoreId, "files") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoresPageEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoresPageEnumerator.cs new file mode 100644 index 000000000000..d8a90039f331 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Custom/VectorStores/Internal/Pagination/AzureVectorStoresPageEnumerator.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Azure.AI.OpenAI.VectorStores; + +internal partial class AzureVectorStoresPageEnumerator : VectorStoresPageEnumerator +{ + private readonly Uri _endpoint; + private readonly string _apiVersion; + + public AzureVectorStoresPageEnumerator( + ClientPipeline pipeline, + Uri endpoint, + int? limit, string order, string after, string before, + string apiVersion, + RequestOptions options) + : base(pipeline, endpoint, limit, order, after, before, options) + { + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + internal override async Task GetVectorStoresAsync(int? limit, string order, string after, string before, RequestOptions options) + { + using PipelineMessage message = CreateGetVectorStoresRequest(limit, order, after, before, options); + return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); + } + + internal override ClientResult GetVectorStores(int? limit, string order, string after, string before, RequestOptions options) + { + using PipelineMessage message = CreateGetVectorStoresRequest(limit, order, after, before, options); + return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); + } + + private new PipelineMessage CreateGetVectorStoresRequest(int? limit, string order, string after, string before, RequestOptions options) + => new AzureOpenAIPipelineMessageBuilder(Pipeline, _endpoint, _apiVersion) + .WithAssistantsHeader() + .WithOptions(options) + .WithMethod("GET") + .WithAccept("application/json") + .WithCommonListParameters(limit, order, after, before) + .WithPath("vector_stores") + .Build(); +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.Serialization.cs index 0abc4674a668..7f9738eeaa69 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.Serialization.cs @@ -21,32 +21,39 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite } writer.WriteStartObject(); - writer.WritePropertyName("content"u8); - writer.WriteStringValue(Content); - if (Optional.IsDefined(Title)) + if (SerializedAdditionalRawData?.ContainsKey("content") != true) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + if (SerializedAdditionalRawData?.ContainsKey("title") != true && Optional.IsDefined(Title)) { writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); } - if (Optional.IsDefined(Url)) + if (SerializedAdditionalRawData?.ContainsKey("url") != true && Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); writer.WriteStringValue(Url); } - if (Optional.IsDefined(Filepath)) + if (SerializedAdditionalRawData?.ContainsKey("filepath") != true && Optional.IsDefined(Filepath)) { writer.WritePropertyName("filepath"u8); writer.WriteStringValue(Filepath); } - if (Optional.IsDefined(ChunkId)) + if (SerializedAdditionalRawData?.ContainsKey("chunk_id") != true && Optional.IsDefined(ChunkId)) { writer.WritePropertyName("chunk_id"u8); writer.WriteStringValue(ChunkId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -117,6 +124,7 @@ internal static AzureChatCitation DeserializeAzureChatCitation(JsonElement eleme } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.cs index 4a520f0001a8..114bc7d3b7e3 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatCitation.cs @@ -40,8 +40,7 @@ public partial class AzureChatCitation /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The content of the citation. /// is null. @@ -66,7 +65,7 @@ internal AzureChatCitation(string content, string title, string url, string file Url = url; Filepath = filepath; ChunkId = chunkId; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.Serialization.cs index 9f02fff75e5a..76263b02bcf7 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.cs index 5f4475a29950..01acaf5cf7c9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatDataSource.cs @@ -47,8 +47,7 @@ public abstract partial class AzureChatDataSource /// /// /// - private protected IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . protected AzureChatDataSource() { @@ -60,7 +59,7 @@ protected AzureChatDataSource() internal AzureChatDataSource(string type, IDictionary serializedAdditionalRawData) { Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The differentiating type identifier for the data source. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.Serialization.cs index a47998cc51b9..40f6cd625219 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.Serialization.cs @@ -21,12 +21,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteStartObject(); - if (Optional.IsDefined(Intent)) + if (SerializedAdditionalRawData?.ContainsKey("intent") != true && Optional.IsDefined(Intent)) { writer.WritePropertyName("intent"u8); writer.WriteStringValue(Intent); } - if (Optional.IsCollectionDefined(Citations)) + if (SerializedAdditionalRawData?.ContainsKey("citations") != true && Optional.IsCollectionDefined(Citations)) { writer.WritePropertyName("citations"u8); writer.WriteStartArray(); @@ -36,15 +36,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (Optional.IsDefined(AllRetrievedDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("all_retrieved_documents") != true && Optional.IsDefined(AllRetrievedDocuments)) { writer.WritePropertyName("all_retrieved_documents"u8); writer.WriteObjectValue(AllRetrievedDocuments, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -116,6 +120,7 @@ internal static AzureChatMessageContext DeserializeAzureChatMessageContext(JsonE } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.cs index f539840f9a87..dd23673682af 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatMessageContext.cs @@ -43,8 +43,7 @@ public partial class AzureChatMessageContext /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal AzureChatMessageContext() { @@ -61,7 +60,7 @@ internal AzureChatMessageContext(string intent, IReadOnlyList Intent = intent; Citations = citations; AllRetrievedDocuments = allRetrievedDocuments; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The detected intent from the chat history, which is used to carry conversation context between interactions. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.Serialization.cs index bb79f75d53ed..963e4902b26c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.Serialization.cs @@ -21,56 +21,69 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe } writer.WriteStartObject(); - writer.WritePropertyName("content"u8); - writer.WriteStringValue(Content); - if (Optional.IsDefined(Title)) + if (SerializedAdditionalRawData?.ContainsKey("content") != true) + { + writer.WritePropertyName("content"u8); + writer.WriteStringValue(Content); + } + if (SerializedAdditionalRawData?.ContainsKey("title") != true && Optional.IsDefined(Title)) { writer.WritePropertyName("title"u8); writer.WriteStringValue(Title); } - if (Optional.IsDefined(Url)) + if (SerializedAdditionalRawData?.ContainsKey("url") != true && Optional.IsDefined(Url)) { writer.WritePropertyName("url"u8); writer.WriteStringValue(Url); } - if (Optional.IsDefined(Filepath)) + if (SerializedAdditionalRawData?.ContainsKey("filepath") != true && Optional.IsDefined(Filepath)) { writer.WritePropertyName("filepath"u8); writer.WriteStringValue(Filepath); } - if (Optional.IsDefined(ChunkId)) + if (SerializedAdditionalRawData?.ContainsKey("chunk_id") != true && Optional.IsDefined(ChunkId)) { writer.WritePropertyName("chunk_id"u8); writer.WriteStringValue(ChunkId); } - writer.WritePropertyName("search_queries"u8); - writer.WriteStartArray(); - foreach (var item in SearchQueries) + if (SerializedAdditionalRawData?.ContainsKey("search_queries") != true) { - writer.WriteStringValue(item); + writer.WritePropertyName("search_queries"u8); + writer.WriteStartArray(); + foreach (var item in SearchQueries) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); } - writer.WriteEndArray(); - writer.WritePropertyName("data_source_index"u8); - writer.WriteNumberValue(DataSourceIndex); - if (Optional.IsDefined(OriginalSearchScore)) + if (SerializedAdditionalRawData?.ContainsKey("data_source_index") != true) + { + writer.WritePropertyName("data_source_index"u8); + writer.WriteNumberValue(DataSourceIndex); + } + if (SerializedAdditionalRawData?.ContainsKey("original_search_score") != true && Optional.IsDefined(OriginalSearchScore)) { writer.WritePropertyName("original_search_score"u8); writer.WriteNumberValue(OriginalSearchScore.Value); } - if (Optional.IsDefined(RerankScore)) + if (SerializedAdditionalRawData?.ContainsKey("rerank_score") != true && Optional.IsDefined(RerankScore)) { writer.WritePropertyName("rerank_score"u8); writer.WriteNumberValue(RerankScore.Value); } - if (Optional.IsDefined(FilterReason)) + if (SerializedAdditionalRawData?.ContainsKey("filter_reason") != true && Optional.IsDefined(FilterReason)) { writer.WritePropertyName("filter_reason"u8); - writer.WriteStringValue(FilterReason); + writer.WriteStringValue(FilterReason.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -114,7 +127,7 @@ internal static AzureChatRetrievedDocument DeserializeAzureChatRetrievedDocument int dataSourceIndex = default; double? originalSearchScore = default; double? rerankScore = default; - string filterReason = default; + AzureChatRetrievedDocumentFilterReason? filterReason = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -179,11 +192,16 @@ internal static AzureChatRetrievedDocument DeserializeAzureChatRetrievedDocument } if (property.NameEquals("filter_reason"u8)) { - filterReason = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + filterReason = new AzureChatRetrievedDocumentFilterReason(property.Value.GetString()); continue; } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.cs index f52465150cf9..c0e4b0f9499f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocument.cs @@ -41,8 +41,7 @@ public partial class AzureChatRetrievedDocument /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The content of the citation. /// The search queries executed to retrieve documents. @@ -70,7 +69,7 @@ internal AzureChatRetrievedDocument(string content, IEnumerable searchQu /// The rerank score for the retrieval. /// If applicable, an indication of why the document was filtered. /// Keeps track of any properties unknown to the library. - internal AzureChatRetrievedDocument(string content, string title, string url, string filepath, string chunkId, IReadOnlyList searchQueries, int dataSourceIndex, double? originalSearchScore, double? rerankScore, string filterReason, IDictionary serializedAdditionalRawData) + internal AzureChatRetrievedDocument(string content, string title, string url, string filepath, string chunkId, IReadOnlyList searchQueries, int dataSourceIndex, double? originalSearchScore, double? rerankScore, AzureChatRetrievedDocumentFilterReason? filterReason, IDictionary serializedAdditionalRawData) { Content = content; Title = title; @@ -82,7 +81,7 @@ internal AzureChatRetrievedDocument(string content, string title, string url, st OriginalSearchScore = originalSearchScore; RerankScore = rerankScore; FilterReason = filterReason; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. @@ -109,6 +108,6 @@ internal AzureChatRetrievedDocument() /// The rerank score for the retrieval. public double? RerankScore { get; } /// If applicable, an indication of why the document was filtered. - public string FilterReason { get; } + public AzureChatRetrievedDocumentFilterReason? FilterReason { get; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocumentFilterReason.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocumentFilterReason.cs index 4f967c1e54b8..36be671328af 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocumentFilterReason.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureChatRetrievedDocumentFilterReason.cs @@ -7,7 +7,7 @@ namespace Azure.AI.OpenAI.Chat { - /// Enum for filter_reason in AzureChatRetrievedDocument. + /// The AzureChatMessageContextAllRetrievedDocumentsFilterReason. public readonly partial struct AzureChatRetrievedDocumentFilterReason : IEquatable { private readonly string _value; @@ -41,7 +41,7 @@ public AzureChatRetrievedDocumentFilterReason(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.Serialization.cs index a1ae73bfad63..9b490f30b703 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } writer.WriteStartObject(); - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(InternalParameters, options); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static AzureCosmosDBChatDataSource DeserializeAzureCosmosDBChatDataSour } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.cs index abe8b534deac..e33af59b8779 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureCosmosDBChatDataSource.cs @@ -10,15 +10,5 @@ namespace Azure.AI.OpenAI.Chat /// Represents a data source configuration that will use an Azure CosmosDB resource. public partial class AzureCosmosDBChatDataSource : AzureChatDataSource { - /// Initializes a new instance of . - /// The parameter information to control the use of the Azure CosmosDB data source. - /// is null. - internal AzureCosmosDBChatDataSource(InternalAzureCosmosDBChatDataSourceParameters internalParameters) - { - Argument.AssertNotNull(internalParameters, nameof(internalParameters)); - - Type = "azure_cosmos_db"; - InternalParameters = internalParameters; - } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.Serialization.cs index 3b7cbcd774aa..2384629e5184 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(InternalParameters, options); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static AzureMachineLearningIndexChatDataSource DeserializeAzureMachineL } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.cs index ca6ab72f7e23..7abef53a23bf 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureMachineLearningIndexChatDataSource.cs @@ -10,15 +10,5 @@ namespace Azure.AI.OpenAI.Chat /// Represents a data source configuration that will use an Azure Machine Learning vector index. public partial class AzureMachineLearningIndexChatDataSource : AzureChatDataSource { - /// Initializes a new instance of . - /// The parameter information to control the use of the Azure Machine Learning Index data source. - /// is null. - internal AzureMachineLearningIndexChatDataSource(InternalAzureMachineLearningIndexChatDataSourceParameters internalParameters) - { - Argument.AssertNotNull(internalParameters, nameof(internalParameters)); - - Type = "azure_ml_index"; - InternalParameters = internalParameters; - } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs index 146842187d90..d4bda9baa41c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.Serialization.cs @@ -21,35 +21,39 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); - if (Optional.IsDefined(Code)) + if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); writer.WriteStringValue(Code); } - if (Optional.IsDefined(Message)) + if (SerializedAdditionalRawData?.ContainsKey("message") != true && Optional.IsDefined(Message)) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - if (Optional.IsDefined(Param)) + if (SerializedAdditionalRawData?.ContainsKey("param") != true && Optional.IsDefined(Param)) { writer.WritePropertyName("param"u8); writer.WriteStringValue(Param); } - if (Optional.IsDefined(Type)) + if (SerializedAdditionalRawData?.ContainsKey("type") != true && Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); } - if (Optional.IsDefined(InnerError)) + if (SerializedAdditionalRawData?.ContainsKey("inner_error") != true && Optional.IsDefined(InnerError)) { writer.WritePropertyName("inner_error"u8); writer.WriteObjectValue(InnerError, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -124,6 +128,7 @@ internal static AzureOpenAIChatError DeserializeAzureOpenAIChatError(JsonElement } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs index 20fc58b7ddec..b379c88ac0a8 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatError.cs @@ -40,8 +40,7 @@ internal partial class AzureOpenAIChatError /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal AzureOpenAIChatError() { @@ -61,7 +60,7 @@ internal AzureOpenAIChatError(string code, string message, string param, string Param = param; Type = type; InnerError = innerError; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The distinct, machine-generated identifier for the error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs index 85c9681a3002..a85c386fd313 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.Serialization.cs @@ -21,15 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - if (Optional.IsDefined(Error)) + if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -80,6 +84,7 @@ internal static AzureOpenAIChatErrorResponse DeserializeAzureOpenAIChatErrorResp } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs index 457205815be0..767fce2b029e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIChatErrorResponse.cs @@ -40,8 +40,7 @@ internal partial class AzureOpenAIChatErrorResponse /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal AzureOpenAIChatErrorResponse() { @@ -53,7 +52,7 @@ internal AzureOpenAIChatErrorResponse() internal AzureOpenAIChatErrorResponse(AzureOpenAIChatError error, IDictionary serializedAdditionalRawData) { Error = error; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Gets the error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs index 0ed549d7e4ff..2498a9dac44b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.Serialization.cs @@ -21,35 +21,39 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW } writer.WriteStartObject(); - if (Optional.IsDefined(Code)) + if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); writer.WriteStringValue(Code); } - if (Optional.IsDefined(Message)) + if (SerializedAdditionalRawData?.ContainsKey("message") != true && Optional.IsDefined(Message)) { writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); } - if (Optional.IsDefined(Param)) + if (SerializedAdditionalRawData?.ContainsKey("param") != true && Optional.IsDefined(Param)) { writer.WritePropertyName("param"u8); writer.WriteStringValue(Param); } - if (Optional.IsDefined(Type)) + if (SerializedAdditionalRawData?.ContainsKey("type") != true && Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); writer.WriteStringValue(Type); } - if (Optional.IsDefined(InnerError)) + if (SerializedAdditionalRawData?.ContainsKey("inner_error") != true && Optional.IsDefined(InnerError)) { writer.WritePropertyName("inner_error"u8); writer.WriteObjectValue(InnerError, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -124,6 +128,7 @@ internal static AzureOpenAIDalleError DeserializeAzureOpenAIDalleError(JsonEleme } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs index bccad3ff8b04..7dfb2de16f66 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleError.cs @@ -40,8 +40,7 @@ internal partial class AzureOpenAIDalleError /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal AzureOpenAIDalleError() { @@ -61,7 +60,7 @@ internal AzureOpenAIDalleError(string code, string message, string param, string Param = param; Type = type; InnerError = innerError; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The distinct, machine-generated identifier for the error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs index dcee0fd4ed11..cdcc8bc203a6 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.Serialization.cs @@ -21,15 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteStartObject(); - if (Optional.IsDefined(Error)) + if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -80,6 +84,7 @@ internal static AzureOpenAIDalleErrorResponse DeserializeAzureOpenAIDalleErrorRe } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs index ba6845a4e9c5..6aafb0c3d308 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureOpenAIDalleErrorResponse.cs @@ -40,8 +40,7 @@ internal partial class AzureOpenAIDalleErrorResponse /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal AzureOpenAIDalleErrorResponse() { @@ -53,7 +52,7 @@ internal AzureOpenAIDalleErrorResponse() internal AzureOpenAIDalleErrorResponse(AzureOpenAIDalleError error, IDictionary serializedAdditionalRawData) { Error = error; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Gets the error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs index 4bfba4dccd2a..a9deddec3d6a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } writer.WriteStartObject(); - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(InternalParameters, options); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static AzureSearchChatDataSource DeserializeAzureSearchChatDataSource(J } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs index 9517e98a8440..9c4af92dbc55 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/AzureSearchChatDataSource.cs @@ -10,15 +10,5 @@ namespace Azure.AI.OpenAI.Chat /// Represents a data source configuration that will use an Azure Search resource. public partial class AzureSearchChatDataSource : AzureChatDataSource { - /// Initializes a new instance of . - /// The parameter information to control the use of the Azure Search data source. - /// is null. - internal AzureSearchChatDataSource(InternalAzureSearchChatDataSourceParameters internalParameters) - { - Argument.AssertNotNull(internalParameters, nameof(internalParameters)); - - Type = "azure_search"; - InternalParameters = internalParameters; - } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs index d05b34073d88..a2f4dd0e63c4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.Serialization.cs @@ -21,9 +21,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - if (Optional.IsCollectionDefined(InternalDetails)) + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + { + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData?.ContainsKey("details") != true && Optional.IsCollectionDefined(InternalDetails)) { writer.WritePropertyName("details"u8); writer.WriteStartArray(); @@ -33,10 +36,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -98,6 +105,7 @@ internal static ContentFilterBlocklistResult DeserializeContentFilterBlocklistRe } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs index 1ee18a931da8..d033e0e34b57 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterBlocklistResult.cs @@ -40,8 +40,7 @@ public partial class ContentFilterBlocklistResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// A value indicating whether any of the detailed blocklists resulted in a filtering action. internal ContentFilterBlocklistResult(bool filtered) @@ -58,7 +57,7 @@ internal ContentFilterBlocklistResult(bool filtered, IReadOnlyList Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs index bcfb766a3037..9c520fede22f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - writer.WritePropertyName("detected"u8); - writer.WriteBooleanValue(Detected); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData?.ContainsKey("detected") != true) + { + writer.WritePropertyName("detected"u8); + writer.WriteBooleanValue(Detected); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static ContentFilterDetectionResult DeserializeContentFilterDetectionRe } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs index 4656d749734c..34aab24008fd 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterDetectionResult.cs @@ -43,8 +43,7 @@ public partial class ContentFilterDetectionResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// Whether the content detection resulted in a content filtering action. /// Whether the labeled content category was detected in the content. @@ -62,7 +61,7 @@ internal ContentFilterDetectionResult(bool filtered, bool detected, IDictionary< { Filtered = filtered; Detected = detected; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.Serialization.cs index b96c25cf33a4..2e46d199231d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.Serialization.cs @@ -21,20 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteStartObject(); - if (Optional.IsDefined(License)) + if (SerializedAdditionalRawData?.ContainsKey("license") != true && Optional.IsDefined(License)) { writer.WritePropertyName("license"u8); writer.WriteStringValue(License); } - if (Optional.IsDefined(URL)) + if (SerializedAdditionalRawData?.ContainsKey("URL") != true && Optional.IsDefined(URL)) { writer.WritePropertyName("URL"u8); writer.WriteStringValue(URL.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -91,6 +95,7 @@ internal static ContentFilterProtectedMaterialCitedResult DeserializeContentFilt } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.cs index 4cdc76468962..0d83915066cf 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialCitedResult.cs @@ -40,8 +40,7 @@ public partial class ContentFilterProtectedMaterialCitedResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal ContentFilterProtectedMaterialCitedResult() { @@ -55,7 +54,7 @@ internal ContentFilterProtectedMaterialCitedResult(string license, Uri url, IDic { License = license; URL = url; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The name or identifier of the license associated with the detection. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs index e03c9d980188..1cf232dd83f8 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.Serialization.cs @@ -21,19 +21,29 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteStartObject(); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - writer.WritePropertyName("detected"u8); - writer.WriteBooleanValue(Detected); - if (Optional.IsDefined(Citation)) + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + { + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData?.ContainsKey("detected") != true) + { + writer.WritePropertyName("detected"u8); + writer.WriteBooleanValue(Detected); + } + if (SerializedAdditionalRawData?.ContainsKey("citation") != true && Optional.IsDefined(Citation)) { writer.WritePropertyName("citation"u8); writer.WriteObjectValue(Citation, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -96,6 +106,7 @@ internal static ContentFilterProtectedMaterialResult DeserializeContentFilterPro } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs index ffa1be9b5f6c..83551b0f313b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterProtectedMaterialResult.cs @@ -40,8 +40,7 @@ public partial class ContentFilterProtectedMaterialResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// Whether the content detection resulted in a content filtering action. /// Whether the labeled content category was detected in the content. @@ -61,7 +60,7 @@ internal ContentFilterProtectedMaterialResult(bool filtered, bool detected, Cont Filtered = filtered; Detected = detected; Citation = citation; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.Serialization.cs index 5f5daf4d721c..552f85dfa977 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.Serialization.cs @@ -20,20 +20,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model } writer.WriteStartObject(); - if (Optional.IsDefined(PromptIndex)) + if (SerializedAdditionalRawData?.ContainsKey("prompt_index") != true && Optional.IsDefined(PromptIndex)) { writer.WritePropertyName("prompt_index"u8); writer.WriteNumberValue(PromptIndex.Value); } - if (Optional.IsDefined(InternalResults)) + if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(InternalResults)) { writer.WritePropertyName("content_filter_results"u8); writer.WriteObjectValue(InternalResults, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.cs index 4be46282bb2d..46aa27b09f48 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForPrompt.cs @@ -40,8 +40,7 @@ public partial class ContentFilterResultForPrompt /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal ContentFilterResultForPrompt() { @@ -55,7 +54,7 @@ internal ContentFilterResultForPrompt(int? promptIndex, InternalAzureContentFilt { PromptIndex = promptIndex; InternalResults = internalResults; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.Serialization.cs index c698418fd18b..5b2644c9cdc5 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.Serialization.cs @@ -21,55 +21,59 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod } writer.WriteStartObject(); - if (Optional.IsDefined(Sexual)) + if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (Optional.IsDefined(Hate)) + if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (Optional.IsDefined(Violence)) + if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (Optional.IsDefined(SelfHarm)) + if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (Optional.IsDefined(Profanity)) + if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (Optional.IsDefined(CustomBlocklists)) + if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - if (Optional.IsDefined(Error)) + if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - if (Optional.IsDefined(ProtectedMaterialText)) + if (SerializedAdditionalRawData?.ContainsKey("protected_material_text") != true && Optional.IsDefined(ProtectedMaterialText)) { writer.WritePropertyName("protected_material_text"u8); writer.WriteObjectValue(ProtectedMaterialText, options); } - if (Optional.IsDefined(ProtectedMaterialCode)) + if (SerializedAdditionalRawData?.ContainsKey("protected_material_code") != true && Optional.IsDefined(ProtectedMaterialCode)) { writer.WritePropertyName("protected_material_code"u8); writer.WriteObjectValue(ProtectedMaterialCode, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -200,6 +204,7 @@ internal static ContentFilterResultForResponse DeserializeContentFilterResultFor } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.cs index 9f246a878c7b..5228ea56a732 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterResultForResponse.cs @@ -40,8 +40,7 @@ public partial class ContentFilterResultForResponse /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal ContentFilterResultForResponse() { @@ -88,7 +87,7 @@ internal ContentFilterResultForResponse(ContentFilterSeverityResult sexual, Cont Error = error; ProtectedMaterialText = protectedMaterialText; ProtectedMaterialCode = protectedMaterialCode; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs index 0797d4e21313..91a9f01a8528 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverity.cs @@ -7,7 +7,7 @@ namespace Azure.AI.OpenAI { - /// Enum for severity in ContentFilterSeverityResult. + /// The AzureContentFilterSeverityResultSeverity. public readonly partial struct ContentFilterSeverity : IEquatable { private readonly string _value; @@ -47,7 +47,7 @@ public ContentFilterSeverity(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs index 3152960f6c77..6f7da3ac8cab 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } writer.WriteStartObject(); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData?.ContainsKey("severity") != true) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity.ToString()); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static ContentFilterSeverityResult DeserializeContentFilterSeverityResu } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs index 4e8f4c5bf4a7..95f0fa1bca5a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ContentFilterSeverityResult.cs @@ -43,8 +43,7 @@ public partial class ContentFilterSeverityResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// Whether the content severity resulted in a content filtering action. /// The labeled severity of the content. @@ -62,7 +61,7 @@ internal ContentFilterSeverityResult(bool filtered, ContentFilterSeverity severi { Filtered = filtered; Severity = severity; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs index 8fae7998c28a..88ed804d9478 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs index 8ddcc9194e1b..60914d91a96c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceAuthentication.cs @@ -43,23 +43,22 @@ public abstract partial class DataSourceAuthentication /// /// /// - private protected IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . protected DataSourceAuthentication() { } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. internal DataSourceAuthentication(string type, IDictionary serializedAdditionalRawData) { Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the type. + /// Discriminator. internal string Type { get; set; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs index dcb933edfa5a..7afbad202de1 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.Serialization.cs @@ -21,22 +21,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteStartObject(); - if (Optional.IsDefined(TitleFieldName)) + if (SerializedAdditionalRawData?.ContainsKey("title_field") != true && Optional.IsDefined(TitleFieldName)) { writer.WritePropertyName("title_field"u8); writer.WriteStringValue(TitleFieldName); } - if (Optional.IsDefined(UrlFieldName)) + if (SerializedAdditionalRawData?.ContainsKey("url_field") != true && Optional.IsDefined(UrlFieldName)) { writer.WritePropertyName("url_field"u8); writer.WriteStringValue(UrlFieldName); } - if (Optional.IsDefined(FilepathFieldName)) + if (SerializedAdditionalRawData?.ContainsKey("filepath_field") != true && Optional.IsDefined(FilepathFieldName)) { writer.WritePropertyName("filepath_field"u8); writer.WriteStringValue(FilepathFieldName); } - if (Optional.IsCollectionDefined(ContentFieldNames)) + if (SerializedAdditionalRawData?.ContainsKey("content_fields") != true && Optional.IsCollectionDefined(ContentFieldNames)) { writer.WritePropertyName("content_fields"u8); writer.WriteStartArray(); @@ -46,12 +46,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (Optional.IsDefined(ContentFieldSeparator)) + if (SerializedAdditionalRawData?.ContainsKey("content_fields_separator") != true && Optional.IsDefined(ContentFieldSeparator)) { writer.WritePropertyName("content_fields_separator"u8); writer.WriteStringValue(ContentFieldSeparator); } - if (Optional.IsCollectionDefined(VectorFieldNames)) + if (SerializedAdditionalRawData?.ContainsKey("vector_fields") != true && Optional.IsCollectionDefined(VectorFieldNames)) { writer.WritePropertyName("vector_fields"u8); writer.WriteStartArray(); @@ -61,7 +61,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(ImageVectorFieldNames)) + if (SerializedAdditionalRawData?.ContainsKey("image_vector_fields") != true && Optional.IsCollectionDefined(ImageVectorFieldNames)) { writer.WritePropertyName("image_vector_fields"u8); writer.WriteStartArray(); @@ -71,10 +71,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -184,6 +188,7 @@ internal static DataSourceFieldMappings DeserializeDataSourceFieldMappings(JsonE } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs index c7e23aa399ae..9933608ce0f9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceFieldMappings.cs @@ -40,7 +40,7 @@ public partial class DataSourceFieldMappings /// /// /// - private IDictionary _serializedAdditionalRawData; + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The name of the index field to use as a title. @@ -60,7 +60,7 @@ internal DataSourceFieldMappings(string titleFieldName, string urlFieldName, str ContentFieldSeparator = contentFieldSeparator; VectorFieldNames = vectorFieldNames; ImageVectorFieldNames = imageVectorFieldNames; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs index 49396fc27ed4..1f05c54d6d19 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceQueryType.cs @@ -7,7 +7,7 @@ namespace Azure.AI.OpenAI.Chat { - /// Enum for query_type in InternalAzureSearchChatDataSourceParameters. + /// The AzureSearchChatDataSourceParametersQueryType. public readonly partial struct DataSourceQueryType : IEquatable { private readonly string _value; @@ -50,7 +50,7 @@ public DataSourceQueryType(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs index 5b5751331e99..15db67fa01e6 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs index 25816e4cbf7e..474c2459025b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/DataSourceVectorizer.cs @@ -43,8 +43,7 @@ public abstract partial class DataSourceVectorizer /// /// /// - private protected IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . protected DataSourceVectorizer() { @@ -56,7 +55,7 @@ protected DataSourceVectorizer() internal DataSourceVectorizer(string type, IDictionary serializedAdditionalRawData) { Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The differentiating identifier for the concrete vectorization source. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs index 0e9e4d77eb6c..5265a931500b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR } writer.WriteStartObject(); - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(InternalParameters, options); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static ElasticsearchChatDataSource DeserializeElasticsearchChatDataSour } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs index 4150f7fd0bfa..db281d1d672e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ElasticsearchChatDataSource.cs @@ -10,15 +10,5 @@ namespace Azure.AI.OpenAI.Chat /// The ElasticsearchChatDataSource. public partial class ElasticsearchChatDataSource : AzureChatDataSource { - /// Initializes a new instance of . - /// The parameter information to control the use of the Elasticsearch data source. - /// is null. - internal ElasticsearchChatDataSource(InternalElasticsearchChatDataSourceParameters internalParameters) - { - Argument.AssertNotNull(internalParameters, nameof(internalParameters)); - - Type = "elasticsearch"; - InternalParameters = internalParameters; - } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForPrompt.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForPrompt.Serialization.cs index 519faf63fb41..1ecef8716b97 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForPrompt.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForPrompt.Serialization.cs @@ -21,42 +21,49 @@ void IJsonModel.Write(Utf8JsonWriter writer, } writer.WriteStartObject(); - if (Optional.IsDefined(Profanity)) + if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (Optional.IsDefined(CustomBlocklists)) + if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - writer.WritePropertyName("jailbreak"u8); - writer.WriteObjectValue(Jailbreak, options); - if (Optional.IsDefined(Sexual)) + if (SerializedAdditionalRawData?.ContainsKey("jailbreak") != true) + { + writer.WritePropertyName("jailbreak"u8); + writer.WriteObjectValue(Jailbreak, options); + } + if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (Optional.IsDefined(Violence)) + if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (Optional.IsDefined(Hate)) + if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (Optional.IsDefined(SelfHarm)) + if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -163,6 +170,7 @@ internal static ImageContentFilterResultForPrompt DeserializeImageContentFilterR } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.Serialization.cs index 1bd39f772c61..d666cf634494 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.Serialization.cs @@ -21,30 +21,34 @@ void IJsonModel.Write(Utf8JsonWriter writer } writer.WriteStartObject(); - if (Optional.IsDefined(Sexual)) + if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (Optional.IsDefined(Violence)) + if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (Optional.IsDefined(Hate)) + if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (Optional.IsDefined(SelfHarm)) + if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -125,6 +129,7 @@ internal static ImageContentFilterResultForResponse DeserializeImageContentFilte } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.cs index 360a6ed42196..ed4b17e85436 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/ImageContentFilterResultForResponse.cs @@ -40,8 +40,7 @@ public partial class ImageContentFilterResultForResponse /// /// /// - private protected IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal ImageContentFilterResultForResponse() { @@ -75,7 +74,7 @@ internal ImageContentFilterResultForResponse(ContentFilterSeverityResult sexual, Violence = violence; Hate = hate; SelfHarm = selfHarm; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs index 72d5f73e9f0a..e6f35c517904 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/BinaryContentHelper.cs @@ -52,6 +52,20 @@ public static BinaryContent FromEnumerable(IEnumerable enumerable) return content; } + public static BinaryContent FromEnumerable(ReadOnlySpan span) + where T : notnull + { + Utf8JsonBinaryContent content = new Utf8JsonBinaryContent(); + content.JsonWriter.WriteStartArray(); + for (int i = 0; i < span.Length; i++) + { + content.JsonWriter.WriteObjectValue(span[i], ModelSerializationExtensions.WireOptions); + } + content.JsonWriter.WriteEndArray(); + + return content; + } + public static BinaryContent FromDictionary(IDictionary dictionary) where TValue : notnull { diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs index 41970547ca19..aa2ae4da331e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ClientUriBuilder.cs @@ -105,11 +105,7 @@ public void AppendQuery(string name, string value, bool escape) Argument.AssertNotNullOrWhiteSpace(name, nameof(name)); Argument.AssertNotNullOrWhiteSpace(value, nameof(value)); - if (QueryBuilder.Length == 0) - { - QueryBuilder.Append('?'); - } - else + if (QueryBuilder.Length > 0) { QueryBuilder.Append('&'); } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs index 66ba2975f7ca..f4286bb0eeca 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/Internal/ModelSerializationExtensions.cs @@ -15,6 +15,7 @@ namespace Azure.AI.OpenAI internal static class ModelSerializationExtensions { internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + internal static readonly BinaryData SentinelValue = BinaryData.FromObjectAsJson("__EMPTY__"); public static object GetObject(this JsonElement element) { @@ -249,6 +250,13 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, object value, Mo writer.WriteObjectValue(value, options); } + internal static bool IsSentinelValue(BinaryData value) + { + ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; + ReadOnlySpan valueSpan = value.ToMemory().Span; + return sentinelSpan.SequenceEqual(valueSpan); + } + internal static class TypeFormatters { private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs index 202b6d75f161..344aed0274a7 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Wri } writer.WriteStartObject(); - writer.WritePropertyName("access_token"u8); - writer.WriteStringValue(AccessToken); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("access_token") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("access_token"u8); + writer.WriteStringValue(AccessToken); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureChatDataSourceAccessTokenAuthenticationOptions Dese } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs index 100d59d944eb..2fbc3dc9f61e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceAccessTokenAuthenticationOptions.cs @@ -22,7 +22,7 @@ internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string acce } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// internal InternalAzureChatDataSourceAccessTokenAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string accessToken) : base(type, serializedAdditionalRawData) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs index a2f4a0765859..4d448e27cf9e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Ut } writer.WriteStartObject(); - writer.WritePropertyName("key"u8); - writer.WriteStringValue(Key); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("key") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureChatDataSourceApiKeyAuthenticationOptions Deseriali } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs index 1fc56bc391da..91325ee4cdf3 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceApiKeyAuthenticationOptions.cs @@ -22,7 +22,7 @@ internal InternalAzureChatDataSourceApiKeyAuthenticationOptions(string key) } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// internal InternalAzureChatDataSourceApiKeyAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string key) : base(type, serializedAdditionalRawData) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs index d19ee5f890d3..87563d7c14b9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs index c3009f3da071..aec71571077f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceConnectionStringAuthenticationOptions.cs @@ -22,7 +22,7 @@ internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// internal InternalAzureChatDataSourceConnectionStringAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string connectionString) : base(type, serializedAdditionalRawData) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs index 85066d58f311..a322da00a07b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceDeploymentNameVectorizationSource.Serialization.cs @@ -21,19 +21,29 @@ void IJsonModel.Wr } writer.WriteStartObject(); - writer.WritePropertyName("deployment_name"u8); - writer.WriteStringValue(DeploymentName); - if (Optional.IsDefined(Dimensions)) + if (SerializedAdditionalRawData?.ContainsKey("deployment_name") != true) + { + writer.WritePropertyName("deployment_name"u8); + writer.WriteStringValue(DeploymentName); + } + if (SerializedAdditionalRawData?.ContainsKey("dimensions") != true && Optional.IsDefined(Dimensions)) { writer.WritePropertyName("dimensions"u8); writer.WriteNumberValue(Dimensions.Value); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -96,6 +106,7 @@ internal static InternalAzureChatDataSourceDeploymentNameVectorizationSource Des } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs index 15e017f3abbc..b24dfb4f4137 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.W } writer.WriteStartObject(); - writer.WritePropertyName("encoded_api_key"u8); - writer.WriteStringValue(EncodedApiKey); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("encoded_api_key") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("encoded_api_key"u8); + writer.WriteStringValue(EncodedApiKey); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions De } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs index 30ce92e8bad4..bb4089d7c2a9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions.cs @@ -22,7 +22,7 @@ internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string en } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// internal InternalAzureChatDataSourceEncodedApiKeyAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string encodedApiKey) : base(type, serializedAdditionalRawData) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs index 595c4a1beb62..e984e66bca8a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceEndpointVectorizationSource.Serialization.cs @@ -21,21 +21,34 @@ void IJsonModel.Write(Ut } writer.WriteStartObject(); - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint.AbsoluteUri); - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - if (Optional.IsDefined(Dimensions)) + if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.AbsoluteUri); + } + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("dimensions") != true && Optional.IsDefined(Dimensions)) { writer.WritePropertyName("dimensions"u8); writer.WriteNumberValue(Dimensions.Value); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -104,6 +117,7 @@ internal static InternalAzureChatDataSourceEndpointVectorizationSource Deseriali } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs index f40e3c402006..3d1b11f308cc 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.Serialization.cs @@ -21,16 +21,29 @@ void IJsonModel.Wri } writer.WriteStartObject(); - writer.WritePropertyName("key"u8); - writer.WriteStringValue(Key); - writer.WritePropertyName("key_id"u8); - writer.WriteStringValue(KeyId); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("key") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } + if (SerializedAdditionalRawData?.ContainsKey("key_id") != true) + { + writer.WritePropertyName("key_id"u8); + writer.WriteStringValue(KeyId); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -89,6 +102,7 @@ internal static InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions Dese } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs index b9926635e9ac..9f6c3b347222 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions.cs @@ -25,7 +25,7 @@ internal InternalAzureChatDataSourceKeyAndKeyIdAuthenticationOptions(string key, } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// /// diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs index eb3ffa5240e8..cbbae8276b91 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceModelIdVectorizationSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf } writer.WriteStartObject(); - writer.WritePropertyName("model_id"u8); - writer.WriteStringValue(ModelId); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("model_id") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("model_id"u8); + writer.WriteStringValue(ModelId); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureChatDataSourceModelIdVectorizationSource Deserializ } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs index 22482d4bbae1..3d97453fcfd2 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs index 82e24f04136e..c08da9869e9e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions.cs @@ -17,7 +17,7 @@ internal InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationO } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. internal InternalAzureChatDataSourceSystemAssignedManagedIdentityAuthenticationOptions(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs index 79dfbf9ac919..92a62ed8c6bb 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs index 7520c37cb353..20e6e6b2f8a0 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions.cs @@ -22,7 +22,7 @@ internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOpt } /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. /// internal InternalAzureChatDataSourceUserAssignedManagedIdentityAuthenticationOptions(string type, IDictionary serializedAdditionalRawData, string managedIdentityResourceId) : base(type, serializedAdditionalRawData) diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs index d98b952ed21f..e00fc19ccf89 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWrite } writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("id") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) + { + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureContentFilterBlocklistIdResult DeserializeInternalA } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs index be97bb59ac44..1950182689c4 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistIdResult.cs @@ -43,8 +43,7 @@ internal partial class InternalAzureContentFilterBlocklistIdResult /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The ID of the custom blocklist associated with the filtered status. /// Whether the associated blocklist resulted in the content being filtered. @@ -65,7 +64,7 @@ internal InternalAzureContentFilterBlocklistIdResult(string id, bool filtered, I { Id = id; Filtered = filtered; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs index b672c2bd27ef..02ac4d99cbe9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonW } writer.WriteStartObject(); - writer.WritePropertyName("filtered"u8); - writer.WriteBooleanValue(Filtered); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("filtered") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("filtered"u8); + writer.WriteBooleanValue(Filtered); + } + if (SerializedAdditionalRawData?.ContainsKey("id") != true) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static InternalAzureContentFilterBlocklistResultDetail DeserializeInter } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs index 10ca11758586..d0726035c32b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterBlocklistResultDetail.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureContentFilterBlocklistResultDetail /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// A value indicating whether the blocklist produced a filtering action. /// The ID of the custom blocklist evaluated. @@ -62,7 +61,7 @@ internal InternalAzureContentFilterBlocklistResultDetail(bool filtered, string i { Filtered = filtered; Id = id; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs index 0891a044249e..c2378dd52216 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.Serialization.cs @@ -21,49 +21,59 @@ void IJsonModel.W } writer.WriteStartObject(); - if (Optional.IsDefined(Sexual)) + if (SerializedAdditionalRawData?.ContainsKey("sexual") != true && Optional.IsDefined(Sexual)) { writer.WritePropertyName("sexual"u8); writer.WriteObjectValue(Sexual, options); } - if (Optional.IsDefined(Hate)) + if (SerializedAdditionalRawData?.ContainsKey("hate") != true && Optional.IsDefined(Hate)) { writer.WritePropertyName("hate"u8); writer.WriteObjectValue(Hate, options); } - if (Optional.IsDefined(Violence)) + if (SerializedAdditionalRawData?.ContainsKey("violence") != true && Optional.IsDefined(Violence)) { writer.WritePropertyName("violence"u8); writer.WriteObjectValue(Violence, options); } - if (Optional.IsDefined(SelfHarm)) + if (SerializedAdditionalRawData?.ContainsKey("self_harm") != true && Optional.IsDefined(SelfHarm)) { writer.WritePropertyName("self_harm"u8); writer.WriteObjectValue(SelfHarm, options); } - if (Optional.IsDefined(Profanity)) + if (SerializedAdditionalRawData?.ContainsKey("profanity") != true && Optional.IsDefined(Profanity)) { writer.WritePropertyName("profanity"u8); writer.WriteObjectValue(Profanity, options); } - if (Optional.IsDefined(CustomBlocklists)) + if (SerializedAdditionalRawData?.ContainsKey("custom_blocklists") != true && Optional.IsDefined(CustomBlocklists)) { writer.WritePropertyName("custom_blocklists"u8); writer.WriteObjectValue(CustomBlocklists, options); } - if (Optional.IsDefined(Error)) + if (SerializedAdditionalRawData?.ContainsKey("error") != true && Optional.IsDefined(Error)) { writer.WritePropertyName("error"u8); writer.WriteObjectValue(Error, options); } - writer.WritePropertyName("jailbreak"u8); - writer.WriteObjectValue(Jailbreak, options); - writer.WritePropertyName("indirect_attack"u8); - writer.WriteObjectValue(IndirectAttack, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("jailbreak") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("jailbreak"u8); + writer.WriteObjectValue(Jailbreak, options); + } + if (SerializedAdditionalRawData?.ContainsKey("indirect_attack") != true) + { + writer.WritePropertyName("indirect_attack"u8); + writer.WriteObjectValue(IndirectAttack, options); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -186,6 +196,7 @@ internal static InternalAzureContentFilterResultForPromptContentFilterResults De } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs index fb94ccc03cc4..8c654f48774d 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResults.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureContentFilterResultForPromptContentFilterRes /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// /// A detection result that describes user prompt injection attacks, where malicious users deliberately exploit @@ -112,7 +111,7 @@ internal InternalAzureContentFilterResultForPromptContentFilterResults(ContentFi Error = error; Jailbreak = jailbreak; IndirectAttack = indirectAttack; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs index 2aca05ca5f63..24d22365ed03 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs index e312f3168197..af8b8a13fe2a 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureContentFilterResultForPromptContentFilterResultsError.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureContentFilterResultForPromptContentFilterRes /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// A distinct, machine-readable code associated with the error. /// A human-readable message associated with the error. @@ -62,7 +61,7 @@ internal InternalAzureContentFilterResultForPromptContentFilterResultsError(int { Code = code; Message = message; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs index 535e005b65ef..105a22779e07 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.Serialization.cs @@ -21,37 +21,37 @@ void IJsonModel.Write(Utf8JsonWri } writer.WriteStartObject(); - if (Optional.IsDefined(TopNDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (Optional.IsDefined(InScope)) + if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (Optional.IsDefined(Strictness)) + if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (Optional.IsDefined(RoleInformation)) + if (SerializedAdditionalRawData?.ContainsKey("role_information") != true && Optional.IsDefined(RoleInformation)) { writer.WritePropertyName("role_information"u8); writer.WriteStringValue(RoleInformation); } - if (Optional.IsDefined(MaxSearchQueries)) + if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (Optional.IsDefined(AllowPartialResult)) + if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (Optional.IsCollectionDefined(_internalIncludeContexts)) + if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); @@ -61,22 +61,44 @@ void IJsonModel.Write(Utf8JsonWri } writer.WriteEndArray(); } - writer.WritePropertyName("container_name"u8); - writer.WriteStringValue(ContainerName); - writer.WritePropertyName("database_name"u8); - writer.WriteStringValue(DatabaseName); - writer.WritePropertyName("embedding_dependency"u8); - writer.WriteObjectValue(VectorizationSource, options); - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("container_name") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("container_name"u8); + writer.WriteStringValue(ContainerName); + } + if (SerializedAdditionalRawData?.ContainsKey("database_name") != true) + { + writer.WritePropertyName("database_name"u8); + writer.WriteStringValue(DatabaseName); + } + if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true) + { + writer.WritePropertyName("embedding_dependency"u8); + writer.WriteObjectValue(VectorizationSource, options); + } + if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + { + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + } + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true) + { + writer.WritePropertyName("fields_mapping"u8); + writer.WriteObjectValue(FieldMappings, options); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -224,6 +246,7 @@ internal static InternalAzureCosmosDBChatDataSourceParameters DeserializeInterna } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs index fbd5a1f6d360..69fcfdfdfb51 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureCosmosDBChatDataSourceParameters.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureCosmosDBChatDataSourceParameters /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// /// @@ -122,7 +121,7 @@ internal InternalAzureCosmosDBChatDataSourceParameters(int? topNDocuments, bool? IndexName = indexName; Authentication = authentication; FieldMappings = fieldMappings; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.Serialization.cs index 18883335cf1f..d5071162c444 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.Serialization.cs @@ -21,37 +21,37 @@ void IJsonModel.Write } writer.WriteStartObject(); - if (Optional.IsDefined(TopNDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (Optional.IsDefined(InScope)) + if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (Optional.IsDefined(Strictness)) + if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (Optional.IsDefined(RoleInformation)) + if (SerializedAdditionalRawData?.ContainsKey("role_information") != true && Optional.IsDefined(RoleInformation)) { writer.WritePropertyName("role_information"u8); writer.WriteStringValue(RoleInformation); } - if (Optional.IsDefined(MaxSearchQueries)) + if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (Optional.IsDefined(AllowPartialResult)) + if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (Optional.IsCollectionDefined(_internalIncludeContexts)) + if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); @@ -61,23 +61,39 @@ void IJsonModel.Write } writer.WriteEndArray(); } - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - writer.WritePropertyName("project_resource_id"u8); - writer.WriteStringValue(ProjectResourceId); - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - writer.WritePropertyName("version"u8); - writer.WriteStringValue(Version); - if (Optional.IsDefined(Filter)) + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("project_resource_id") != true) + { + writer.WritePropertyName("project_resource_id"u8); + writer.WriteStringValue(ProjectResourceId); + } + if (SerializedAdditionalRawData?.ContainsKey("name") != true) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (SerializedAdditionalRawData?.ContainsKey("version") != true) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (SerializedAdditionalRawData?.ContainsKey("filter") != true && Optional.IsDefined(Filter)) { writer.WritePropertyName("filter"u8); writer.WriteStringValue(Filter); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -219,6 +235,7 @@ internal static InternalAzureMachineLearningIndexChatDataSourceParameters Deseri } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.cs index bdcbd127b7fd..571ad60a248b 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureMachineLearningIndexChatDataSourceParameters.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureMachineLearningIndexChatDataSourceParameters /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.. @@ -110,7 +109,7 @@ internal InternalAzureMachineLearningIndexChatDataSourceParameters(int? topNDocu Name = name; Version = version; Filter = filter; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs index 30b60e277e21..694933771074 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.Serialization.cs @@ -21,25 +21,29 @@ void IJsonModel.Write(Utf8JsonWriter wri } writer.WriteStartObject(); - if (Optional.IsDefined(Code)) + if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); + writer.WriteStringValue(Code.Value.ToString()); } - if (Optional.IsDefined(RevisedPrompt)) + if (SerializedAdditionalRawData?.ContainsKey("revised_prompt") != true && Optional.IsDefined(RevisedPrompt)) { writer.WritePropertyName("revised_prompt"u8); writer.WriteStringValue(RevisedPrompt); } - if (Optional.IsDefined(ContentFilterResults)) + if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(ContentFilterResults)) { writer.WritePropertyName("content_filter_results"u8); writer.WriteObjectValue(ContentFilterResults, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -74,7 +78,7 @@ internal static InternalAzureOpenAIChatErrorInnerError DeserializeInternalAzureO { return null; } - string code = default; + InternalAzureOpenAIChatErrorInnerErrorCode? code = default; string revisedPrompt = default; ContentFilterResultForPrompt contentFilterResults = default; IDictionary serializedAdditionalRawData = default; @@ -83,7 +87,11 @@ internal static InternalAzureOpenAIChatErrorInnerError DeserializeInternalAzureO { if (property.NameEquals("code"u8)) { - code = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = new InternalAzureOpenAIChatErrorInnerErrorCode(property.Value.GetString()); continue; } if (property.NameEquals("revised_prompt"u8)) @@ -102,6 +110,7 @@ internal static InternalAzureOpenAIChatErrorInnerError DeserializeInternalAzureO } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs index 2f277d3512aa..0912cd016492 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerError.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureOpenAIChatErrorInnerError /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal InternalAzureOpenAIChatErrorInnerError() { @@ -52,16 +51,16 @@ internal InternalAzureOpenAIChatErrorInnerError() /// If applicable, the modified prompt used for generation. /// The content filter result details associated with the inner error. /// Keeps track of any properties unknown to the library. - internal InternalAzureOpenAIChatErrorInnerError(string code, string revisedPrompt, ContentFilterResultForPrompt contentFilterResults, IDictionary serializedAdditionalRawData) + internal InternalAzureOpenAIChatErrorInnerError(InternalAzureOpenAIChatErrorInnerErrorCode? code, string revisedPrompt, ContentFilterResultForPrompt contentFilterResults, IDictionary serializedAdditionalRawData) { Code = code; RevisedPrompt = revisedPrompt; ContentFilterResults = contentFilterResults; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The code associated with the inner error. - internal string Code { get; set; } + internal InternalAzureOpenAIChatErrorInnerErrorCode? Code { get; set; } /// If applicable, the modified prompt used for generation. internal string RevisedPrompt { get; set; } /// The content filter result details associated with the inner error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs index 0935e739652a..1e1ab2f0c352 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIChatErrorInnerErrorCode.cs @@ -38,7 +38,7 @@ public InternalAzureOpenAIChatErrorInnerErrorCode(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs index c0bee377d52e..328bdf127b74 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.Serialization.cs @@ -21,25 +21,29 @@ void IJsonModel.Write(Utf8JsonWriter wr } writer.WriteStartObject(); - if (Optional.IsDefined(Code)) + if (SerializedAdditionalRawData?.ContainsKey("code") != true && Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); + writer.WriteStringValue(Code.Value.ToString()); } - if (Optional.IsDefined(RevisedPrompt)) + if (SerializedAdditionalRawData?.ContainsKey("revised_prompt") != true && Optional.IsDefined(RevisedPrompt)) { writer.WritePropertyName("revised_prompt"u8); writer.WriteStringValue(RevisedPrompt); } - if (Optional.IsDefined(ContentFilterResults)) + if (SerializedAdditionalRawData?.ContainsKey("content_filter_results") != true && Optional.IsDefined(ContentFilterResults)) { writer.WritePropertyName("content_filter_results"u8); writer.WriteObjectValue(ContentFilterResults, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -74,7 +78,7 @@ internal static InternalAzureOpenAIDalleErrorInnerError DeserializeInternalAzure { return null; } - string code = default; + InternalAzureOpenAIDalleErrorInnerErrorCode? code = default; string revisedPrompt = default; ImageContentFilterResultForPrompt contentFilterResults = default; IDictionary serializedAdditionalRawData = default; @@ -83,7 +87,11 @@ internal static InternalAzureOpenAIDalleErrorInnerError DeserializeInternalAzure { if (property.NameEquals("code"u8)) { - code = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = new InternalAzureOpenAIDalleErrorInnerErrorCode(property.Value.GetString()); continue; } if (property.NameEquals("revised_prompt"u8)) @@ -102,6 +110,7 @@ internal static InternalAzureOpenAIDalleErrorInnerError DeserializeInternalAzure } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs index 48c9b31127f5..d4b590f531cf 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerError.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureOpenAIDalleErrorInnerError /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . internal InternalAzureOpenAIDalleErrorInnerError() { @@ -52,16 +51,16 @@ internal InternalAzureOpenAIDalleErrorInnerError() /// If applicable, the modified prompt used for generation. /// The content filter result details associated with the inner error. /// Keeps track of any properties unknown to the library. - internal InternalAzureOpenAIDalleErrorInnerError(string code, string revisedPrompt, ImageContentFilterResultForPrompt contentFilterResults, IDictionary serializedAdditionalRawData) + internal InternalAzureOpenAIDalleErrorInnerError(InternalAzureOpenAIDalleErrorInnerErrorCode? code, string revisedPrompt, ImageContentFilterResultForPrompt contentFilterResults, IDictionary serializedAdditionalRawData) { Code = code; RevisedPrompt = revisedPrompt; ContentFilterResults = contentFilterResults; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// The code associated with the inner error. - internal string Code { get; set; } + internal InternalAzureOpenAIDalleErrorInnerErrorCode? Code { get; set; } /// If applicable, the modified prompt used for generation. internal string RevisedPrompt { get; set; } /// The content filter result details associated with the inner error. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs index 580f2ad8b488..35cf2d97866f 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureOpenAIDalleErrorInnerErrorCode.cs @@ -38,7 +38,7 @@ public InternalAzureOpenAIDalleErrorInnerErrorCode(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; /// public override string ToString() => _value; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs index f4632f8ef02b..d855a3a0c023 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.Serialization.cs @@ -21,37 +21,37 @@ void IJsonModel.Write(Utf8JsonWrite } writer.WriteStartObject(); - if (Optional.IsDefined(TopNDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (Optional.IsDefined(InScope)) + if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (Optional.IsDefined(Strictness)) + if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (Optional.IsDefined(RoleInformation)) + if (SerializedAdditionalRawData?.ContainsKey("role_information") != true && Optional.IsDefined(RoleInformation)) { writer.WritePropertyName("role_information"u8); writer.WriteStringValue(RoleInformation); } - if (Optional.IsDefined(MaxSearchQueries)) + if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (Optional.IsDefined(AllowPartialResult)) + if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (Optional.IsCollectionDefined(_internalIncludeContexts)) + if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); @@ -61,41 +61,54 @@ void IJsonModel.Write(Utf8JsonWrite } writer.WriteEndArray(); } - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint.AbsoluteUri); - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - if (Optional.IsDefined(FieldMappings)) + if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.AbsoluteUri); + } + if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + { + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + } + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true && Optional.IsDefined(FieldMappings)) { writer.WritePropertyName("fields_mapping"u8); writer.WriteObjectValue(FieldMappings, options); } - if (Optional.IsDefined(QueryType)) + if (SerializedAdditionalRawData?.ContainsKey("query_type") != true && Optional.IsDefined(QueryType)) { writer.WritePropertyName("query_type"u8); writer.WriteStringValue(QueryType.Value.ToString()); } - if (Optional.IsDefined(SemanticConfiguration)) + if (SerializedAdditionalRawData?.ContainsKey("semantic_configuration") != true && Optional.IsDefined(SemanticConfiguration)) { writer.WritePropertyName("semantic_configuration"u8); writer.WriteStringValue(SemanticConfiguration); } - if (Optional.IsDefined(Filter)) + if (SerializedAdditionalRawData?.ContainsKey("filter") != true && Optional.IsDefined(Filter)) { writer.WritePropertyName("filter"u8); writer.WriteStringValue(Filter); } - if (Optional.IsDefined(VectorizationSource)) + if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true && Optional.IsDefined(VectorizationSource)) { writer.WritePropertyName("embedding_dependency"u8); writer.WriteObjectValue(VectorizationSource, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -267,6 +280,7 @@ internal static InternalAzureSearchChatDataSourceParameters DeserializeInternalA } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs index 709ec0b3586b..470fb9c45c7e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParameters.cs @@ -40,8 +40,7 @@ internal partial class InternalAzureSearchChatDataSourceParameters /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The absolute endpoint path for the Azure Search resource to use. /// The name of the index to use, as specified in the Azure Search resource. @@ -119,7 +118,7 @@ internal InternalAzureSearchChatDataSourceParameters(int? topNDocuments, bool? i SemanticConfiguration = semanticConfiguration; Filter = filter; VectorizationSource = vectorizationSource; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs new file mode 100644 index 000000000000..90e6d867660d --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalAzureSearchChatDataSourceParametersIncludeContext.cs @@ -0,0 +1,52 @@ +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.AI.OpenAI.Chat +{ + /// The AzureSearchChatDataSourceParametersIncludeContext. + internal readonly partial struct InternalAzureSearchChatDataSourceParametersIncludeContext : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InternalAzureSearchChatDataSourceParametersIncludeContext(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CitationsValue = "citations"; + private const string IntentValue = "intent"; + private const string AllRetrievedDocumentsValue = "all_retrieved_documents"; + + /// citations. + internal static InternalAzureSearchChatDataSourceParametersIncludeContext Citations { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(CitationsValue); + /// intent. + internal static InternalAzureSearchChatDataSourceParametersIncludeContext Intent { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(IntentValue); + /// all_retrieved_documents. + internal static InternalAzureSearchChatDataSourceParametersIncludeContext AllRetrievedDocuments { get; set; } = new InternalAzureSearchChatDataSourceParametersIncludeContext(AllRetrievedDocumentsValue); + /// Determines if two values are the same. + public static bool operator ==(InternalAzureSearchChatDataSourceParametersIncludeContext left, InternalAzureSearchChatDataSourceParametersIncludeContext right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InternalAzureSearchChatDataSourceParametersIncludeContext left, InternalAzureSearchChatDataSourceParametersIncludeContext right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator InternalAzureSearchChatDataSourceParametersIncludeContext(string value) => new InternalAzureSearchChatDataSourceParametersIncludeContext(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InternalAzureSearchChatDataSourceParametersIncludeContext other && Equals(other); + /// + public bool Equals(InternalAzureSearchChatDataSourceParametersIncludeContext other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} + diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs index 2151d8821137..488442d4b557 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.Serialization.cs @@ -21,37 +21,37 @@ void IJsonModel.Write(Utf8JsonWri } writer.WriteStartObject(); - if (Optional.IsDefined(TopNDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (Optional.IsDefined(InScope)) + if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (Optional.IsDefined(Strictness)) + if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (Optional.IsDefined(RoleInformation)) + if (SerializedAdditionalRawData?.ContainsKey("role_information") != true && Optional.IsDefined(RoleInformation)) { writer.WritePropertyName("role_information"u8); writer.WriteStringValue(RoleInformation); } - if (Optional.IsDefined(MaxSearchQueries)) + if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (Optional.IsDefined(AllowPartialResult)) + if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (Optional.IsCollectionDefined(_internalIncludeContexts)) + if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); @@ -61,31 +61,44 @@ void IJsonModel.Write(Utf8JsonWri } writer.WriteEndArray(); } - writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint.AbsoluteUri); - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - if (Optional.IsDefined(FieldMappings)) + if (SerializedAdditionalRawData?.ContainsKey("endpoint") != true) + { + writer.WritePropertyName("endpoint"u8); + writer.WriteStringValue(Endpoint.AbsoluteUri); + } + if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + { + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + } + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true && Optional.IsDefined(FieldMappings)) { writer.WritePropertyName("fields_mapping"u8); writer.WriteObjectValue(FieldMappings, options); } - if (Optional.IsDefined(QueryType)) + if (SerializedAdditionalRawData?.ContainsKey("query_type") != true && Optional.IsDefined(QueryType)) { writer.WritePropertyName("query_type"u8); writer.WriteStringValue(QueryType.Value.ToString()); } - if (Optional.IsDefined(VectorizationSource)) + if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true && Optional.IsDefined(VectorizationSource)) { writer.WritePropertyName("embedding_dependency"u8); writer.WriteObjectValue(VectorizationSource, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -245,6 +258,7 @@ internal static InternalElasticsearchChatDataSourceParameters DeserializeInterna } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs index d65b16744c55..fdfc831ab8a1 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalElasticsearchChatDataSourceParameters.cs @@ -40,8 +40,7 @@ internal partial class InternalElasticsearchChatDataSourceParameters /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// /// @@ -111,7 +110,7 @@ internal InternalElasticsearchChatDataSourceParameters(int? topNDocuments, bool? FieldMappings = fieldMappings; QueryType = queryType; VectorizationSource = vectorizationSource; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs index 491fa1e282c9..e7acec9ad698 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.Serialization.cs @@ -21,37 +21,37 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteStartObject(); - if (Optional.IsDefined(TopNDocuments)) + if (SerializedAdditionalRawData?.ContainsKey("top_n_documents") != true && Optional.IsDefined(TopNDocuments)) { writer.WritePropertyName("top_n_documents"u8); writer.WriteNumberValue(TopNDocuments.Value); } - if (Optional.IsDefined(InScope)) + if (SerializedAdditionalRawData?.ContainsKey("in_scope") != true && Optional.IsDefined(InScope)) { writer.WritePropertyName("in_scope"u8); writer.WriteBooleanValue(InScope.Value); } - if (Optional.IsDefined(Strictness)) + if (SerializedAdditionalRawData?.ContainsKey("strictness") != true && Optional.IsDefined(Strictness)) { writer.WritePropertyName("strictness"u8); writer.WriteNumberValue(Strictness.Value); } - if (Optional.IsDefined(RoleInformation)) + if (SerializedAdditionalRawData?.ContainsKey("role_information") != true && Optional.IsDefined(RoleInformation)) { writer.WritePropertyName("role_information"u8); writer.WriteStringValue(RoleInformation); } - if (Optional.IsDefined(MaxSearchQueries)) + if (SerializedAdditionalRawData?.ContainsKey("max_search_queries") != true && Optional.IsDefined(MaxSearchQueries)) { writer.WritePropertyName("max_search_queries"u8); writer.WriteNumberValue(MaxSearchQueries.Value); } - if (Optional.IsDefined(AllowPartialResult)) + if (SerializedAdditionalRawData?.ContainsKey("allow_partial_result") != true && Optional.IsDefined(AllowPartialResult)) { writer.WritePropertyName("allow_partial_result"u8); writer.WriteBooleanValue(AllowPartialResult.Value); } - if (Optional.IsCollectionDefined(_internalIncludeContexts)) + if (SerializedAdditionalRawData?.ContainsKey("include_contexts") != true && Optional.IsCollectionDefined(_internalIncludeContexts)) { writer.WritePropertyName("include_contexts"u8); writer.WriteStartArray(); @@ -61,20 +61,39 @@ void IJsonModel.Write(Utf8JsonWriter w } writer.WriteEndArray(); } - writer.WritePropertyName("environment"u8); - writer.WriteStringValue(Environment); - writer.WritePropertyName("index_name"u8); - writer.WriteStringValue(IndexName); - writer.WritePropertyName("authentication"u8); - writer.WriteObjectValue(Authentication, options); - writer.WritePropertyName("embedding_dependency"u8); - writer.WriteObjectValue(VectorizationSource, options); - writer.WritePropertyName("fields_mapping"u8); - writer.WriteObjectValue(FieldMappings, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("environment") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment); + } + if (SerializedAdditionalRawData?.ContainsKey("index_name") != true) + { + writer.WritePropertyName("index_name"u8); + writer.WriteStringValue(IndexName); + } + if (SerializedAdditionalRawData?.ContainsKey("authentication") != true) + { + writer.WritePropertyName("authentication"u8); + writer.WriteObjectValue(Authentication, options); + } + if (SerializedAdditionalRawData?.ContainsKey("embedding_dependency") != true) + { + writer.WritePropertyName("embedding_dependency"u8); + writer.WriteObjectValue(VectorizationSource, options); + } + if (SerializedAdditionalRawData?.ContainsKey("fields_mapping") != true) + { + writer.WritePropertyName("fields_mapping"u8); + writer.WriteObjectValue(FieldMappings, options); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -216,6 +235,7 @@ internal static InternalPineconeChatDataSourceParameters DeserializeInternalPine } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs index 1a3f983ce953..2e19d59b5e7e 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalPineconeChatDataSourceParameters.cs @@ -40,8 +40,7 @@ internal partial class InternalPineconeChatDataSourceParameters /// /// /// - private IDictionary _serializedAdditionalRawData; - + internal IDictionary SerializedAdditionalRawData { get; set; } /// Initializes a new instance of . /// The environment name to use with Pinecone. /// The name of the Pinecone database index to use. @@ -131,7 +130,7 @@ internal InternalPineconeChatDataSourceParameters(int? topNDocuments, bool? inSc Authentication = authentication; VectorizationSource = vectorizationSource; FieldMappings = fieldMappings; - _serializedAdditionalRawData = serializedAdditionalRawData; + SerializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs index ce26fdefca2a..140d7777d516 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSource.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -73,6 +80,7 @@ internal static InternalUnknownAzureChatDataSource DeserializeInternalUnknownAzu } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs index d25e6387b8c8..a852533c4a82 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -73,6 +80,7 @@ internal static InternalUnknownAzureChatDataSourceAuthenticationOptions Deserial } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs index 6d23a2b2f9a3..1833688883e8 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceAuthenticationOptions.cs @@ -11,7 +11,7 @@ namespace Azure.AI.OpenAI.Chat internal partial class InternalUnknownAzureChatDataSourceAuthenticationOptions : DataSourceAuthentication { /// Initializes a new instance of . - /// + /// Discriminator. /// Keeps track of any properties unknown to the library. internal InternalUnknownAzureChatDataSourceAuthenticationOptions(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs index 4d4ce4137610..ed6bccf0c5ad 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/InternalUnknownAzureChatDataSourceVectorizationSource.Serialization.cs @@ -21,12 +21,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr } writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("type") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -73,6 +80,7 @@ internal static InternalUnknownAzureChatDataSourceVectorizationSource Deserializ } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs index 1e480d6deb42..ca7bb2911d1c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.Serialization.cs @@ -21,14 +21,24 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader } writer.WriteStartObject(); - writer.WritePropertyName("parameters"u8); - writer.WriteObjectValue(InternalParameters, options); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (SerializedAdditionalRawData?.ContainsKey("parameters") != true) { - foreach (var item in _serializedAdditionalRawData) + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(InternalParameters, options); + } + if (SerializedAdditionalRawData?.ContainsKey("type") != true) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (SerializedAdditionalRawData != null) + { + foreach (var item in SerializedAdditionalRawData) { + if (ModelSerializationExtensions.IsSentinelValue(item.Value)) + { + continue; + } writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER writer.WriteRawValue(item.Value); @@ -81,6 +91,7 @@ internal static PineconeChatDataSource DeserializePineconeChatDataSource(JsonEle } if (options.Format != "W") { + rawDataDictionary ??= new Dictionary(); rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs index e7f28473f974..273aaca38f5c 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Generated/PineconeChatDataSource.cs @@ -10,15 +10,5 @@ namespace Azure.AI.OpenAI.Chat /// The PineconeChatDataSource. public partial class PineconeChatDataSource : AzureChatDataSource { - /// Initializes a new instance of . - /// The parameter information to control the use of the Pinecone data source. - /// is null. - internal PineconeChatDataSource(InternalPineconeChatDataSourceParameters internalParameters) - { - Argument.AssertNotNull(internalParameters, nameof(internalParameters)); - - Type = "pinecone"; - InternalParameters = internalParameters; - } } } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Utility/AzureOpenAIPipelineMessageBuilder.cs b/sdk/openai/Azure.AI.OpenAI/src/Utility/AzureOpenAIPipelineMessageBuilder.cs index 58d1605661c6..07d5d37115df 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Utility/AzureOpenAIPipelineMessageBuilder.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Utility/AzureOpenAIPipelineMessageBuilder.cs @@ -57,6 +57,12 @@ public AzureOpenAIPipelineMessageBuilder WithOptionalQueryParameter(string na where T : struct, IConvertible => WithOptionalQueryParameter(name, value.HasValue ? Convert.ChangeType(value.Value, typeof(string)).ToString() : null); + public AzureOpenAIPipelineMessageBuilder WithCommonListParameters(int? limit, string order, string after, string before) + => WithOptionalQueryParameter("limit", limit) + .WithOptionalQueryParameter("order", order) + .WithOptionalQueryParameter("after", after) + .WithOptionalQueryParameter("before", before); + public AzureOpenAIPipelineMessageBuilder WithMethod(string requestMethod) { _method = requestMethod; @@ -76,6 +82,12 @@ public AzureOpenAIPipelineMessageBuilder WithHeader(string name, string value) return this; } + public AzureOpenAIPipelineMessageBuilder WithAssistantsHeader() + { + _headers[s_OpenAIBetaFeatureHeader] = s_OpenAIBetaAssistantsV2HeaderValue; + return this; + } + public AzureOpenAIPipelineMessageBuilder WithAccept(string acceptHeaderValue) => WithHeader("Accept", acceptHeaderValue); @@ -149,4 +161,7 @@ private void SetUri(PipelineRequest request) request.Uri = uriBuilder.ToUri(); } + + private static readonly string s_OpenAIBetaFeatureHeader = "OpenAI-Beta"; + private static readonly string s_OpenAIBetaAssistantsV2HeaderValue = "assistants=v2"; } diff --git a/sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs b/sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs new file mode 100644 index 000000000000..23fc567fa203 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/src/Utility/CustomSerializationHelpers.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable enable + +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.AI.OpenAI; + +internal static partial class CustomSerializationHelpers +{ + internal static TOutput DeserializeNewInstance( + UInstanceInput existingInstance, + Func deserializationFunc, + ref Utf8JsonReader reader, + ModelReaderWriterOptions options) + where UInstanceInput : IJsonModel + { + options ??= new("W"); + var format = options.Format == "W" ? ((IJsonModel)existingInstance).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UInstanceInput)} does not support '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return deserializationFunc.Invoke(document.RootElement, options); + } + + internal static TOutput DeserializeNewInstance( + UInstanceInput existingInstance, + Func deserializationFunc, + BinaryData data, + ModelReaderWriterOptions options) + where UInstanceInput : IPersistableModel + { + options ??= new("W"); + var format = options.Format == "W" ? ((IPersistableModel)existingInstance).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return deserializationFunc.Invoke(document.RootElement, options)!; + } + default: + throw new FormatException($"The model {nameof(UInstanceInput)} does not support '{format}' format."); + } + } + + internal static void SerializeInstance( + UInstanceInput instance, + Action serializationFunc, + Utf8JsonWriter writer, + ModelReaderWriterOptions options) + where UInstanceInput : IJsonModel + { + options ??= new ModelReaderWriterOptions("W"); + AssertSupportedJsonWriteFormat(instance, options); + serializationFunc.Invoke(instance, writer, options); + } + + internal static void SerializeInstance( + T instance, + Action serializationFunc, + Utf8JsonWriter writer, + ModelReaderWriterOptions options) + where T : IJsonModel + => SerializeInstance(instance, serializationFunc, writer, options); + + internal static BinaryData SerializeInstance( + UInstanceInput instance, + ModelReaderWriterOptions options) + where UInstanceInput : IPersistableModel + { + options ??= new("W"); + AssertSupportedPersistableWriteFormat(instance, options); + return ModelReaderWriter.Write(instance, options); + } + + internal static BinaryData SerializeInstance(T instance, ModelReaderWriterOptions options) + where T : IPersistableModel + => SerializeInstance(instance, options); + + internal static void AssertSupportedJsonWriteFormat(T instance, ModelReaderWriterOptions options) + where T : IJsonModel + => AssertSupportedJsonWriteFormat(instance, options); + + internal static void AssertSupportedJsonWriteFormat(UInstanceInput instance, ModelReaderWriterOptions options) + where UInstanceInput : IJsonModel + { + var format = options.Format == "W" ? ((IJsonModel)instance).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UInstanceInput)} does not support '{format}' format."); + } + } + + internal static void AssertSupportedPersistableWriteFormat(T instance, ModelReaderWriterOptions options) + where T : IPersistableModel + => AssertSupportedPersistableWriteFormat(instance, options); + + internal static void AssertSupportedPersistableWriteFormat(UInstanceInput instance, ModelReaderWriterOptions options) + where UInstanceInput : IPersistableModel + { + var format = options.Format == "W" ? ((IPersistableModel)instance).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UInstanceInput)} does not support '{format}' format."); + } + } + + internal static void WriteSerializedAdditionalRawData(this Utf8JsonWriter writer, IDictionary dictionary, ModelReaderWriterOptions options) + { + if (true && dictionary != null) + { + foreach (var item in dictionary) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using JsonDocument document = JsonDocument.Parse(item.Value); + JsonSerializer.Serialize(writer, document.RootElement); +#endif + } + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/src/Utility/GenericActionPipelinePolicy.cs b/sdk/openai/Azure.AI.OpenAI/src/Utility/GenericActionPipelinePolicy.cs index a2b78d825c59..79e5ccc30bfb 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Utility/GenericActionPipelinePolicy.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Utility/GenericActionPipelinePolicy.cs @@ -7,22 +7,26 @@ namespace Azure.AI.OpenAI; internal partial class GenericActionPipelinePolicy : PipelinePolicy { - private Action _processMessageAction; + private Action _requestAction; + private Action _responseAction; - public GenericActionPipelinePolicy(Action processMessageAction) + public GenericActionPipelinePolicy(Action requestAction = null, Action responseAction = null) { - _processMessageAction = processMessageAction; + _requestAction = requestAction; + _responseAction = responseAction; } public override void Process(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) { - _processMessageAction(message); + _requestAction?.Invoke(message.Request); ProcessNext(message, pipeline, currentIndex); + _responseAction?.Invoke(message.Response); } - public override ValueTask ProcessAsync(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) + public override async ValueTask ProcessAsync(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) { - _processMessageAction(message); - return ProcessNextAsync(message, pipeline, currentIndex); + _requestAction?.Invoke(message.Request); + await ProcessNextAsync(message, pipeline, currentIndex).ConfigureAwait(false); + _responseAction?.Invoke(message.Response); } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs index 63d77bd85bd2..209beccedb8a 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/AssistantTests.cs @@ -9,13 +9,13 @@ using System.Diagnostics; using System.Linq; using System.Text; -using System.Threading; using System.Threading.Tasks; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.Core.TestFramework; using OpenAI; using OpenAI.Assistants; using OpenAI.Files; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Utils; using OpenAI.VectorStores; namespace Azure.AI.OpenAI.Tests; @@ -80,10 +80,9 @@ public async Task BasicAssistantOperationsWork() }, }); Assert.That(modifiedAssistant.Id, Is.EqualTo(assistant.Id)); - AsyncPageableCollection recentAssistants = SyncOrAsync( - client, c => c.GetAssistants(), c => c.GetAssistantsAsync()); + AsyncPageCollection recentAssistants = client.GetAssistantsAsync(); Assistant recentAssistant = null; - await foreach (Assistant asyncAssistant in recentAssistants) + await foreach (Assistant asyncAssistant in recentAssistants.GetAllValuesAsync()) { recentAssistant = asyncAssistant; break; @@ -158,7 +157,7 @@ public async Task StreamingToolCall() { AssistantClient client = GetTestClient(); string modelName = client.DeploymentOrThrow(); - FunctionToolDefinition getWeatherTool = new("get_current_weather", "Gets the user's current weather"); + FunctionToolDefinition getWeatherTool = new("get_current_weather") { Description = "Gets the user's current weather" }; Assistant assistant = await client.CreateAssistantAsync(modelName, new() { Tools = { getWeatherTool } @@ -174,9 +173,7 @@ public async Task StreamingToolCall() { InitialMessages = { new(MessageRole.User, ["What should I wear outside right now?"]), }, }; - AsyncResultCollection asyncResults = SyncOrAsync(client, - c => c.CreateThreadAndRunStreaming(assistant, thrdOpt), - c => c.CreateThreadAndRunStreamingAsync(assistant, thrdOpt)); + AsyncCollectionResult asyncResults = client.CreateThreadAndRunStreamingAsync(assistant, thrdOpt); Print(" >>> Starting enumeration ..."); @@ -210,9 +207,7 @@ public async Task StreamingToolCall() } if (toolOutputs.Count > 0) { - asyncResults = SyncOrAsync(client, - c => c.SubmitToolOutputsToRunStreaming(run, toolOutputs), - c => c.SubmitToolOutputsToRunStreamingAsync(run, toolOutputs)); + asyncResults = client.SubmitToolOutputsToRunStreamingAsync(run, toolOutputs); } } while (run?.Status.IsTerminal == false); } @@ -261,9 +256,7 @@ public async Task BasicMessageOperationsWork() }); Assert.That(message.Metadata.TryGetValue("messageMetadata", out metadataValue) && metadataValue == "newValue"); - var messagePage = await SyncOrAsyncList(client, - c => c.GetMessages(thread), - c => c.GetMessagesAsync(thread)); + var messagePage = await client.GetMessagesAsync(thread).ToListAsync(); if (aoaiDeleteBugFixed) { Assert.That(messagePage.Count, Is.EqualTo(1)); @@ -280,17 +273,16 @@ public async Task BasicMessageOperationsWork() [RecordedTest] public async Task ThreadWithInitialMessagesWorks() { + const string userGreeting = "Hello, world!"; + const string userQuestion = "Can you describe why stop signs are the shape and color that they are?"; + AssistantClient client = GetTestClient(); ThreadCreationOptions options = new() { InitialMessages = { - new ThreadInitializationMessage(MessageRole.User, ["Hello, world!"]), - new ThreadInitializationMessage(MessageRole.User, - [ - "Can you describe this image for me?", - MessageContent.FromImageUrl(new Uri("https://test.openai.com/image.png")) - ]) + new ThreadInitializationMessage(MessageRole.User, [userGreeting]), + new ThreadInitializationMessage(MessageRole.User, [ userQuestion ]) { Metadata = { @@ -299,20 +291,15 @@ public async Task ThreadWithInitialMessagesWorks() }, }, }; - AssistantThread thread = await client.CreateThreadAsync (options); + AssistantThread thread = await client.CreateThreadAsync(options); Validate(thread); - List messageList = await SyncOrAsyncList(client, - c => c.GetMessages(thread, resultOrder: ListOrder.OldestFirst), - c => c.GetMessagesAsync(thread, resultOrder: ListOrder.OldestFirst)); + List messageList = await client.GetMessagesAsync(thread, new() { Order = ListOrder.OldestFirst }).ToListAsync(); Assert.That(messageList.Count, Is.EqualTo(2)); Assert.That(messageList[0].Role, Is.EqualTo(MessageRole.User)); Assert.That(messageList[0].Content?.Count, Is.EqualTo(1)); - Assert.That(messageList[0].Content[0].Text, Is.EqualTo("Hello, world!")); - Assert.That(messageList[1].Content?.Count, Is.EqualTo(2)); + Assert.That(messageList[0].Content[0].Text, Is.EqualTo(userGreeting)); Assert.That(messageList[1].Content[0], Is.Not.Null); - Assert.That(messageList[1].Content[0].Text, Is.EqualTo("Can you describe this image for me?")); - Assert.That(messageList[1].Content[1], Is.Not.Null); - Assert.That(messageList[1].Content[1].ImageUrl.AbsoluteUri, Is.EqualTo("https://test.openai.com/image.png")); + Assert.That(messageList[1].Content[0].Text, Is.EqualTo(userQuestion)); } [RecordedTest] @@ -324,9 +311,7 @@ public async Task BasicRunOperationsWork() Validate(assistant); AssistantThread thread = await client.CreateThreadAsync(); Validate(thread); - List runPage = await SyncOrAsyncList(client, - c => c.GetRuns(thread.Id), - c => c.GetRunsAsync(thread.Id)); + List runPage = await client.GetRunsAsync(thread.Id).ToListAsync(); Assert.That(runPage.Count, Is.EqualTo(0)); ThreadMessage message = await client.CreateMessageAsync(thread.Id, MessageRole.User, ["Hello, assistant!"]); Validate(message); @@ -336,15 +321,11 @@ public async Task BasicRunOperationsWork() Assert.That(run.CreatedAt, Is.GreaterThan(s_2024)); ThreadRun retrievedRun = await client.GetRunAsync(thread.Id, run.Id); Assert.That(retrievedRun.Id, Is.EqualTo(run.Id)); - runPage = await SyncOrAsyncList(client, - c => c.GetRuns(thread.Id), - c => c.GetRunsAsync(thread.Id)); + runPage = await client.GetRunsAsync(thread.Id).ToListAsync(); Assert.That(runPage.Count, Is.EqualTo(1)); Assert.That(runPage.ElementAt(0).Id, Is.EqualTo(run.Id)); - List messages = await SyncOrAsyncList(client, - c => c.GetMessages(thread), - c => c.GetMessagesAsync(thread)); + List messages = await client.GetMessagesAsync(thread).ToListAsync(); Assert.That(messages.Count, Is.GreaterThanOrEqualTo(1)); run = await WaitUntilReturnLast( @@ -362,9 +343,7 @@ public async Task BasicRunOperationsWork() Assert.That(run.FailedAt, Is.Null); Assert.That(run.IncompleteDetails, Is.Null); }); - messages = await SyncOrAsyncList(client, - c => c.GetMessages(thread), - c => c.GetMessagesAsync(thread)); + messages = await client.GetMessagesAsync(thread).ToListAsync(); Assert.That(messages.Count, Is.EqualTo(2)); Assert.That(messages.ElementAt(0).Role, Is.EqualTo(MessageRole.Assistant)); @@ -400,9 +379,7 @@ public async Task BasicRunStepFunctionalityWorks() Assert.That(run.Status, Is.EqualTo(RunStatus.Completed)); Assert.That(run.Usage?.TotalTokens, Is.GreaterThan(0)); - List runSteps = await SyncOrAsyncList(client, - c => c.GetRunSteps(run), - c => c.GetRunStepsAsync(run)); + List runSteps = await client.GetRunStepsAsync(run).ToListAsync(); Assert.That(runSteps.Count(), Is.GreaterThan(1)); Assert.Multiple(() => { @@ -497,9 +474,8 @@ public async Task FunctionToolsWork() r => r.Status.IsTerminal); Assert.That(run.Status, Is.EqualTo(RunStatus.Completed)); - List messages = await SyncOrAsyncList(client, - c => c.GetMessages(run.ThreadId, resultOrder: ListOrder.NewestFirst), - c => c.GetMessagesAsync(run.ThreadId, resultOrder: ListOrder.NewestFirst)); + List messages = await client.GetMessagesAsync(run.ThreadId, new() { Order = ListOrder.NewestFirst }) + .ToListAsync(); Assert.That(messages.Count, Is.GreaterThan(1)); Assert.That(messages.ElementAt(0).Role, Is.EqualTo(MessageRole.Assistant)); Assert.That(messages.ElementAt(0).Content?[0], Is.Not.Null); @@ -602,12 +578,10 @@ This file describes the favorite foods of several people. r => r.Status.IsTerminal); Assert.That(run.Status, Is.EqualTo(RunStatus.Completed)); - AsyncPageableCollection messages = SyncOrAsync(client, - c => c.GetMessages(thread, resultOrder: ListOrder.NewestFirst), - c => c.GetMessagesAsync(thread, resultOrder: ListOrder.NewestFirst)); + AsyncPageCollection messages = client.GetMessagesAsync(thread, new() { Order = ListOrder.NewestFirst }); bool hasAtLeastOne = false; bool hasCake = false; - await foreach (ThreadMessage message in messages) + await foreach (ThreadMessage message in messages.GetAllValuesAsync()) { hasAtLeastOne = true; foreach (MessageContent content in message.Content) @@ -638,9 +612,7 @@ public async Task StreamingRunWorks() }); Validate(thread); - AsyncResultCollection streamingResult = SyncOrAsync(client, - c => c.CreateRunStreaming(thread.Id, assistant.Id), - c => c.CreateRunStreamingAsync(thread.Id, assistant.Id)); + AsyncCollectionResult streamingResult = client.CreateRunStreamingAsync(thread.Id, assistant.Id); StringBuilder content = new(); DateTimeOffset? lastUpdate = null; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs index e968a879a3f6..5312b8083330 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/AudioTests.cs @@ -1,26 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.ClientModel.Primitives; using System.IO; using System.Threading.Tasks; -using Azure.Core.TestFramework; using OpenAI.Audio; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests; -public class AudioTests : AoaiTestBase +public class AudioTests(bool isAsync) : AoaiTestBase(isAsync) { - public AudioTests(bool isAsync) : base(isAsync) - { - DisableRequestBodyRecording(nameof(AudioClient.TranscribeAudioAsync)); - DisableRequestBodyRecording(nameof(AudioClient.TranslateAudioAsync)); - } - [Test] [Category("Smoke")] public void CanCreateClient() => Assert.That(GetTestClient(), Is.InstanceOf()); @@ -45,7 +37,7 @@ public async Task TranslationWorks() public async Task TextToSpeechWorks() { AudioClient audioClient = GetTestClient("tts"); - BinaryData ttsData = await audioClient.GenerateSpeechFromTextAsync( + BinaryData ttsData = await audioClient.GenerateSpeechAsync( "hello, world!", GeneratedSpeechVoice.Alloy); Assert.That(ttsData, Is.Not.Null); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj b/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj index 81d68704d173..5cc3cb985475 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj +++ b/sdk/openai/Azure.AI.OpenAI/tests/Azure.AI.OpenAI.Tests.csproj @@ -6,6 +6,7 @@ $(NoWarn);CS1591;CS8002;SA1402;SA1507;SA1508;SA1633;SA1028;SA1505;OPENAI001;AOAI001 preview + enable @@ -14,13 +15,20 @@ - - - + + + + + + diff --git a/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs index 4bd58e716ffb..357c022d1c1e 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/BatchTests.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.ClientModel.Primitives; @@ -15,12 +13,13 @@ using Azure.AI.OpenAI.Tests.Models; using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.AI.OpenAI.Tests.Utils.Pipeline; -using Azure.Core.TestFramework; using OpenAI.Batch; using OpenAI.Chat; using OpenAI.Embeddings; using OpenAI.Files; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Mocks; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests; @@ -93,7 +92,7 @@ private BinaryData ValidateHasRawJsonResponse(ClientResult result) PipelineResponse response = result.GetRawResponse(); Assert.That(response, Is.Not.Null); Assert.That(response.Status, Is.GreaterThanOrEqualTo(200).And.LessThan(300)); - Assert.That(response.Headers.GetFirstValueOrDefault("Content-Type"), Does.StartWith("application/json")); + Assert.That(response.Headers.GetFirstOrDefault("Content-Type"), Does.StartWith("application/json")); return response.Content; } @@ -120,15 +119,15 @@ private BatchObject ExtractAndValidateBatchObj(ClientResult result) private class BatchOperations : IAsyncDisposable { - private MockPipeline _pipeline; + private MockHttpMessageHandler _handler; private List _operations; private string? _uploadId; private FileClient _fileClient; public BatchOperations(AoaiTestBase testBase, BatchClient batchClient) { - _pipeline = new MockPipeline(MockPipeline.ReturnEmptyJson); - _pipeline.OnRequest += HandleRequest; + _handler = new(MockHttpMessageHandler.ReturnEmptyJson); + _handler.OnRequest += HandleRequest; _operations = new(); BatchFileName = "batch-" + Guid.NewGuid().ToString("D") + ".json"; @@ -139,7 +138,7 @@ public BatchOperations(AoaiTestBase testBase, BatchClient batchClie AzureOpenAIClient fakeTopLevel = new AzureOpenAIClient( new Uri("https://not.a.real.endpoint.fake"), new ApiKeyCredential("not.a.real.key"), - new() { Transport = _pipeline.Transport }); + new() { Transport = _handler.Transport }); ChatClient = fakeTopLevel.GetChatClient(testBase.TestConfig.GetConfig().DeploymentOrThrow("chat client")); EmbeddingClient = fakeTopLevel.GetEmbeddingClient(testBase.TestConfig.GetConfig().DeploymentOrThrow("embedding client")); @@ -158,7 +157,7 @@ public async Task UploadBatchFileAsync() } using MemoryStream stream = new MemoryStream(); - JsonHelpers.Serialize(stream, _operations, JsonHelpers.OpenAIJsonOptions); + JsonHelpers.Serialize(stream, _operations, JsonOptions.OpenAIJsonOptions); stream.Seek(0, SeekOrigin.Begin); var data = BinaryData.FromStream(stream); @@ -186,8 +185,8 @@ public async ValueTask DisposeAsync() await _fileClient.DeleteFileAsync(_uploadId); } - _pipeline.OnRequest -= HandleRequest; - _pipeline.Dispose(); + _handler.OnRequest -= HandleRequest; + _handler.Dispose(); _operations.Clear(); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs index d4a3437cf702..ebe881c6acef 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Functions.cs @@ -1,13 +1,15 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Threading.Tasks; -using Azure.AI.OpenAI.Chat; -using Azure.Core.TestFramework; using OpenAI.Chat; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests; @@ -113,7 +115,8 @@ public async Task SimpleFunctionCallWorks(FunctionCallTestType functionCallType) Assert.That(completion.FunctionCall, Is.Not.Null); Assert.That(completion.FunctionCall.FunctionName, Is.EqualTo(FUNCTION_TEMPERATURE.FunctionName)); Assert.That(completion.FunctionCall.FunctionArguments, Is.Not.Null); - var parsedArgs = JsonSerializer.Deserialize(completion.FunctionCall.FunctionArguments, SERIALIZER_OPTIONS); + var parsedArgs = JsonSerializer.Deserialize(completion.FunctionCall.FunctionArguments, SERIALIZER_OPTIONS)!; + Assert.That(parsedArgs, Is.Not.Null); Assert.That(parsedArgs.LocationName, Is.Not.Null.Or.Empty); Assert.That(parsedArgs.Date, Is.Not.Null.Or.Empty); @@ -157,7 +160,7 @@ public async Task SimpleFunctionCallWorksStreaming(FunctionCallTestType function StringBuilder content = new(); bool foundPromptFilter = false; bool foundResponseFilter = false; - string functionName = null; + string? functionName = null; StringBuilder functionArgs = new(); ChatClient client = GetTestClient(); @@ -219,9 +222,7 @@ public async Task SimpleFunctionCallWorksStreaming(FunctionCallTestType function } }; - AsyncResultCollection response = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, requestOptions), - c => c.CompleteChatStreamingAsync(messages, requestOptions)); + AsyncCollectionResult response = client.CompleteChatStreamingAsync(messages, requestOptions); Assert.That(response, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in response) @@ -234,7 +235,8 @@ public async Task SimpleFunctionCallWorksStreaming(FunctionCallTestType function if (functionCallType != FunctionCallTestType.None) { Assert.That(functionName, Is.Not.Null); - var parsedArgs = JsonSerializer.Deserialize(functionArgs.ToString(), SERIALIZER_OPTIONS); + var parsedArgs = JsonSerializer.Deserialize(functionArgs.ToString(), SERIALIZER_OPTIONS)!; + Assert.That(parsedArgs, Is.Not.Null); Assert.That(parsedArgs.LocationName, Is.Not.Null.Or.Empty); Assert.That(parsedArgs.Date, Is.Not.Null.Or.Empty); @@ -260,9 +262,7 @@ public async Task SimpleFunctionCallWorksStreaming(FunctionCallTestType function functionName = null; functionArgs.Clear(); - response = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, requestOptions), - c => c.CompleteChatStreamingAsync(messages, requestOptions)); + response = client.CompleteChatStreamingAsync(messages, requestOptions); Assert.That(response, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in response) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs index 52ef26ac4198..77160c89a626 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Tools.cs @@ -1,12 +1,14 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.ClientModel; using System.Collections.Generic; using System.Text; using System.Text.Json; using System.Threading.Tasks; -using Azure.AI.OpenAI.Chat; -using Azure.Core.TestFramework; using OpenAI.Chat; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests { @@ -40,8 +42,8 @@ public partial class ChatTests private class TemperatureFunctionRequestArguments { - public string LocationName { get; set; } - public string Date { get; set; } + public string? LocationName { get; set; } + public string? Date { get; set; } } public enum ToolChoiceTestType @@ -129,7 +131,8 @@ public async Task SimpleToolWorks(ToolChoiceTestType toolChoice) Assert.That(toolCall.Kind, Is.EqualTo(ChatToolCallKind.Function)); Assert.That(toolCall.FunctionName, Is.EqualTo(TOOL_TEMPERATURE.FunctionName)); Assert.That(toolCall.FunctionArguments, Is.Not.Null); - var parsedArgs = JsonSerializer.Deserialize(toolCall.FunctionArguments, SERIALIZER_OPTIONS); + var parsedArgs = JsonSerializer.Deserialize(toolCall.FunctionArguments, SERIALIZER_OPTIONS)!; + Assert.That(parsedArgs, Is.Not.Null); Assert.That(parsedArgs.LocationName, Is.Not.Null.Or.Empty); Assert.That(parsedArgs.Date, Is.Not.Null.Or.Empty); @@ -179,8 +182,8 @@ public async Task SimpleToolWorksStreaming(ToolChoiceTestType toolChoice) StringBuilder content = new(); bool foundPromptFilter = false; bool foundResponseFilter = false; - string toolId = null; - string toolName = null; + string? toolId = null; + string? toolName = null; StringBuilder toolArgs = new(); ChatClient client = GetTestClient(); @@ -251,9 +254,7 @@ public async Task SimpleToolWorksStreaming(ToolChoiceTestType toolChoice) } }; - AsyncResultCollection response = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, requestOptions), - c => c.CompleteChatStreamingAsync(messages, requestOptions)); + AsyncCollectionResult response = client.CompleteChatStreamingAsync(messages, requestOptions); Assert.That(response, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in response) @@ -269,7 +270,8 @@ public async Task SimpleToolWorksStreaming(ToolChoiceTestType toolChoice) Assert.That(toolId, Is.Not.Null); Assert.That(toolName, Is.Not.Null); Assert.That(toolArgs, Has.Length.GreaterThan(0)); - var parsedArgs = JsonSerializer.Deserialize(toolArgs.ToString(), SERIALIZER_OPTIONS); + var parsedArgs = JsonSerializer.Deserialize(toolArgs.ToString(), SERIALIZER_OPTIONS)!; + Assert.That(parsedArgs, Is.Not.Null); Assert.That(parsedArgs.LocationName, Is.Not.Null.Or.Empty); Assert.That(parsedArgs.Date, Is.Not.Null.Or.Empty); @@ -304,9 +306,7 @@ public async Task SimpleToolWorksStreaming(ToolChoiceTestType toolChoice) toolName = null; toolArgs.Clear(); - response = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, requestOptions), - c => c.CompleteChatStreamingAsync(messages, requestOptions)); + response = client.CompleteChatStreamingAsync(messages, requestOptions); Assert.That(response, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in response) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs index 650db12f64fd..85399aac41ca 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.Vision.cs @@ -1,10 +1,13 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.ClientModel; using System.IO; using System.Text; using System.Threading.Tasks; -using Azure.Core.TestFramework; using OpenAI.Chat; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests { @@ -114,9 +117,7 @@ public async Task ChatWithImagesStreaming(bool useUri) MaxTokens = 2048, }; - AsyncResultCollection response = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, options), - c => c.CompleteChatStreamingAsync(messages, options)); + AsyncCollectionResult response = client.CompleteChatStreamingAsync(messages, options); Assert.That(response, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in response) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs index 43ba9180cd56..8e376ecb441d 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ChatTests.cs @@ -13,10 +13,10 @@ using System.Threading.Tasks; using Azure.AI.OpenAI.Chat; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.AI.OpenAI.Tests.Utils.Pipeline; -using Azure.Core.TestFramework; using OpenAI.Chat; -using OpenAI.Tests; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Mocks; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests; @@ -27,11 +27,11 @@ public ChatTests(bool isAsync) : base(isAsync) #region General tests - [TestCase] + [Test] [Category("Smoke")] public async Task DefaultUserAgentStringWorks() { - using MockPipeline pipeline = new(MockPipeline.ReturnEmptyJson); + using MockHttpMessageHandler pipeline = new(MockHttpMessageHandler.ReturnEmptyJson); Uri endpoint = new Uri("https://www.bing.com/"); string apiKey = "not-a-real-one"; @@ -45,7 +45,7 @@ public async Task DefaultUserAgentStringWorks() Transport = pipeline.Transport }); - ChatClient client = InstrumentClient(topLevel.GetChatClient(model)); + ChatClient client = WrapClient(topLevel.GetChatClient(model)); await client.CompleteChatAsync([new UserChatMessage("Hello")]); @@ -53,7 +53,7 @@ public async Task DefaultUserAgentStringWorks() var request = pipeline.Requests[0]; Assert.That(request.Method, Is.EqualTo(HttpMethod.Post)); - Assert.That(request.Uri.GetLeftPart(UriPartial.Authority), Is.EqualTo(endpoint.GetLeftPart(UriPartial.Authority))); + Assert.That(request.Uri?.GetLeftPart(UriPartial.Authority), Is.EqualTo(endpoint.GetLeftPart(UriPartial.Authority))); Assert.That(request.Headers.GetValueOrDefault("api-key")?.FirstOrDefault(), Is.EqualTo(apiKey)); Assert.That(request.Headers.GetValueOrDefault("User-Agent")?.FirstOrDefault(), Does.Contain("azsdk-net-AI.OpenAI/")); Assert.That(request.Content, Is.Not.Null); @@ -108,7 +108,7 @@ public void DataSourceSerializationWorks() IReadOnlyList sourcesFromOptions = options.GetDataSources(); Assert.That(sourcesFromOptions, Has.Count.EqualTo(1)); Assert.That(sourcesFromOptions[0], Is.InstanceOf()); - Assert.That((sourcesFromOptions[0] as ElasticsearchChatDataSource).IndexName, Is.EqualTo("my-index-name")); + Assert.That(((ElasticsearchChatDataSource)sourcesFromOptions[0]).IndexName, Is.EqualTo("my-index-name")); options.AddDataSource(new AzureCosmosDBChatDataSource() { @@ -146,7 +146,7 @@ public async Task ChatCompletionBadKeyGivesHelpfulError() } } - [Test] + [RecordedTest] [Category("Smoke")] public async Task DefaultAzureCredentialWorks() { @@ -158,7 +158,7 @@ public async Task DefaultAzureCredentialWorks() } [RecordedTest] - [LiveOnly(Reason = "Delay behavior not emulated by recordings")] + [Ignore("Delay behavior not emulated by recordings, and needs to be run manually with some time in between iterations due to service throttling behaviour")] [TestCase("x-ms-retry-after-ms", "1000", 1000)] [TestCase("retry-after-ms", "1400", 1400)] [TestCase("Retry-After", "1", 1000)] @@ -167,15 +167,18 @@ public async Task DefaultAzureCredentialWorks() [TestCase("x-fake-test-retry-header", "1400", 800)] public async Task RateLimitedRetryWorks(string headerName, string headerValue, double expectedDelayMilliseconds) { - IConfiguration testConfig = TestConfig.GetConfig("rate_limited_chat"); + const string responseClass = "HttpClientTransportResponse"; + const string responseField = "_httpResponse"; + IConfiguration testConfig = TestConfig.GetConfig("rate_limited_chat")!; + Assert.That(testConfig, Is.Not.Null); int failureCount = 0; - string clientRequestId = null; + string? clientRequestId = null; TestPipelinePolicy replaceHeadersPolicy = new( requestAction: (request) => { - clientRequestId ??= request.Headers.TryGetValue("x-ms-client-request-id", out string id) ? id : null; + clientRequestId ??= request.Headers.GetFirstOrDefault("x-ms-client-request-id"); }, responseAction: (response) => { @@ -183,9 +186,12 @@ public async Task RateLimitedRetryWorks(string headerName, string headerValue, d { failureCount++; - Type httpPipelineResponseType = typeof(HttpClientPipelineTransport).GetNestedType("HttpClientTransportResponse", BindingFlags.NonPublic); - FieldInfo httpResponseField = httpPipelineResponseType.GetField("_httpResponse", BindingFlags.Instance | BindingFlags.NonPublic); - HttpResponseMessage httpResponse = httpResponseField.GetValue(response) as HttpResponseMessage; + Type httpPipelineResponseType = typeof(HttpClientPipelineTransport).GetNestedType(responseClass, BindingFlags.NonPublic) + ?? throw new InvalidOperationException($"Could not the expected {responseClass} inner non public class"); + FieldInfo httpResponseField = httpPipelineResponseType.GetField(responseField, BindingFlags.Instance | BindingFlags.NonPublic) + ?? throw new InvalidOperationException($"Could not find the expected {responseClass}.{responseField} field)"); + HttpResponseMessage httpResponse = httpResponseField.GetValue(response) as HttpResponseMessage + ?? throw new InvalidOperationException($"Could note determine the HttpResponseMessage to modify"); httpResponse.Headers.Remove("x-ms-retry-after-ms"); httpResponse.Headers.Remove("retry-after-ms"); @@ -217,7 +223,7 @@ public async Task RateLimitedRetryWorks(string headerName, string headerValue, d Stopwatch requestWatch = Stopwatch.StartNew(); ClientResult protocolResult = await client.CompleteChatAsync(requestContent, noThrowOptions); PipelineResponse response = protocolResult.GetRawResponse(); - bool responseHasRequestId = response.Headers.TryGetValue("x-ms-client-request-id", out string requestIdFromResponse); + bool responseHasRequestId = response.Headers.TryGetValue("x-ms-client-request-id", out string? requestIdFromResponse); Assert.That(responseHasRequestId, Is.True); Assert.That(requestIdFromResponse, Is.EqualTo(clientRequestId)); switch (response.Status) @@ -238,8 +244,8 @@ public async Task RateLimitedRetryWorks(string headerName, string headerValue, d Assert.That(observed200Delay.HasValue, Is.True); Assert.That(observed429Delay.HasValue, Is.True); Assert.That(failureCount, Is.EqualTo(4)); - Assert.That(observed429Delay.Value.TotalMilliseconds, Is.GreaterThan(expectedDelayMilliseconds)); - Assert.That(observed429Delay.Value.TotalMilliseconds, Is.LessThan(3 * expectedDelayMilliseconds + 2 * observed200Delay.Value.TotalMilliseconds)); + Assert.That(observed429Delay!.Value.TotalMilliseconds, Is.GreaterThan(expectedDelayMilliseconds)); + Assert.That(observed429Delay!.Value.TotalMilliseconds, Is.LessThan(3 * expectedDelayMilliseconds + 2 * observed200Delay!.Value.TotalMilliseconds)); } #endregion @@ -339,7 +345,8 @@ public async Task ChatCompletionContentFilter() [RecordedTest] public async Task SearchExtensionWorks() { - var searchConfig = TestConfig.GetConfig("search"); + var searchConfig = TestConfig.GetConfig("search")!; + Assert.That(searchConfig, Is.Not.Null); string searchIndex = searchConfig.GetValueOrThrow("index"); AzureSearchChatDataSource source = new() @@ -393,10 +400,7 @@ public async Task ChatCompletionBadKeyGivesHelpfulErrorStreaming() ChatClient chatClient = GetTestClient(keyCredential: new ApiKeyCredential(mockKey)); var messages = new[] { new UserChatMessage("oops, this won't work with that key!") }; - AsyncResultCollection result = SyncOrAsync(chatClient, - c => c.CompleteChatStreaming(messages), - c => c.CompleteChatStreamingAsync(messages)); - + AsyncCollectionResult result = chatClient.CompleteChatStreamingAsync(messages); await foreach (StreamingChatCompletionUpdate update in result) { Assert.Fail("No exception was thrown"); @@ -433,9 +437,7 @@ public async Task ChatCompletionStreaming() TopLogProbabilityCount = 1, }; - AsyncResultCollection streamingResults = SyncOrAsync(chatClient, - c => c.CompleteChatStreaming(messages, options), - c => c.CompleteChatStreamingAsync(messages, options)); + AsyncCollectionResult streamingResults = chatClient.CompleteChatStreamingAsync(messages, options); Assert.That(streamingResults, Is.Not.Null); await foreach (StreamingChatCompletionUpdate update in streamingResults) @@ -458,7 +460,8 @@ public async Task SearchExtensionWorksStreaming() bool foundResponseFilter = false; List contexts = new(); - var searchConfig = TestConfig.GetConfig("search"); + var searchConfig = TestConfig.GetConfig("search")!; + Assert.That(searchConfig, Is.Not.Null); string searchIndex = searchConfig.GetValueOrThrow("index"); AzureSearchChatDataSource source = new() @@ -477,9 +480,7 @@ public async Task SearchExtensionWorksStreaming() ChatClient client = GetTestClient(); - AsyncResultCollection chatUpdates = SyncOrAsync(client, - c => c.CompleteChatStreaming(messages, options), - c => c.CompleteChatStreamingAsync(messages, options)); + AsyncCollectionResult chatUpdates = client.CompleteChatStreamingAsync(messages, options); Assert.IsNotNull(chatUpdates); await foreach (StreamingChatCompletionUpdate update in chatUpdates) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/EmbeddingTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/EmbeddingTests.cs index b0d10d301b48..771d59fbb8f4 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/EmbeddingTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/EmbeddingTests.cs @@ -3,8 +3,8 @@ using System.ClientModel; using System.Threading.Tasks; -using Azure.Core.TestFramework; using OpenAI.Embeddings; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs index 00883f195a9d..48b533798392 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/FileTests.cs @@ -1,12 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable disable - using System; using System.Threading.Tasks; -using Azure.Core.TestFramework; using OpenAI.Files; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests; @@ -28,7 +26,7 @@ public async Task CanUploadAndDeleteFiles() "test_file_delete_me.txt", FileUploadPurpose.Assistants); Validate(file); - bool deleted = await client.DeleteFileAsync(file); + bool deleted = await client.DeleteFileAsync(file.Id); Assert.IsTrue(deleted); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs index 28560a945c12..fb9ad2a926bc 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/FineTuningTests.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.ClientModel.Primitives; @@ -14,10 +12,11 @@ using Azure.AI.OpenAI.Tests.Models; using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.Core.TestFramework; using OpenAI.Chat; using OpenAI.Files; using OpenAI.FineTuning; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests; @@ -254,7 +253,7 @@ public async Task DeployAndChatWithModel() Assert.That(job!.Status, Is.EqualTo("succeeded")); // Deploy the model and wait for the deployment to finish - deploymentName = "azure-ai-openai-test-" + Recording.Random.NewGuid().ToString(); + deploymentName = "azure-ai-openai-test-" + Recording?.Random.NewGuid().ToString(); AzureDeployedModel deployment = await deploymentClient.CreateDeploymentAsync(deploymentName, fineTunedModel); Assert.That(deployment, Is.Not.Null); Assert.That(deployment.ID, !(Is.Null.Or.Empty)); @@ -393,7 +392,9 @@ private async Task DeleteJobAndVerifyAsync(FineTuningClient client, string ErrorOptions = ClientErrorBehaviors.NoThrow }; - var rawClient = GetOriginal(client); + // Since the DeleteJob and DeleteJobAsync are extensions methods, we need to call them on the unwrapped type, + // instead of the dynamically wrapped type. + var rawClient = UnWrap(client); bool success = false; while (DateTimeOffset.Now < stopTime) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs index a5e185a556c9..f82f5762ff47 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/ImageTests.cs @@ -1,27 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable disable - using System; using System.ClientModel; using System.Threading.Tasks; -using Azure.Core.TestFramework; -using Azure.Identity; using OpenAI.Images; +using OpenAI.TestFramework; namespace Azure.AI.OpenAI.Tests; -public class ImageTests : AoaiTestBase +public class ImageTests(bool isAsync) : AoaiTestBase(isAsync) { - public ImageTests(bool isAsync) : base(isAsync) - { } - [RecordedTest] [Category("Smoke")] public void CanCreateClient() { - ImageClient client = GetTestClient(tokenCredential: new DefaultAzureCredential()); + ImageClient client = GetTestClient(tokenCredential: TestEnvironment.Credential); Assert.That(client, Is.InstanceOf()); } @@ -52,7 +46,7 @@ public async Task CanCreateSimpleImage() { Quality = GeneratedImageQuality.Standard, Size = GeneratedImageSize.W1024xH1024, - User = "test_user", + EndUserId = "test_user", ResponseFormat = GeneratedImageFormat.Bytes, }); Assert.That(image, Is.Not.Null); @@ -67,7 +61,7 @@ public async Task CanGetContentFilterResults() { Quality = GeneratedImageQuality.Standard, Size = GeneratedImageSize.W1024xH1024, - User = "test_user", + EndUserId = "test_user", ResponseFormat = GeneratedImageFormat.Uri, }); GeneratedImage image = imageResult.Value; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/AzureDeploymentClient.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/AzureDeploymentClient.cs index 1352ff140bb4..3b51c441d76e 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/AzureDeploymentClient.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Models/AzureDeploymentClient.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.ClientModel.Primitives; @@ -16,6 +14,7 @@ using System.Threading.Tasks; using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Models; @@ -35,14 +34,14 @@ internal class AzureDeploymentClient : IDisposable private readonly string _endpointUrl; private readonly string _apiVersion; - protected AzureDeploymentClient() + internal AzureDeploymentClient() { // for mocking _cts = new(); _pipeline = ClientPipeline.Create(); _subscriptionId = _resourceGroup = _resourceName = _endpointUrl = string.Empty; _apiVersion = DEFAULT_API_VERSION; - _credential = new Core.TestFramework.MockCredential(); + _credential = null!; } public AzureDeploymentClient(IConfiguration config, Core.TokenCredential credential, string? apiVersion = null, PipelineTransport? transport = null) @@ -140,7 +139,7 @@ private async ValueTask DeleteDeploymentAsync(bool isAsync, string deploym private static BinaryContent ToJsonContent(T value) { Utf8JsonBinaryContent content = new(); - JsonSerializer.Serialize(content.JsonWriter, value, typeof(T), JsonHelpers.AzureJsonOptions); + JsonSerializer.Serialize(content.JsonWriter, value, typeof(T), JsonOptions.AzureJsonOptions); return content; } @@ -160,10 +159,10 @@ private static void ThrowOnFailed(PipelineResponse response) if (response.IsError) { if (response.Content != null - && response.Headers.GetFirstValueOrDefault("Content-Type")?.StartsWith("application/json") == true) + && response.Headers.GetFirstOrDefault("Content-Type")?.StartsWith("application/json") == true) { using Stream errorStream = response.Content.ToStream(); - ErrorInfo? error = JsonHelpers.Deserialize(errorStream, JsonHelpers.AzureJsonOptions); + ErrorInfo? error = JsonHelpers.Deserialize(errorStream, JsonOptions.AzureJsonOptions); if (error?.Error != null) { throw new ClientResultException($"[{response.Status} - {error.Error.Code}] {error.Error.Message}", response); @@ -179,7 +178,7 @@ private static T FromJsonContent(PipelineResponse response, CancellationToken ThrowOnFailed(response); using Stream stream = response.Content.ToStream(); - return JsonHelpers.Deserialize(stream, JsonHelpers.AzureJsonOptions) + return JsonHelpers.Deserialize(stream, JsonOptions.AzureJsonOptions) ?? throw new InvalidDataException("Service returned a null JSON response body"); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchObject.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchObject.cs index c9e2253d3c96..0c0e7d517f80 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchObject.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchObject.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Text.Json; using Azure.AI.OpenAI.Tests.Utils; @@ -13,7 +11,7 @@ public class BatchObject { public static BatchObject From(BinaryData data) { - return JsonSerializer.Deserialize(data, JsonHelpers.OpenAIJsonOptions) + return JsonSerializer.Deserialize(data, JsonOptions.OpenAIJsonOptions) ?? throw new InvalidOperationException("Response was null JSON"); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchOptions.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchOptions.cs index 4768ab3e2fb8..40a580370065 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchOptions.cs @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.Collections.Generic; using System.IO; using Azure.AI.OpenAI.Tests.Utils; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Models; @@ -21,7 +20,7 @@ public class BatchOptions public BinaryContent ToBinaryContent() { using MemoryStream stream = new MemoryStream(); - JsonHelpers.Serialize(stream, this, JsonHelpers.OpenAIJsonOptions); + JsonHelpers.Serialize(stream, this, JsonOptions.OpenAIJsonOptions); stream.Seek(0, SeekOrigin.Begin); var data = BinaryData.FromStream(stream); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs index c67b91d20e2b..9d36d8d1884a 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Models/BatchResult.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.IO; @@ -31,7 +29,7 @@ public static IReadOnlyList> From(BinaryData data) break; } - var entry = JsonSerializer.Deserialize>(line, JsonHelpers.OpenAIJsonOptions); + var entry = JsonSerializer.Deserialize>(line, JsonOptions.OpenAIJsonOptions); if (entry != null) { list.Add(entry); diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Models/FineTuningOptions.cs b/sdk/openai/Azure.AI.OpenAI/tests/Models/FineTuningOptions.cs index d40abfa12dc0..4c44995f81b6 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Models/FineTuningOptions.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Models/FineTuningOptions.cs @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System.ClientModel; using System.IO; using Azure.AI.OpenAI.Tests.Utils; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Models; @@ -20,7 +19,7 @@ public class FineTuningOptions public BinaryContent ToBinaryContent() { MemoryStream stream = new(); - JsonHelpers.Serialize(stream, this, JsonHelpers.OpenAIJsonOptions); + JsonHelpers.Serialize(stream, this, JsonOptions.OpenAIJsonOptions); stream.Seek(0, SeekOrigin.Begin); return BinaryContent.Create(stream); } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs index ba3aa156badd..a4ebb8fc1b77 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Samples/00_ClientConfiguration.cs @@ -4,14 +4,7 @@ #nullable disable using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.IO; -using System.Threading.Tasks; -using Azure.Core.Pipeline; -using Azure.Core.TestFramework; using Azure.Identity; -using OpenAI.Audio; using OpenAI.Chat; namespace Azure.AI.OpenAI.Samples; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs b/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs index 6bb3a27872fa..3ad7584e5551 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Samples/01_Chat.cs @@ -5,15 +5,10 @@ using System; using System.ClientModel; -using System.ClientModel.Primitives; using System.Collections.Generic; -using System.IO; using System.Text; using System.Text.Json; -using System.Threading.Tasks; -using Azure.Core.TestFramework; using Azure.Identity; -using OpenAI.Audio; using OpenAI.Chat; namespace Azure.AI.OpenAI.Samples; @@ -51,7 +46,7 @@ public void StreamingChat() new DefaultAzureCredential()); ChatClient chatClient = azureClient.GetChatClient("my-gpt-35-turbo-deployment"); - ResultCollection completionUpdates = chatClient.CompleteChatStreaming( + CollectionResult completionUpdates = chatClient.CompleteChatStreaming( [ new SystemChatMessage("You are a helpful assistant that talks like a pirate."), new UserChatMessage("Hi, can you help me?"), diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Samples/02_Oyd.cs b/sdk/openai/Azure.AI.OpenAI/tests/Samples/02_Oyd.cs index 1537703f7ba6..1f1a85d69e59 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Samples/02_Oyd.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Samples/02_Oyd.cs @@ -4,17 +4,8 @@ #nullable disable using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Text.Json; -using System.Threading.Tasks; using Azure.AI.OpenAI.Chat; -using Azure.Core.TestFramework; using Azure.Identity; -using OpenAI.Audio; using OpenAI.Chat; namespace Azure.AI.OpenAI.Samples; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs index 6dcbb9a1d5c1..70c178dd271c 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestBase.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.ClientModel; using System.ClientModel.Primitives; @@ -11,13 +9,10 @@ using System.Linq; using System.Text; using System.Text.Json; -using System.Threading; using System.Threading.Tasks; using Azure.AI.OpenAI.Tests.Models; using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.Core.TestFramework; -using Azure.Core.TestFramework.Models; using NUnit.Framework.Interfaces; using OpenAI.Assistants; using OpenAI.Audio; @@ -27,17 +22,21 @@ using OpenAI.Files; using OpenAI.FineTuning; using OpenAI.Images; -using OpenAI.Tests; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.Proxy.Service; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Recording.Sanitizers; +using OpenAI.TestFramework.Utils; using OpenAI.VectorStores; -using RetryMode = Azure.Core.RetryMode; -using RetryOptions = Azure.Core.RetryOptions; using TokenCredential = Azure.Core.TokenCredential; namespace Azure.AI.OpenAI.Tests; -public class AoaiTestBase : RecordedTestBase +public class AoaiTestBase : RecordedClientTestBase where TClient : class { private const string AZURE_URI_SANITIZER_PATTERN = @"(?<=/(subscriptions|resourceGroups|accounts)/)([^/]+?)(?=(/|$))"; + private const string SMALL_1x1_PNG = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAFiQAABYkAZsVxhQAAAAMSURBVBhXY2BgYAAAAAQAAVzN/2kAAAAASUVORK5CYII="; public static readonly DateTimeOffset START_2024 = new DateTimeOffset(2024, 01, 01, 00, 00, 00, TimeSpan.Zero); public static readonly DateTimeOffset UNIX_EPOCH = @@ -48,59 +47,92 @@ public class AoaiTestBase : RecordedTestBase #endif internal TestConfig TestConfig { get; } + internal Assets Assets { get; } - internal DisableRecordingInterceptor RecordingDisabler { get; } + + public AzureTestEnvironment TestEnvironment { get; } + + protected AoaiTestBase(bool isAsync) : this(isAsync, null) + { } protected AoaiTestBase(bool isAsync, RecordedTestMode? mode = null) : base(isAsync, mode) { TestConfig = new TestConfig(Mode); - Assets = new Assets(TestEnvironment); + Assets = new Assets(); + TestEnvironment = new AzureTestEnvironment(Mode); + + // Remove some of the default sanitizers to customize their behaviour + RecordingOptions.SanitizersToRemove.AddRange( + [ + "AZSDK2003", // Location header (we use a less restrictive sanitizer) + "AZSDK4001", // Replaces entire host name in URL. We want to mask only subdomain part to make it easier to distinguish requests + "AZSDK3430", // OpenAI liberally uses "id" in its JSON responses, and we want to keep them in the recordings + "AZSDK3493", // $..name in JSON. OpenAI uses this for things that don't need to be sanitized + ]); + + // Prevent resource names from leaking into recordings + RecordingOptions.Sanitizers.AddRange( + [ + new UriRegexSanitizer(SanitizedJsonConfig.HOST_SUBDOMAIN_PATTERN) + { + Value = SanitizedJsonConfig.MASK_STRING + }, + new UriRegexSanitizer(AZURE_URI_SANITIZER_PATTERN) + { + Value = SanitizedJsonConfig.MASK_STRING + }, + new HeaderRegexSanitizer("Location") + { + Regex = AZURE_URI_SANITIZER_PATTERN, + Value = SanitizedJsonConfig.MASK_STRING + }, + new HeaderRegexSanitizer("Azure-AsyncOperation") + { + Regex = AZURE_URI_SANITIZER_PATTERN, + Value = SanitizedJsonConfig.MASK_STRING + }, + new BodyKeySanitizer("$..endpoint") + { + Regex = SanitizedJsonConfig.HOST_SUBDOMAIN_PATTERN, + Value = SanitizedJsonConfig.MASK_STRING + } + ]); - // Disable additional fluff that is causing issues - TestDiagnostics = false; + // Prevent keys from leaking into our recordings + RecordingOptions.SanitizeJsonBody("*..key", "*..api_key"); - // Add sanitizers to prevent resource names from leaking into recordings - UriRegexSanitizers.Add(new UriRegexSanitizer(SanitizedJsonConfig.HOST_SUBDOMAIN_PATTERN) + // Because the current implementation of multi-part form content data in OpenAI and Azure OpenAI uses random + // to generate boundaries, this causes problems during playback as the boundary will be different each time. + // Longer term, we should find a way to pass the TestRecording.Random to the multi-part form generator in the + // code. The simplest solution for now is to disable recording the body for these mime types + RecordingOptions.RequestOverride = request => { - Value = SanitizedJsonConfig.MASK_STRING - }); - UriRegexSanitizers.Add(new UriRegexSanitizer(AZURE_URI_SANITIZER_PATTERN) - { - Value = SanitizedJsonConfig.MASK_STRING - }); - HeaderRegexSanitizers.Add(new HeaderRegexSanitizer("Azure-AsyncOperation") - { - Regex = AZURE_URI_SANITIZER_PATTERN, - Value = SanitizedJsonConfig.MASK_STRING - }); - HeaderRegexSanitizers.Add(new HeaderRegexSanitizer("Location") + if (request?.Headers.GetFirstOrDefault("Content-Type")?.StartsWith("multipart/form-data") == true) + { + return RequestRecordMode.RecordWithoutRequestBody; + } + + return RequestRecordMode.Record; + }; + RecordingOptions.Sanitizers.Add(new HeaderRegexSanitizer("Content-Type") { - Regex = AZURE_URI_SANITIZER_PATTERN, - Value = SanitizedJsonConfig.MASK_STRING + Regex = @"multipart/form-data; boundary=[^\s]+", + Value = "multipart/form-data; boundary=***" }); - BodyKeySanitizers.Add(new BodyKeySanitizer("$..endpoint") + + // Data URIs trimmed to prevent the recording from being too large + RecordingOptions.Sanitizers.Add(new BodyKeySanitizer("$..url") { - Regex = SanitizedJsonConfig.HOST_SUBDOMAIN_PATTERN, - Value = SanitizedJsonConfig.MASK_STRING + Regex = @"(?<=data:image/png;base64,)(.+)", + Value = SMALL_1x1_PNG }); - BodyKeySanitizers.Add(new BodyKeySanitizer("$..id") + + // Base64 encoded images in the response are replaced with a 1x1 black pixel PNG image to ensure valid data + RecordingOptions.Sanitizers.Add(new BodyKeySanitizer($"..b64_json") { - Regex = AZURE_URI_SANITIZER_PATTERN, - Value = SanitizedJsonConfig.MASK_STRING + Value = SMALL_1x1_PNG }); - - // Add sanitizers to prevent our keys from leaking into the recordings - JsonPathSanitizers.Add("*..key"); - JsonPathSanitizers.Add("*..api_key"); - - // Multi-part form data gives the test-proxy that is used for recording and playback indigestion (it always thinks it needs - // to re-record the test on playback). So let's add an interceptor that will automatically disable body recording for specific - // client methods calls, and then re-enable it afterwards. - RecordingDisabler = new(() => Recording); - RecordingDisabler.DisableBodyRecordingFor(nameof(FileClient.UploadFileAsync)); - - IgnoredHeaders.Add("x-ms-client-request-id"); } /// @@ -137,45 +169,7 @@ public virtual AzureOpenAIClient GetTestTopLevelClient( Action? responseAction = options.ShouldOutputResponses ? DumpResponse : null; options.AddPolicy(new TestPipelinePolicy(requestAction, responseAction), PipelinePosition.PerCall); - // If we are in playback, or record mode we should set the transport to the test proxy transport, except - // in the case where we've explicitly specified the transport ourselves. There are cases where we use a - // mock pipeline and we don't want those to go to the test proxy. - if (options.Transport == null) - { - // TODO FIXME update once test framework code is updated - /* NOTE: - * Normally we would call the base class RecordedTestBase.InstrumentClientOptions. Unfortunately this doesn't - * currently work since the test framework still relies on a version of Azure.Core that has not been updated - * to use the new System.ClientModel types. Thus InstrumentClientOptions expects a type that inherits from - * Azure.Core.ClientOptions, whereas we inherit from System.ClientModel.Primitives.ClientPipelineOptions. For - * now we duplicate the code from InstrumentClientOptions here - */ - - if (Mode == RecordedTestMode.Playback) - { - // You guessed it: the constructor for RetryOptions is internal only. So plan B: - RetryOptions retryOpt = (RetryOptions)Activator.CreateInstance(typeof(RetryOptions), true)!; - - // Not making the timeout zero so retry code still goes async - retryOpt.Delay = TimeSpan.FromMilliseconds(10); - retryOpt.Mode = RetryMode.Fixed; - - options.RetryPolicy = new Utils.Pipeline.ClientRetryPolicyAdapter(retryOpt); - } - - // No need to set the transport if we are in Live mode - if (Mode != RecordedTestMode.Live) - { - // Wait what's this? More private or internal only things I need access to? - var proxyAccess = NonPublic.FromField("_proxy"); - var disableRecordingAccess = NonPublic.FromField>("_disableRecording"); - - options.Transport = new Utils.Pipeline.ProxyTransport( - proxyAccess.Get(this), - Recording, - () => disableRecordingAccess.Get(Recording).Value); - } - } + options = ConfigureClientOptions(options); AzureOpenAIClient topLevelClient; if (tokenCredential != null) @@ -225,7 +219,7 @@ public virtual TClient GetTestClient(string configName, TestClientOptions? optio /// The client instance passed was not instrumented public virtual TExplicitClient GetTestClientFrom(TClient client, string? deploymentName = null) { - AzureOpenAiInstrumented? instrumented = _clientToTopLevel.FirstOrDefault(e => ReferenceEquals(client, e.Client)); + var instrumented = (TopLevelInfo?)GetClientContext(client); if (instrumented?.TopLevelClient != null && instrumented?.Config != null) { @@ -236,12 +230,66 @@ public virtual TExplicitClient GetTestClientFrom(TClient client "instances using the GetTestClient() methods"); } - /// - /// Disables the recording of request bodies for the specified method in the current client. - /// - /// The method name. - public virtual void DisableRequestBodyRecording(string methodName) - => RecordingDisabler.DisableBodyRecordingFor(methodName); + #region overrides + + /// + protected override RecordedTestMode GetDefaultRecordedTestMode() + => AzureTestEnvironment.DefaultRecordMode; + + /// + protected override ProxyServiceOptions CreateProxyServiceOptions() + => new() + { + DotnetExecutable = TestEnvironment.DotNetExe.FullName, + TestProxyDll = TestEnvironment.TestProxyDll.FullName, + DevCertFile = TestEnvironment.TestProxyHttpsCert.FullName, + DevCertPassword = TestEnvironment.TestProxyHttpsCertPassword, + StorageLocationDir = TestEnvironment.RepoRoot.FullName, + }; + + /// + protected override RecordingStartInformation CreateRecordingSessionStartInfo() + { + // This uses the same directory structure as the previous Azure.Core.TestFramework used for an easy drop in replacement. + // For example, suppose your test class is (and your class name matches the file name): + // c:\src\azure-sdk-for-net\sdk\openai\Azure.AI.OpenAI\tests\ChatTests.cs + // Then this would return something like: + // sdk\openai\Azure.AI.OpenAI\tests\SessionRecords\ChatTests\TestName.json + DirectoryInfo? sourceDir = GetType().Assembly.GetAssemblySourceDir(); + string relativeDir = PathHelpers.GetRelativePath( + TestEnvironment.RepoRoot.FullName, + sourceDir?.FullName ?? TestEnvironment.RepoRoot.FullName); + + string recordingFile = Path.Combine( + relativeDir, + "SessionRecords", + GetType().Name, + GetRecordedTestFileName()); + + // Start at the source directory for the current test project, and then walk up the directory structure searching for + // an "assets.json" file. + string? assetsFile = null; + for ( + DirectoryInfo? current = sourceDir; + current != null && current.FullName != TestEnvironment.RepoRoot.FullName; + current = current?.Parent) + { + string file = Path.Combine(current!.FullName, "assets.json"); + if (File.Exists(file)) + { + assetsFile = file; + break; + } + } + + return new() + { + RecordingFile = recordingFile, + AssetsFile = assetsFile + }; + } + + #endregion /// /// Polls until a condition has been met with a maximum wait time. The function will always return the last value even @@ -368,15 +416,15 @@ protected virtual TExplicitClient GetTestClient(AzureOpenAIClie throw new NotImplementedException($"Test client helpers not yet implemented for {typeof(TExplicitClient)}"); }; - object instrumented = InstrumentClient(typeof(TExplicitClient), clientObject, [RecordingDisabler]); - - // Keep track of the corresponding top level client and config - _clientToTopLevel.Add(new AzureOpenAiInstrumented - { - Client = instrumented, - TopLevelClient = topLevelClient, - Config = config, - }); + object instrumented = WrapClient( + typeof(TExplicitClient), + clientObject, + new TopLevelInfo + { + TopLevelClient = topLevelClient, + Config = config, + }, + null); return (TExplicitClient)instrumented; } @@ -403,7 +451,7 @@ private static void DumpRequest(PipelineRequest request) request.Content.WriteTo(stream, default); stream.Position = 0; - string? contentType = request.Headers.GetFirstValueOrDefault("Content-Type"); + string? contentType = request.Headers.GetFirstOrDefault("Content-Type"); if (IsProbableTextContent(contentType)) { DumpText(contentType, stream); @@ -432,7 +480,7 @@ private static void DumpResponse(PipelineResponse response) if (response!.Content is not null) { using Stream stream = response.Content.ToStream(); - string? contentType = response.Headers.GetFirstValueOrDefault("Content-Type"); + string? contentType = response.Headers.GetFirstOrDefault("Content-Type"); if (IsProbableTextContent(contentType)) { DumpText(contentType, stream); @@ -639,7 +687,7 @@ protected static PipelineResponse ValidateClientResultResponse(ClientResult resu PipelineResponse response = result.GetRawResponse(); Assert.That(response.Status, Is.GreaterThanOrEqualTo(200).And.LessThan(300)); Assert.That(response.Headers, Is.Not.Null); - Assert.That(response.Headers.GetFirstValueOrDefault("Content-Type"), Does.StartWith("application/json")); + Assert.That(response.Headers.GetFirstOrDefault("Content-Type"), Does.StartWith("application/json")); Assert.That(response.Content, Is.Not.Null); return response; @@ -661,64 +709,14 @@ protected virtual TModel ValidateAndParse(ClientResult result, JsonSeria using Stream stream = response.Content.ToStream(); Assert.That(stream, Is.Not.Null); - TModel? model = JsonHelpers.Deserialize(stream, options ?? JsonHelpers.OpenAIJsonOptions); + TModel? model = JsonHelpers.Deserialize(stream, options ?? JsonOptions.OpenAIJsonOptions); Assert.That(model, Is.Not.Null); return model!; } - protected AsyncResultCollection SyncOrAsync(TClient client, Func> sync, Func> async) - { - // TODO FIXME HACK Since the test framework doesn't currently support async result collection, this methods provides - // a simplified way to make explicit calls to the right methods in tests - TClient rawClient = GetOriginal(client); - - if (IsAsync) - { - return async(rawClient); - } - else - { - ResultCollection syncCollection = sync(rawClient); - return new SyncToAsyncResultCollection(syncCollection); - } - } - - protected AsyncPageableCollection SyncOrAsync(TClient client, Func> sync, Func> async) - { - // TODO FIXME HACK Since the test framework doesn't currently support async result collection, this methods provides - // a simplified way to make explicit calls to the right methods in tests - TClient rawClient = GetOriginal(client); - - if (IsAsync) - { - return async(rawClient); - } - else - { - PageableCollection syncCollection = sync(rawClient); - return new SyncToAsyncPageableCollection(syncCollection); - } - } - - protected Task> SyncOrAsyncList(TClient client, Func> sync, Func> async) - { - // TODO FIXME HACK Since the test framework doesn't currently support async result collection, this methods provides - // a simplified way to make explicit calls to the right methods in tests - TClient rawClient = GetOriginal(client); - - if (IsAsync) - { - return async(rawClient).ToEnumerableAsync(); - } - else - { - return Task.FromResult(sync(rawClient).ToList()); - } - } - - internal class AzureOpenAiInstrumented + internal class TopLevelInfo { - required public object Client { get; init; } + //required public object Client { get; init; } required public AzureOpenAIClient TopLevelClient { get; init; } required public IConfiguration Config { get; init; } } @@ -729,7 +727,6 @@ internal class AzureOpenAiInstrumented private readonly List _fileIdsToDelete = []; private readonly List<(string, string)> _vectorStoreFileAssociationsToRemove = []; private readonly List _vectorStoreIdsToDelete = []; - internal readonly List _clientToTopLevel = new(); } public class TestClientOptions : AzureOpenAIClientOptions diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestEnvironment.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestEnvironment.cs deleted file mode 100644 index 972149209692..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AoaiTestEnvironment.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable disable - -using Azure.Core.TestFramework; -using OpenAI.Assistants; -using OpenAI.Audio; -using OpenAI.Batch; -using OpenAI.Chat; -using OpenAI.Embeddings; -using OpenAI.Files; -using OpenAI.FineTuning; -using OpenAI.Images; -using OpenAI.VectorStores; -using System; -using System.ClientModel; -using System.Collections.Generic; -using System.IO; - -namespace Azure.AI.OpenAI.Tests; - -public partial class AoaiTestEnvironment : TestEnvironment -{ -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs index 617041f9eec9..15590bc9cca6 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Assets.cs @@ -1,16 +1,15 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.IO; -using Azure.Core.TestFramework; namespace Azure.AI.OpenAI.Tests { - internal class Assets + public class Assets { - private readonly TestEnvironment _env; - - public Assets(TestEnvironment env) + public Assets() { - _env = env ?? throw new ArgumentNullException(nameof(env)); HelloWorld = new() { Type = AssetType.Audio, @@ -61,7 +60,7 @@ protected virtual string GetPath(string assetName) } } - internal enum AssetType + public enum AssetType { Text, Audio, @@ -69,14 +68,14 @@ internal enum AssetType Raw } - internal class AssetInfo + public class AssetInfo { - public AssetType Type { get; init; } - public string Language { get; init; } - public string Name { get; init; } - public string RelativePath { get; init; } - public string Description { get; init; } - public string MimeType { get; init; } - public Uri Url { get; init; } + required public AssetType Type { get; init; } + required public string Name { get; init; } + required public string RelativePath { get; init; } + required public string MimeType { get; init; } + public string? Language { get; init; } + public string? Description { get; init; } + public Uri? Url { get; init; } } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/AzureTestEnvironment.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AzureTestEnvironment.cs new file mode 100644 index 000000000000..a7407e09ae91 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/AzureTestEnvironment.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Linq; +using System.Reflection; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Mocks; +using OpenAI.TestFramework.Recording; +using OpenAI.TestFramework.Utils; + +namespace Azure.AI.OpenAI.Tests.Utils; + +/// +/// Represents an Azure test environment. +/// +public class AzureTestEnvironment +{ + private readonly RecordedTestMode _mode; + private readonly string _optionPrefix; + private TokenCredential? _credential; + + /// + /// Initializes a new instance. + /// + /// The recorded test mode to use. + public AzureTestEnvironment(RecordedTestMode mode) + { + _mode = mode; + + RepoRoot = FindRepoRoot(); + + DotNetExe = AssemblyHelper.GetDotnetExecutable() + ?? throw new InvalidOperationException( + "Could not determine the dotnet executable to use. Do you have .Net installed or have your paths correctly configured?"); + + TestProxyDll = new FileInfo( + AssemblyHelper.GetAssemblyMetadata("TestProxyPath") + ?? throw new InvalidOperationException("Could not determine the path to the recording test proxy DLL")); + + TestProxyHttpsCert = new FileInfo(Path.Combine( + RepoRoot.FullName, + "eng", + "common", + "testproxy", + "dotnet-devcert.pfx")); + if (!TestProxyHttpsCert.Exists) + { + throw new InvalidOperationException("Could not find test proxy HTTPS root certificate to use."); + } + + TestProxyHttpsCertPassword = "password"; + + string? serviceName = null; + DirectoryInfo? sourceDir = GetType().Assembly.GetAssemblySourceDir(); + if (sourceDir != null) + { + string relativePath = PathHelpers.GetRelativePath( + Path.Combine(RepoRoot.FullName, "sdk"), + sourceDir.FullName); + serviceName = relativePath + .Split(new char[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault()!; + } + + _optionPrefix = serviceName?.ToUpperInvariant() + "_"; + } + + /// + /// Gets the root Git folder. + /// + public DirectoryInfo RepoRoot { get; } + + /// + /// Gets the path to the dotnet executable. This will be used in combination with to start the + /// recording test proxy service. + /// + public FileInfo DotNetExe { get; } + + /// + /// The path to test proxy DLL that will be used when starting the recording test proxy service. + /// + public FileInfo TestProxyDll { get; } + + /// + /// Gets the HTTPS certificate file to use as the signing certificate for HTTPS connections to the test proxy. + /// + public FileInfo TestProxyHttpsCert { get; } + + /// + /// Gets the password for . + /// + public string TestProxyHttpsCertPassword { get; } + + /// + /// Gets the token credential to use during testing. This will change depending on the record mode. + /// + public TokenCredential Credential => _credential ??= GetCredential(); + + /// + /// Gets the default record mode to use for the test. This will attempt to read from the test context, or environment variables. + /// + public static RecordedTestMode DefaultRecordMode + { + get + { + string? modeString = TestContext.Parameters["TestMode"] + ?? Environment.GetEnvironmentVariable("AZURE_TEST_MODE"); + + if (Enum.TryParse(modeString, true, out RecordedTestMode mode)) + { + return mode; + } + + return RecordedTestMode.Playback; + } + } + + /// + /// Gets an optional value from environment variables. + /// + /// The name of the value to retrieve. + /// The value, or null if it did not exist. + public string? GetOptionalVariable(string name) + { + return new[] + { + _optionPrefix + name, + name, + "AZURE_" + name + } + .Select(Environment.GetEnvironmentVariable) + .FirstOrDefault(value => !string.IsNullOrWhiteSpace(value)); + } + + /// + /// Gets a value from environment variables, or throws an exception if it does not exist. + /// + /// The name of the value to retrieve. + /// The value. + /// If the value did not exist. + public string GetVariable(string name) + { + string? optionalVariable = GetOptionalVariable(name); + return optionalVariable + ?? throw new InvalidOperationException($"Could not find required environment variable '{_optionPrefix + name }' or '{name}'."); + } + + /// + /// Finds the root directory of the Git repository. + /// + /// The root directory of the Git repository. + private static DirectoryInfo FindRepoRoot() + { + /** + * We want to find the folder that is the Git repository root folder. We do this by searching for a directory that contains + * a .git subfolder. + * + * We search up for the .git subfolder from two starting locations: + * - Check the "SourcePath" assembly metadata attribute value. All projects in the Azure C# repo automatically have this attribute + * added as part of the build "magic" (see {repo_root}\Directory.Build.Targets) + * - Where the executing assembly is running from + * + * Side note: an entirely different way to do this would be call: git rev-parse --show-toplevel + */ + + DirectoryInfo?[] startingPoints = + [ + AssemblyHelper.GetAssemblySourceDir(), + new FileInfo(Assembly.GetExecutingAssembly().Location).Directory, + ]; + + foreach (DirectoryInfo? dir in startingPoints) + { + if (dir?.Exists != true) + { + continue; + } + + for (var d = dir; d != null; d = d.Parent) + { + if (d.EnumerateDirectories(".git").Any()) + { + return d; + } + } + } + + throw new InvalidOperationException("Could not determine the root folder for this repository"); + } + + private TokenCredential GetCredential() + { + if (_mode == RecordedTestMode.Playback) + { + return new MockTokenCredential(); + } + + // I'm not sure exactly what the possible combinations to use here are, so I've essentially copied the logic + // TestEnvironment.cs in Azure.Core.TestFramework (though it is a little simplified here) + string? clientSecret = GetOptionalVariable("CLIENT_SECRET"); + string? systemAccessToken = GetOptionalVariable("SYSTEM_ACCESSTOKEN"); + + if (!string.IsNullOrWhiteSpace(clientSecret)) + { + return new ClientSecretCredential( + GetVariable("TENANT_ID"), + GetVariable("CLIENT_ID"), + clientSecret); + } + else if (!string.IsNullOrWhiteSpace(systemAccessToken)) + { + return new AzurePipelinesCredential( + GetVariable("AZURESUBSCRIPTION_TENANT_ID"), + GetVariable("AZURESUBSCRIPTION_CLIENT_ID"), + GetVariable("AZURESUBSCRIPTION_SERVICE_CONNECTION_ID"), + systemAccessToken, + new AzurePipelinesCredentialOptions { AuthorityHost = new Uri(GetVariable("AZURE_AUTHORITY_HOST")) }); + } + else + { + return new DefaultAzureCredential( + new DefaultAzureCredentialOptions() { ExcludeManagedIdentityCredential = true }); + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/FlattenedConfig.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/FlattenedConfig.cs index c0b4025edbab..205a5d072e66 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/FlattenedConfig.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/FlattenedConfig.cs @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.Linq; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Utils.Config; diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/IConfiguration.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/IConfiguration.cs index 1da15c4c85c3..97511d548e68 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/IConfiguration.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/IConfiguration.cs @@ -1,12 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; -using System.Linq; -using NUnit.Framework.Internal; +using OpenAI.TestFramework.AutoSyncAsync; namespace Azure.AI.OpenAI.Tests.Utils.Config; @@ -82,9 +79,9 @@ public static TVal GetValueOrThrow(this IConfiguration? config, string key /// The client instance. /// The configuration. /// The client did not have a config associated with it. - public static IConfiguration GetConfigOrThrow(this TExplicitClient client) + public static IConfiguration GetConfigOrThrow(this TExplicitClient client) where TExplicitClient : class { - var instrumented = GetInstrumentedData(client); + var instrumented = GetTopLevelClientInfo(client); return instrumented.Config ?? throw new ArgumentException("The client was instrumented with a null configuration"); } @@ -110,31 +107,23 @@ public static string DeploymentOrThrow(this IConfiguration? config, string? clie /// The deployment name used for that client instance. /// The client either was not properly instrumented. /// The client did not have a deployment configured. - public static string DeploymentOrThrow(this TExplicitClient client) + public static string DeploymentOrThrow(this TExplicitClient client) where TExplicitClient : class { - var instrumented = GetInstrumentedData(client); + var instrumented = GetTopLevelClientInfo(client); return instrumented.Config.DeploymentOrThrow(client!.GetType().Name); } - private static AoaiTestBase.AzureOpenAiInstrumented GetInstrumentedData(TExplicitClient? client) + private static AoaiTestBase.TopLevelInfo GetTopLevelClientInfo(TExplicitClient? client) + where TExplicitClient : class { if (client == null) { throw new ArgumentNullException(nameof(client)); } - var testBase = TestExecutionContext.CurrentContext?.TestObject as AoaiTestBase; - if (testBase == null) - { - throw new InvalidOperationException("You are not currently in a NUnit test class that extends " + nameof(AoaiTestBase)); - } - - var instrumented = testBase._clientToTopLevel.FirstOrDefault(e => ReferenceEquals(client, e.Client)); - if (instrumented == null) - { - throw new ArgumentException($"The client was not properly instrumented ({client.GetType().Name})", nameof(client)); - } - - return instrumented; + return ((AoaiTestBase.TopLevelInfo?)(client as IAutoSyncAsync)?.Context) + ?? throw new ArgumentException( + $"The client was not properly wrapped for automatic sync/async ({client.GetType().Name})", + nameof(client)); } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/JsonConfig.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/JsonConfig.cs index 9db3eb5e74f2..e7334b11fe8c 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/JsonConfig.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/JsonConfig.cs @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Utils.Config; @@ -26,9 +25,10 @@ public class JsonConfig : IConfiguration public static readonly JsonSerializerOptions JSON_OPTIONS = new() { PropertyNameCaseInsensitive = true, - PropertyNamingPolicy = JsonHelpers.SnakeCaseLower, - DictionaryKeyPolicy = JsonHelpers.SnakeCaseLower, + PropertyNamingPolicy = JsonOptions.SnakeCaseLower, + DictionaryKeyPolicy = JsonOptions.SnakeCaseLower, WriteIndented = true, + AllowTrailingCommas = true, #if NETFRAMEWORK IgnoreNullValues = true, #else diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/SanitizedJsonConfig.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/SanitizedJsonConfig.cs index 4d7450d5cf2a..54e111aa7f8c 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/SanitizedJsonConfig.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Config/SanitizedJsonConfig.cs @@ -1,14 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Text.Json; using System.Text.Json.Serialization; using System.Text.RegularExpressions; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests.Utils.Config { diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/DisableRecordingInterceptor.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/DisableRecordingInterceptor.cs deleted file mode 100644 index 61508161c66a..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/DisableRecordingInterceptor.cs +++ /dev/null @@ -1,77 +0,0 @@ -#nullable enable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core.TestFramework; -using Castle.DynamicProxy; - -namespace Azure.AI.OpenAI.Tests.Utils -{ - public class DisableRecordingInterceptor : IInterceptor - { - private const string AsyncSuffix = "Async"; - private readonly List> _entries = new(); - private readonly Func _getRecording; - - public DisableRecordingInterceptor(Func getRecording) - { - _getRecording = getRecording ?? throw new ArgumentNullException(nameof(getRecording)); - } - - public TestRecording? Recording => _getRecording(); - - public void DisableBodyRecordingFor(string methodName) - { - _entries.Add(new(typeof(TClient), NormalizeMethodName(methodName), EntryRecordModel.RecordWithoutRequestBody)); - } - - public void DisableRecordingFor(string methodName) - { - _entries.Add(new(typeof(TClient), NormalizeMethodName(methodName), EntryRecordModel.RecordWithoutRequestBody)); - } - - public void Intercept(IInvocation invocation) - { - if (_entries.Count == 0) - { - invocation.Proceed(); - return; - } - - IDisposable? scoped = null; - try - { - string normalizedName = NormalizeMethodName(invocation.Method.Name); - var entry = _entries.FirstOrDefault(e => - e.Item1.IsAssignableFrom(invocation.TargetType) - && e.Item2 == normalizedName); - if (entry != null) - { - scoped = new TestRecording.DisableRecordingScope(Recording, entry.Item3); - } - - invocation.Proceed(); - } - finally - { - scoped?.Dispose(); - } - } - - private static string NormalizeMethodName(string methodName) - { - if (string.IsNullOrWhiteSpace(methodName)) - { - throw new ArgumentException("Method name cannot be null, empty, or white space.", nameof(methodName)); - } - - if (methodName.EndsWith(AsyncSuffix)) - { - return methodName.Substring(0, methodName.Length - AsyncSuffix.Length); - } - - return methodName; - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Extensions.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Extensions.cs index 14268277590d..d25ef06b30cd 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Extensions.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Extensions.cs @@ -1,155 +1,68 @@ -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.IO; -using System.Linq; using System.Text; -using System.Threading.Tasks; -#nullable enable +namespace Azure.AI.OpenAI.Tests.Utils; -namespace Azure.AI.OpenAI.Tests +/// +/// Helper extension methods. +/// +public static class Extensions { - internal static class Extensions + /// + /// Attempts to fill the buffer as much as possible from a stream. This will try to keep reading + /// until the buffer is filled, or the stream ends. + /// + /// The stream to read from. + /// The buffer to try to fill. + /// The number of bytes read. + public static int FillBuffer(this Stream stream, byte[] buffer) { -#if NETFRAMEWORK - public static TValue? GetValueOrDefault(this IReadOnlyDictionary dictionary, TKey key) - => GetValueOrDefault(dictionary, key, default(TValue)!); + if (stream == null) + throw new ArgumentNullException(nameof(stream)); + else if (buffer == null) + throw new ArgumentNullException(nameof(buffer)); - public static TValue GetValueOrDefault(this IReadOnlyDictionary dictionary, TKey key, TValue defaultValue) + int totalRead = 0; + while (totalRead < buffer.Length) { - if (dictionary == null) - { - throw new ArgumentNullException(nameof(dictionary)); - } - - if (!dictionary.TryGetValue(key, out TValue? value)) + int read = stream.Read(buffer, totalRead, buffer.Length - totalRead); + if (read == 0) { - return defaultValue; + return totalRead; } - return value; + totalRead += read; } -#endif - - public static TValue? GetValueOrDefault(this IDictionary dictionary, TKey key) - => GetValueOrDefault(dictionary, key, default!); - - public static TValue? GetValueOrDefault(this IDictionary dictionary, TKey key, TValue defaultValue) - { - if (dictionary == null) - { - throw new ArgumentNullException(nameof(dictionary)); - } - - if (!dictionary.TryGetValue(key, out TValue? value)) - { - return defaultValue; - } - - return value; - } - - public static TValue? GetValueOrDefault(this Dictionary dictionary, TKey key) where TKey : notnull - => ((IReadOnlyDictionary)dictionary).GetValueOrDefault(key); - - public static TValue? GetValueOrDefault(this Dictionary dictionary, TKey key, TValue defaultValue) where TKey : notnull - => ((IReadOnlyDictionary)dictionary).GetValueOrDefault(key, defaultValue); - - public static TValue GetOrAdd(this IDictionary dictionary, TKey key, Func valueFactory) - { - if (dictionary == null) - { - throw new ArgumentNullException(nameof(dictionary)); - } - - if (!dictionary.TryGetValue(key, out TValue? value)) - { - value = valueFactory(key); - dictionary[key] = value; - } - - return value!; - } - - public static string? GetFirstValueOrDefault(this PipelineRequestHeaders headers, string key) - { - IEnumerable? values = null; - if (key != null) - { - headers?.TryGetValues(key, out values); - } - return values?.FirstOrDefault(v => v != null) - ?? null; - } - - public static string? GetFirstValueOrDefault(this PipelineResponseHeaders headers, string key) - { - IEnumerable? values = null; - if (key != null) - { - headers?.TryGetValues(key, out values); - } - - return values?.FirstOrDefault(v => v != null) - ?? null; - } - - public static ValueTask FirstOrDefaultAsync(this IAsyncEnumerable enumerable) - => FirstOrDefaultAsync(enumerable, _ => true); - - public static async ValueTask FirstOrDefaultAsync(this IAsyncEnumerable enumerable, Predicate predicate) - { - await foreach (T item in enumerable) - { - if (predicate(item)) - { - return item; - } - } + return totalRead; + } - return default!; - } + /// + /// Pads the current instance with the specified character on the left. + /// + /// The string builder instance + /// The total width we want the string builder to be + /// The padding characters + /// The same builder for chaining, with any needed padding. + public static StringBuilder PadRight(this StringBuilder builder, int totalWidth, char paddingChar = ' ') + { + if (builder == null) + throw new ArgumentNullException(nameof(builder)); + else if (totalWidth < 0) + throw new ArgumentOutOfRangeException(nameof(totalWidth), "Total width must be greater than or equal to 0."); + else if (totalWidth == 0) + return builder; - public static int FillBuffer(this Stream stream, byte[] buffer) + int padding = totalWidth - builder.Length; + if (padding > 0) { - if (stream == null) - throw new ArgumentNullException(nameof(stream)); - else if (buffer == null) - throw new ArgumentNullException(nameof(buffer)); - - int totalRead = 0; - while (totalRead < buffer.Length) - { - int read = stream.Read(buffer, totalRead, buffer.Length - totalRead); - if (read == 0) - { - return totalRead; - } - - totalRead += read; - } - - return totalRead; + builder.Append(paddingChar, padding); } - public static StringBuilder PadRight(this StringBuilder builder, int totalWidth, char paddingChar = ' ') - { - if (builder == null) - throw new ArgumentNullException(nameof(builder)); - else if (totalWidth < 0) - throw new ArgumentOutOfRangeException(nameof(totalWidth), "Total width must be greater than or equal to 0."); - else if (totalWidth == 0) - return builder; - - int padding = totalWidth - builder.Length; - if (padding > 0) - { - builder.Append(paddingChar, padding); - } - - return builder; - } + return builder; } } diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonHelpers.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonOptions.cs similarity index 67% rename from sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonHelpers.cs rename to sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonOptions.cs index b77c646eae81..4489b016922a 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonHelpers.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/JsonOptions.cs @@ -1,7 +1,9 @@ -using System; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; using System.Buffers; using System.Globalization; -using System.IO; using System.Runtime.CompilerServices; using System.Text.Json; @@ -12,7 +14,7 @@ namespace Azure.AI.OpenAI.Tests.Utils; /// /// A helper class to make working with older versions of System.Text.Json simpler /// -internal static class JsonHelpers +public static class JsonOptions { // TODO FIXME once we update to newer versions of System.Text.JSon we should switch to using // JsonNamingPolicy.SnakeCaseLower @@ -46,80 +48,8 @@ internal static class JsonHelpers #endif }; - // TODO FIXME once we move to newer versions of System.Text.Json we can directly call - // JsonSerializer.Serialize(...) with a stream - public static void Serialize(Stream stream, T value, JsonSerializerOptions? options = null) - { -#if NETFRAMEWORK - using Utf8JsonWriter writer = new(stream, new JsonWriterOptions() - { - Encoder = options?.Encoder, - Indented = options?.WriteIndented == true, - SkipValidation = false - }); - - JsonSerializer.Serialize(writer, value, options); -#else - JsonSerializer.Serialize(stream, value, options); -#endif - } - -#if NET6_0_OR_GREATER - // .Net 6 and newer already have the extension method we need defined in JsonsSerializer -#else - // TODO FIXME once we move to newer versions of System.Text.Json we can directly use the - // JsonSerializer extension method for elements - public static T? Deserialize(this JsonElement element, JsonSerializerOptions? options = null) - { - using MemoryStream stream = new(); - using Utf8JsonWriter writer = new(stream, new() - { - Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, - Indented = false, - SkipValidation = true - }); - element.WriteTo(writer); - writer.Flush(); - - stream.Seek(0, SeekOrigin.Begin); - if (((ulong)stream.Length & 0xffffffff00000000) != 0ul) - { - throw new ArgumentOutOfRangeException("JsonElement is too large"); - } - - ReadOnlySpan span = new(stream.GetBuffer(), 0, (int)stream.Length); - return JsonSerializer.Deserialize(span, options); - } -#endif - - public static T? Deserialize(Stream stream, JsonSerializerOptions? options = null) - { -#if NETFRAMEWORK - // For now let's keep it simple and load entire JSON bytes into memory - using MemoryStream buffer = new(); - stream.CopyTo(buffer); - - ReadOnlySpan jsonBytes = buffer.GetBuffer().AsSpan(0, (int)buffer.Length); - return JsonSerializer.Deserialize(jsonBytes, options); -#else - return JsonSerializer.Deserialize(stream, options); -#endif - } - - public static JsonElement SerializeToElement(T value, JsonSerializerOptions? options = null) - { -#if NET6_0_OR_GREATER - return JsonSerializer.SerializeToElement(value, options); -#else - using MemoryStream stream = new(); - Serialize(stream, value, options); - stream.Seek(0, SeekOrigin.Begin); - return JsonDocument.Parse(stream).RootElement; -#endif - } - // Ported over from the source code for newer versions of System.Text.Json - internal class SnakeCaseNamingPolicy : JsonNamingPolicy + private class SnakeCaseNamingPolicy : JsonNamingPolicy { private enum SeparatorState { diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/MockTokenCredential.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/MockTokenCredential.cs new file mode 100644 index 000000000000..8615c0f07c00 --- /dev/null +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/MockTokenCredential.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// A mock token credential to be used for testing. +/// +public class MockTokenCredential : TokenCredential +{ + /// + /// Event raised when a token is requested. + /// + public event EventHandler? TokenRequested; + + /// + public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken) + { + TokenRequested?.Invoke(this, requestContext); + return new AccessToken("TEST TOKEN " + string.Join(",", requestContext.Scopes), DateTimeOffset.MaxValue); + } + + /// + public override ValueTask GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken) + { + return new(GetToken(requestContext, cancellationToken)); + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/CapturedMessage.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/CapturedMessage.cs deleted file mode 100644 index e03e7a16bfb4..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/CapturedMessage.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright(c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Http; - -namespace Azure.AI.OpenAI.Tests.Utils.Pipeline -{ - public abstract class CapturedMessage - { - public static readonly IReadOnlyDictionary> EMPTY = - new Dictionary>(); - - public IReadOnlyDictionary> Headers { get; init; } = EMPTY; - public BinaryData? Content { get; init; } - } - - public class CapturedResponse : CapturedMessage - { - public HttpStatusCode Status { get; init; } = HttpStatusCode.OK; - public string? ReasonPhrase { get; init; } = "OK"; - } - - public class CapturedRequest : CapturedMessage - { - public HttpMethod Method { get; init; } = HttpMethod.Get; - public Uri? Uri { get; init; } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ClientRetryPolicyAdapter.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ClientRetryPolicyAdapter.cs deleted file mode 100644 index 63588c544f7e..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ClientRetryPolicyAdapter.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.ClientModel.Primitives; -using System.Diagnostics; -using System.Reflection; -using System.Threading.Tasks; - -namespace Azure.AI.OpenAI.Tests.Utils.Pipeline; - -public class ClientRetryPolicyAdapter : ClientRetryPolicy -{ - private Func _getRetries; - - public ClientRetryPolicyAdapter(Core.RetryOptions options) - : base(options?.MaxRetries ?? 3) - { - Original = options ?? throw new ArgumentNullException(nameof(options)); - - // Of course, even reading the number of retries property on the PipelineMessage is internal only. - // So reflection it is - _getRetries = (Func) - (typeof(PipelineMessage).GetProperty("RetryCount", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance) - ?.GetGetMethod(true) - ?.CreateDelegate(typeof(Func)) - ?? throw new InvalidOperationException("Failed to get RetryCount property")); - } - - public Core.RetryOptions Original { get; } - - protected override TimeSpan GetNextDelay(PipelineMessage message, int tryCount) - { - TimeSpan delay = Original.Mode switch - { - Core.RetryMode.Fixed => Original.Delay, - Core.RetryMode.Exponential => TimeSpan.FromMilliseconds((1 << tryCount - 1) * Original.Delay.TotalMilliseconds), - _ => throw new InvalidOperationException("Unknown retry mode") - }; - - return delay <= Original.MaxDelay ? delay : Original.MaxDelay; - } - - protected override bool ShouldRetry(PipelineMessage message, Exception exception) - { - if (_getRetries(message) >= Original.MaxRetries) - { - return false; - } - - if (!message.ResponseClassifier.TryClassify(message, exception, out bool isRetriable) - && !PipelineMessageClassifier.Default.TryClassify(message, exception, out isRetriable)) - { - Debug.Assert(false, "Failed to classify message"); - } - - return isRetriable; - } - - protected override ValueTask ShouldRetryAsync(PipelineMessage message, Exception exception) - => new ValueTask(ShouldRetry(message, exception)); -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/MockPipeline.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/MockPipeline.cs deleted file mode 100644 index 11f60e5589d1..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/MockPipeline.cs +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright(c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Threading; -using System.Threading.Tasks; - -namespace Azure.AI.OpenAI.Tests.Utils.Pipeline -{ - /// - /// A pipeline that doesn't use the network. This captures all received requests, and allows you to specify a handler - /// that hand craft response messages. Can be useful for unit testing - /// - public class MockPipeline : IDisposable - { - public delegate CapturedResponse MessageHandlerAsyncDelegate(CapturedRequest request); - - private MessageHandlerAsyncDelegate _requestHandler; - private HttpClient _client; - private PipelineTransport _transport; - private List _requests; - private List _responses; - - /// - /// Creates a new instance - /// - /// (Optional) The handler to use to generate responses. Default returns an empty - /// response body with HTTP 204 - public MockPipeline(MessageHandlerAsyncDelegate? requestHandler = null) - { - _requestHandler = requestHandler ?? ReturnEmpty; - _client = new HttpClient(new DelegateMessageHandler(HandleRequest), true); - _transport = new HttpClientPipelineTransport(_client); - _requests = new List(); - _responses = new List(); - } - - /// - /// Event raised when a request is received - /// - public event EventHandler? OnRequest; - - /// - /// Event raised whena response is generated - /// - public event EventHandler? OnResponse; - - /// - /// The transport to pass to the your Azure clients - /// - public PipelineTransport Transport => _transport; - - /// - /// All received requests - /// - public IReadOnlyList Requests => _requests; - - /// - /// All generated responses - /// - public IReadOnlyList Responses => _responses; - - /// - /// Default handler that always returns an empty JSON payload as the response with the correct headers set - /// - /// The request - /// An empty successful JSON response - public static CapturedResponse ReturnEmptyJson(CapturedRequest request) - => new() - { - Status = HttpStatusCode.OK, - ReasonPhrase = "OK", - Content = BinaryData.FromString("{}"), - Headers = new Dictionary>() - { - [ "Content-Type" ] = [ "application/json" ], - [ "Content-Length"] = [ "2" ] - } - }; - - /// - /// Default handler that returns an empty HTTP 204 payload - /// - /// The request - /// An HTTP 204 empty response - public static CapturedResponse ReturnEmpty(CapturedRequest request) - => new() { Status = HttpStatusCode.NoContent }; - - /// - public void Dispose() - { - _client?.Dispose(); - } - - private CapturedResponse HandleRequest(CapturedRequest request) - { - List caught = new(); - - try - { - OnRequest?.Invoke(this, request); - } - catch (Exception ex) { caught.Add(ex); } - - _requests.Add(request); - - CapturedResponse? response = null; - try - { - response = _requestHandler(request); - } - catch (Exception ex) { caught.Add(ex); } - - if (response == null) - { - caught.Add(new ApplicationException("Got a null response to return")); - } - else try - { - OnResponse?.Invoke(this, response); - } - catch (Exception ex) { caught.Add(ex); } - - _responses.Add(response!); - - if (caught.Count > 0) - { - throw new AggregateException("Failed to process the request", caught); - } - - return response!; - } - - private class DelegateMessageHandler : HttpMessageHandler - { - private const string CONTENT_PREFIX = "Content-"; - private MessageHandlerAsyncDelegate _handler; - - public DelegateMessageHandler(MessageHandlerAsyncDelegate handler) - { - _handler = handler ?? throw new ArgumentNullException(nameof(handler)); - } - - protected -#if NET - override -#endif - HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) - { - CapturedRequest req = new() - { - Method = request.Method, - Uri = request.RequestUri!, - Headers = CopyHeaders(request.Headers, request.Content?.Headers), - Content = CopyContent(request.Content) - }; - - CapturedResponse res = _handler(req); - HttpResponseMessage response = new() - { - RequestMessage = request, - StatusCode = res.Status, - ReasonPhrase = res.ReasonPhrase, - Content = ToContent(res.Content, res.Headers), - }; - - foreach (var kvp in res.Headers.Where(h => h.Key?.StartsWith(CONTENT_PREFIX) == false)) - { - response.Headers.TryAddWithoutValidation(kvp.Key, kvp.Value); - } - - return response; - } - - protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - => Task.FromResult(Send(request, cancellationToken)); - - private static IReadOnlyDictionary> CopyHeaders( - HttpHeaders header, HttpContentHeaders? contentHeaders) - { - Dictionary> dict = new(StringComparer.OrdinalIgnoreCase); - - foreach (var kvp in header) - { - dict[kvp.Key] = new List(kvp.Value); - } - - if (contentHeaders != null) - { - foreach (var kvp in contentHeaders) - { - var list = (List?)dict.GetValueOrDefault(kvp.Key); - if (list == null) - { - list = new List(); - dict[kvp.Key] = list; - } - - list.AddRange(kvp.Value); - } - } - - return dict; - } - - private static BinaryData CopyContent(HttpContent? content) - { - if (content == null) - { - return new BinaryData(Array.Empty()); - } - - using Stream stream = content.ReadAsStreamAsync().Result; - return BinaryData.FromStream(stream); - } - - private static HttpContent? ToContent(BinaryData? data, IReadOnlyDictionary> headers) - { - if (data == null) - { - return null; - } - - byte[] arr = data.ToArray(); - ByteArrayContent content = new(arr); - content.Headers.ContentLength = arr.LongLength; - foreach (var contentHeader in headers.Where(kvp => kvp.Key?.StartsWith(CONTENT_PREFIX) == true)) - { - content.Headers.TryAddWithoutValidation(contentHeader.Key, contentHeader.Value); - } - - return content; - } - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncEnumerator.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncEnumerator.cs deleted file mode 100644 index 64ab0d6d6302..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncEnumerator.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.ExceptionServices; -using System.Threading; -using System.Threading.Tasks; - -namespace Azure.AI.OpenAI.Tests.Utils -{ - /// - /// Wraps an as an - /// - /// The type of items being enumerated. - public class SyncToAsyncEnumerator : IAsyncEnumerator - { - private IEnumerator _sync; - private CancellationToken _token; - private Exception? _ex; - - /// - /// Creates a new instance. - /// - /// The synchronous enumerator to wrap. - /// (Optional) The cancellation token to use. - /// If the enumerator was null. - public SyncToAsyncEnumerator(IEnumerator sync, CancellationToken token = default) - { - _sync = sync ?? throw new ArgumentNullException(nameof(sync)); - _token = token; - } - - /// - /// Creates a new instance. - /// - /// The exception to throw. - /// If the exception was null. - public SyncToAsyncEnumerator(Exception ex) - { - _sync = Enumerable.Empty().GetEnumerator(); - _token = default; - _ex = ex ?? throw new ArgumentNullException(nameof(ex)); - } - - /// - public T Current => _sync.Current; - - /// - public ValueTask DisposeAsync() - { - _sync.Dispose(); - return default; - } - - /// - public ValueTask MoveNextAsync() - { - if (_ex != null) - { - ExceptionDispatchInfo.Capture(_ex).Throw(); - } - - _token.ThrowIfCancellationRequested(); - bool ret = _sync.MoveNext(); - return new ValueTask(ret); - } - } - -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageableCollection.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageableCollection.cs deleted file mode 100644 index 4c86f840cacc..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncPageableCollection.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.ClientModel; -using System.Collections.Generic; -using System.Runtime.ExceptionServices; - -namespace Azure.AI.OpenAI.Tests.Utils -{ - /// - /// An adapter to make a look and work like a . This - /// simplifies writing test cases. - /// - /// The type of the items the enumerator returns. - public class SyncToAsyncPageableCollection : AsyncPageableCollection - { - private PageableCollection _syncCollection; - private Exception? _ex; - - /// - /// Creates a new instance. - /// - /// The synchronous collection to wrap. - /// If the collection was null. - public SyncToAsyncPageableCollection(PageableCollection syncCollection) - { - _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); - } - - /// - /// Creates a new instance. - /// - /// The exception to throw. - /// If the exception was null. - public SyncToAsyncPageableCollection(Exception ex) - { - _ex = ex ?? throw new ArgumentNullException(nameof(ex)); - _syncCollection = null!; - } - - /// - public override async IAsyncEnumerable> AsPages(string? continuationToken = null, int? pageSizeHint = null) - { - if (_ex != null) - { - ExceptionDispatchInfo.Capture(_ex).Throw(); - } - - IEnumerable> syncEnumerable = _syncCollection.AsPages(continuationToken, pageSizeHint); - var asyncWrapper = new SyncToAsyncEnumerator>(syncEnumerable.GetEnumerator()); - while (await asyncWrapper.MoveNextAsync().ConfigureAwait(false)) - { - TrySetRawResponse(); - yield return asyncWrapper.Current; - } - } - - private void TrySetRawResponse() - { - // Client result doesn't provide virtual methods so we have to manually set it ourselves here - try - { - var raw = _syncCollection.GetRawResponse(); - if (raw != null) - { - SetRawResponse(raw); - } - } - catch (Exception) { /* dont' care */ } - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncResultCollection.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncResultCollection.cs deleted file mode 100644 index c75a8d919d80..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/SyncToAsyncResultCollection.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#nullable enable - -using System; -using System.ClientModel; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Threading; - -namespace Azure.AI.OpenAI.Tests.Utils -{ - /// - /// An adapter to make a look and work like a . This - /// simplifies writing test cases - /// - /// The type of the items the enumerator returns - public class SyncToAsyncResultCollection : AsyncResultCollection - { - private ResultCollection _syncCollection; - - /// - /// Creates a new instance - /// - /// The synchronous collection to wrap - /// If the collection was null - public SyncToAsyncResultCollection(ResultCollection syncCollection) - { - _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); - } - - /// - public override IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) - { - return InnerEnumerable(cancellationToken).GetAsyncEnumerator(); - } - - private async IAsyncEnumerable InnerEnumerable([EnumeratorCancellation]CancellationToken cancellationToken = default) - { - var asyncWrapper = new SyncToAsyncEnumerator(_syncCollection.GetEnumerator(), cancellationToken); - while (await asyncWrapper.MoveNextAsync().ConfigureAwait(false)) - { - TrySetRawResponse(); - yield return asyncWrapper.Current; - } - } - - private void TrySetRawResponse() - { - // Client result doesn't provide virtual methods so we have to manually set it ourselves here - try - { - var raw = _syncCollection.GetRawResponse(); - if (raw != null) - { - SetRawResponse(raw); - } - } - catch (Exception) { /* dont' care */ } - } - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs index 577b76e865cc..5b999e1182ec 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestConfig.cs @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.IO; @@ -10,9 +8,9 @@ using System.Reflection; using System.Text; using System.Text.Json; -using Azure.AI.OpenAI.Tests.Utils; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.Core.TestFramework; +using OpenAI.TestFramework; +using OpenAI.TestFramework.Utils; namespace Azure.AI.OpenAI.Tests; @@ -57,8 +55,8 @@ public TestConfig(RecordedTestMode? mode) { AssetsJson, Path.Combine(AssetsSubFolder, AssetsJson), - Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".Azure", AssetsSubFolder, AssetsJson), - Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), ".Azure", AssetsSubFolder, AssetsJson), + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".azure", AssetsSubFolder, AssetsJson), + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), ".azure", AssetsSubFolder, AssetsJson), } .Select(f => ReadJsonConfig(f)) .FirstOrDefault(c => c != null) diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestPipelinePolicy.cs b/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestPipelinePolicy.cs deleted file mode 100644 index 66f8ffd3294f..000000000000 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/TestPipelinePolicy.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace OpenAI.Tests; - -internal partial class TestPipelinePolicy : PipelinePolicy -{ - private readonly Action _processRequestAction; - private readonly Action _processResponseAction; - - public TestPipelinePolicy(Action requestAction, Action responseAction) - { - _processRequestAction = requestAction; - _processResponseAction = responseAction; - } - - public override void Process(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) - { - _processRequestAction?.Invoke(message?.Request); - ProcessNext(message, pipeline, currentIndex); - _processResponseAction?.Invoke(message?.Response); - } - - public override async ValueTask ProcessAsync(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) - { - _processRequestAction?.Invoke(message?.Request); - await ProcessNextAsync(message, pipeline, currentIndex); - _processResponseAction?.Invoke(message?.Response); - } -} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs b/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs index a2ff07630185..cb6dc8e17ead 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs +++ b/sdk/openai/Azure.AI.OpenAI/tests/VectorStoreTests.cs @@ -10,15 +10,14 @@ using System.Threading; using System.Threading.Tasks; using Azure.AI.OpenAI.Tests.Utils.Config; -using Azure.Core.TestFramework; +using NUnit.Framework; using OpenAI; using OpenAI.Files; +using OpenAI.TestFramework; using OpenAI.VectorStores; namespace Azure.AI.OpenAI.Tests; -#pragma warning disable OPENAI001 - public class VectorStoreTests : AoaiTestBase { public VectorStoreTests(bool isAsync) : base(isAsync) @@ -111,15 +110,12 @@ public async Task CanEnumerateVectorStores() Assert.That(vectorStore.Name, Is.EqualTo($"Test Vector Store {i}")); } - - AsyncPageableCollection response = SyncOrAsync(client, - c => c.GetVectorStores(ListOrder.NewestFirst), - c => c.GetVectorStoresAsync(ListOrder.NewestFirst)); + AsyncPageCollection response = client.GetVectorStoresAsync(new VectorStoreCollectionOptions() { Order = ListOrder.NewestFirst }); Assert.That(response, Is.Not.Null); int lastIdSeen = int.MaxValue; int count = 0; - await foreach (VectorStore vectorStore in response) + await foreach (VectorStore vectorStore in response.GetAllValuesAsync()) { Assert.That(vectorStore.Id, Is.Not.Null); if (vectorStore.Name?.StartsWith("Test Vector Store ") == true) @@ -169,10 +165,8 @@ public async Task CanAssociateFiles() Thread.Sleep(1000); int count = 0; - AsyncPageableCollection response = SyncOrAsync(client, - c => c.GetFileAssociations(vectorStore), - c => c.GetFileAssociationsAsync(vectorStore)); - await foreach (VectorStoreFileAssociation association in response) + AsyncPageCollection response = client.GetFileAssociationsAsync(vectorStore); + await foreach (VectorStoreFileAssociation association in response.GetAllValuesAsync()) { count++; Assert.That(association.FileId, Is.Not.EqualTo(files[0].Id)); @@ -205,10 +199,8 @@ public async Task CanUseBatchIngestion() b => b.Status != VectorStoreBatchFileJobStatus.InProgress); Assert.That(batchJob.Status, Is.EqualTo(VectorStoreBatchFileJobStatus.Completed)); - AsyncPageableCollection response = SyncOrAsync(client, - c => c.GetFileAssociations(batchJob), - c => c.GetFileAssociationsAsync(batchJob)); - await foreach (VectorStoreFileAssociation association in response) + AsyncPageCollection response = client.GetFileAssociationsAsync(batchJob); + await foreach (VectorStoreFileAssociation association in response.GetAllValuesAsync()) { Assert.Multiple(() => { diff --git a/sdk/openai/tools/TestFramework/Directory.Build.props b/sdk/openai/tools/TestFramework/Directory.Build.props new file mode 100644 index 000000000000..f85173f26887 --- /dev/null +++ b/sdk/openai/tools/TestFramework/Directory.Build.props @@ -0,0 +1,18 @@ + + + + false + true + false + false + false + false + true + + + + + diff --git a/sdk/openai/tools/TestFramework/TestFramework.sln b/sdk/openai/tools/TestFramework/TestFramework.sln new file mode 100644 index 000000000000..a88dc3caf53d --- /dev/null +++ b/sdk/openai/tools/TestFramework/TestFramework.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35013.160 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenAI.TestFramework.Tests", "tests\OpenAI.TestFramework.Tests.csproj", "{61E849EB-F8BC-47C7-B730-874DD678BEA7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenAI.TestFramework", "src\OpenAI.TestFramework.csproj", "{BE2FF759-255B-44A8-BAE7-73E287AEEB97}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {61E849EB-F8BC-47C7-B730-874DD678BEA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {61E849EB-F8BC-47C7-B730-874DD678BEA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {61E849EB-F8BC-47C7-B730-874DD678BEA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {61E849EB-F8BC-47C7-B730-874DD678BEA7}.Release|Any CPU.Build.0 = Release|Any CPU + {BE2FF759-255B-44A8-BAE7-73E287AEEB97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE2FF759-255B-44A8-BAE7-73E287AEEB97}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE2FF759-255B-44A8-BAE7-73E287AEEB97}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE2FF759-255B-44A8-BAE7-73E287AEEB97}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F145C399-D9D8-45F9-87DC-4BFFF983FA91} + EndGlobalSection +EndGlobal diff --git a/sdk/openai/tools/TestFramework/assets.json b/sdk/openai/tools/TestFramework/assets.json new file mode 100644 index 000000000000..d33e24017e08 --- /dev/null +++ b/sdk/openai/tools/TestFramework/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/openai/OpenAI.TestFramework", + "Tag": "net/openai/OpenAI.TestFramework_f41330e3ac" +} diff --git a/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncCollectionResult.cs b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncCollectionResult.cs new file mode 100644 index 000000000000..64096eb4af54 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncCollectionResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; + +namespace OpenAI.TestFramework.Adapters; + +/// +/// An adapter to make a look and work like a . This +/// simplifies writing test cases +/// +/// The type of the items the enumerator returns +public class SyncToAsyncCollectionResult : AsyncCollectionResult +{ + private bool _responseSet; + private CollectionResult? _syncCollection; + private Exception? _ex; + + /// + /// Creates a new instance + /// + /// The synchronous collection to wrap + /// If the collection was null + public SyncToAsyncCollectionResult(CollectionResult syncCollection) + { + _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); + TrySetRawResponse(); + } + + /// + /// Creates a new instance. + /// + /// The exception to throw. + /// If the exception was null. + public SyncToAsyncCollectionResult(Exception ex) + { + _ex = ex ?? throw new ArgumentNullException(nameof(ex)); + _syncCollection = null; + } + + /// + public override IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + return InnerEnumerable(cancellationToken).GetAsyncEnumerator(); + } + + private async IAsyncEnumerable InnerEnumerable([EnumeratorCancellation] CancellationToken cancellationToken = default) + { + if (_ex != null) + { + ExceptionDispatchInfo.Capture(_ex).Throw(); + } + + var asyncWrapper = new SyncToAsyncEnumerator(_syncCollection?.GetEnumerator()!, cancellationToken); + while (await asyncWrapper.MoveNextAsync().ConfigureAwait(false)) + { + TrySetRawResponse(); + yield return asyncWrapper.Current; + } + } + + private void TrySetRawResponse() + { + if (_responseSet) + { + return; + } + + // Client result doesn't provide virtual methods so we have to manually set it ourselves here + try + { + var raw = _syncCollection?.GetRawResponse(); + if (raw != null) + { + SetRawResponse(raw); + _responseSet = true; + } + } + catch (Exception) { /* dont' care */ } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerable.cs b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerable.cs new file mode 100644 index 000000000000..c71c1a0e1d57 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerable.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Adapters; + +/// +/// Wraps an as an +/// +/// The type of items being enumerated. +public class SyncToAsyncEnumerable : IAsyncEnumerable +{ + private IEnumerable _enumerable; + Exception? _ex; + + /// + /// Creates a new instance. + /// + /// The synchronous enumerable to wrap. + public SyncToAsyncEnumerable(IEnumerable enumerable) + { + _enumerable = enumerable; + } + + /// + /// Creates a new instance. + /// + /// The synchronous enumerable to wrap. + public SyncToAsyncEnumerable(Exception ex) + { + _ex = ex; + _enumerable = Array.Empty(); + } + + /// + public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + { + if (_ex != null) + { + return new SyncToAsyncEnumerator(_ex); + } + else + { + return new SyncToAsyncEnumerator(_enumerable.GetEnumerator(), cancellationToken); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerator.cs b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerator.cs new file mode 100644 index 000000000000..fa0ce81b02b0 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncEnumerator.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.ExceptionServices; + +namespace OpenAI.TestFramework.Adapters; + +/// +/// Wraps an as an +/// +/// The type of items being enumerated. +public class SyncToAsyncEnumerator : IAsyncEnumerator +{ + private IEnumerator _sync; + private CancellationToken _token; + private Exception? _ex; + + /// + /// Creates a new instance. + /// + /// The synchronous enumerator to wrap. + /// (Optional) The cancellation token to use. + /// If the enumerator was null. + public SyncToAsyncEnumerator(IEnumerator sync, CancellationToken token = default) + { + _sync = sync ?? throw new ArgumentNullException(nameof(sync)); + _token = token; + } + + /// + /// Creates a new instance. + /// + /// The exception to throw. + /// If the exception was null. + public SyncToAsyncEnumerator(Exception ex) + { + _sync = Enumerable.Empty().GetEnumerator(); + _token = default; + _ex = ex ?? throw new ArgumentNullException(nameof(ex)); + } + + /// + public T Current => _sync.Current; + + /// + public ValueTask DisposeAsync() + { + _sync.Dispose(); + return default; + } + + /// + public ValueTask MoveNextAsync() + { + if (_ex != null) + { + ExceptionDispatchInfo.Capture(_ex).Throw(); + } + + _token.ThrowIfCancellationRequested(); + bool ret = _sync.MoveNext(); + return new ValueTask(ret); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncPageCollection.cs b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncPageCollection.cs new file mode 100644 index 000000000000..89b963137613 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Adapters/SyncToAsyncPageCollection.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.Runtime.ExceptionServices; + +namespace OpenAI.TestFramework.Adapters; + +/// +/// An adapter to make a look and work like a . This +/// simplifies writing test cases. +/// +/// The type of the items the enumerator returns. +public class SyncToAsyncPageCollection : AsyncPageCollection +{ + private PageCollection? _syncCollection; + private Exception? _ex; + + /// + /// Creates a new instance. + /// + /// The synchronous collection to wrap. + /// If the collection was null. + public SyncToAsyncPageCollection(PageCollection syncCollection) + { + _syncCollection = syncCollection ?? throw new ArgumentNullException(nameof(syncCollection)); + } + + /// + /// Creates a new instance. + /// + /// The exception to throw. + /// If the exception was null. + public SyncToAsyncPageCollection(Exception ex) + { + _ex = ex ?? throw new ArgumentNullException(nameof(ex)); + _syncCollection = null; + } + + /// + protected override Task> GetCurrentPageAsyncCore() + { + if (_ex != null) + { + return Task.FromException>(_ex); + } + else + { + return Task.FromResult(_syncCollection!.GetCurrentPage()); + } + } + + /// + protected override async IAsyncEnumerator> GetAsyncEnumeratorCore(CancellationToken cancellationToken = default) + { + if (_ex != null) + { + ExceptionDispatchInfo.Capture(_ex).Throw(); + } + + foreach (PageResult page in _syncCollection!) + { + await Task.Delay(0).ConfigureAwait(false); + yield return page; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/AsyncOnlyAttribute.cs b/sdk/openai/tools/TestFramework/src/AsyncOnlyAttribute.cs new file mode 100644 index 000000000000..3fbfc191f3e3 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AsyncOnlyAttribute.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; + +namespace OpenAI.TestFramework; + +/// +/// Attribute that can be applied to a test to indicate it only runs in asynchronous mode. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] +public class AsyncOnlyAttribute() : NUnitAttribute +{ +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AsyncToSyncInterceptor.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AsyncToSyncInterceptor.cs new file mode 100644 index 000000000000..08fe268ec8c2 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AsyncToSyncInterceptor.cs @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.Collections.Concurrent; +using System.Diagnostics; +using System.Reflection; +using Castle.DynamicProxy; +using OpenAI.TestFramework.Adapters; +using Ext = OpenAI.TestFramework.Utils.TypeExtensions; + +namespace OpenAI.TestFramework.AutoSyncAsync; + +/// +/// An interceptor for Castle dynamic proxies that allows you to call the synchronous version of a method when the asynchronous one +/// is called on the proxy. This is useful for testing where you can write the async version of a test, and then automatically test +/// both async and sync methods with the same test code. +/// +[DebuggerStepThrough] +public class AsyncToSyncInterceptor : IInterceptor +{ + private const string AsyncSuffix = "Async"; + + private static readonly TypeArrayEquality s_typeArrayEquality = new(); + private static readonly ConcurrentDictionary> s_syncAsyncPairs = new(); + private static readonly MethodInfo s_taskFromResult = typeof(Task).GetMethod(nameof(Task.FromResult), BindingFlags.Public | BindingFlags.Static)!; + private static readonly MethodInfo s_taskFromException = typeof(Task) + .GetMethods(BindingFlags.Static | BindingFlags.Public) + .Where(m => m.Name == nameof(Task.FromException) && m.IsGenericMethodDefinition) + .First(); + + private readonly BindingFlags _flags; + + /// + /// Creates a new instance. + /// + /// True if you want to use async methods, false otherwise. + /// The binding flags to use when searching for methods. Default is public instance methods. + public AsyncToSyncInterceptor(bool useAsync, BindingFlags flags = BindingFlags.Public | BindingFlags.Instance) + { + UseAsync = useAsync; + _flags = flags; + } + + /// + /// Gets the shared use sync methods instance. + /// + public static AsyncToSyncInterceptor UseSyncMethods { get; } = new(false); + + /// + /// Gets the shared use async methods instance. + /// + public static AsyncToSyncInterceptor UseAsyncMethods { get; } = new(true); + + /// + [DebuggerStepThrough] + public virtual void Intercept(IInvocation invocation) + { + // 1. Should we even intercept this? + if (ShouldSkipIntercepting(invocation.Method)) + { + invocation.Proceed(); + return; + } + + // 2. Check if this method is one of a pair of Operation and OperationAsync methods. + bool isSyncAsyncPair = IsMethodSyncAsyncPair(invocation.Method); + if (!isSyncAsyncPair) + { + throw CreateEx("Method does not have a synchronous and asynchronous pair", invocation.Method); + } + + // 3. If it is, check if the method is the synchronous version. We only allow async versions in the test code + bool isAsyncMethod = invocation.Method.Name.EndsWith(AsyncSuffix); + if (!isAsyncMethod) + { + throw CreateEx("You must use the asynchronous versions of the methods when writing your tests", invocation.Method); + } + + Type asyncReturnType = invocation.Method.ReturnType; + + // 4. Call the correct synchronous or asynchronous method and warp the returned result or exception + if (UseAsync) + { + // Async method running in async mode, no need to do anything, special, continue normally + invocation.Proceed(); + } + else + { + // Call the equivalent sync method + string methodName = RemoveAsyncSuffix(invocation.Method.Name); + Type expectedReturnType = ToSyncRetType(asyncReturnType); + Type[] expectedArgs = invocation.Method.GetParameters().Select(p => p.ParameterType).ToArray(); + + MethodInfo syncMethod = invocation.TargetType.GetMethod( + methodName, _flags, binder: null, expectedArgs, modifiers: null)!; + + // this should never happen since we've already checked for the existence of the expected method + Debug.Assert(syncMethod != null); + if (syncMethod == null) + { + throw CreateEx("Could not find the synchronous version of the method", invocation.Method); + } + + if (syncMethod.ContainsGenericParameters) + { + syncMethod = syncMethod.MakeGenericMethod(invocation.Method.GetGenericArguments()); + } + + // Call the synchronous method + try + { + object? result = syncMethod.Invoke(invocation.InvocationTarget, invocation.Arguments); + if (result != null && !expectedReturnType.IsAssignableFrom(result.GetType())) + { + throw CreateEx("The synchronous method returned an unexpected type", invocation.Method); + } + + invocation.ReturnValue = ToAsyncResult(asyncReturnType, result); + } + catch (TargetInvocationException ex) + { + invocation.ReturnValue = ToAsyncException(asyncReturnType, ex.InnerException ?? ex); + } + } + } + + /// + /// Whether or not we are using async methods. + /// + public bool UseAsync { get; } + + /// Determines whether or not we should skip intercepting this method or not. + /// + /// The method we are inspecting. + /// True to skip intercepting this method, false otherwise. + protected virtual bool ShouldSkipIntercepting(MethodInfo? method) + { + return method == null + // Skip for special names (i.e. getters and setters) + || method.IsSpecialName + // Also for dispose methods + || method.Name == nameof(IDisposable.Dispose) + || method.Name == nameof(IAsyncDisposable.DisposeAsync); + } + + /// + /// Determines whether or not the specified method is part of a pair of synchronous and asynchronous methods. This will + /// check based on 3 factors: + /// + /// If there is a "???" and "???Async" pair of named methods + /// If the arguments are exactly the same for both methods + /// If we know how to determine the expected return type for the synchronous method, from the asynchronous one + /// + /// + /// The method to check. + /// True if it is, false otherwise. + protected virtual bool IsMethodSyncAsyncPair(MethodInfo? method) + { + if (method == null || method.DeclaringType == null) + { + return false; + } + + ISet validPrefixes = s_syncAsyncPairs.GetOrAdd(method.DeclaringType, t => DetermineValidSyncAsyncPairs(t, _flags)); + return validPrefixes.Contains(RemoveAsyncSuffix(method.Name)); + } + + /// + /// Determines what the corresponding synchronous return type would be for the specified asynchronous return type. + /// + /// The asynchronous return type. + /// The corresponding synchronous return type. + /// If we don't know what the equivalent would be. + protected virtual Type ToSyncRetType(Type asyncReturnType) + { + if (typeof(Task) == asyncReturnType || typeof(ValueTask) == asyncReturnType) + { + return typeof(void); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(Task<>), out Type[] genericTypes)) + { + return genericTypes[0]; + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(ValueTask<>), out genericTypes)) + { + return genericTypes[0]; + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncPageCollection<>), out genericTypes)) + { + return typeof(PageCollection<>).MakeGenericType(genericTypes); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncCollectionResult<>), out genericTypes)) + { + return typeof(CollectionResult<>).MakeGenericType(genericTypes); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(IAsyncEnumerable<>), out genericTypes)) + { + return typeof(IEnumerable<>).MakeGenericType(genericTypes); + } + else + { + throw new NotSupportedException("Don't know how to create the sync to async wrapper for " + asyncReturnType.FullName); + } + } + + /// + /// Wraps the result from a synchronous method into the equivalent asynchronous return type. + /// + /// The asynchronous return type. + /// The result to wrap. + /// The wrapped result. + /// If we don't support the conversion. + protected virtual object? ToAsyncResult(Type asyncReturnType, object? result) + { + if (typeof(Task) == asyncReturnType) + { + return Task.CompletedTask; + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(Task<>), out Type[] genericTypes)) + { + return s_taskFromResult + .MakeGenericMethod(genericTypes) + .Invoke(null, [result]); + } + else if (typeof(ValueTask) == asyncReturnType) + { + return new ValueTask(); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(ValueTask<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(ValueTask<>).MakeGenericType(genericTypes), + result); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncPageCollection<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncPageCollection<>).MakeGenericType(genericTypes), + result); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncCollectionResult<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncCollectionResult<>).MakeGenericType(genericTypes), + result); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(IAsyncEnumerable<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncEnumerable<>).MakeGenericType(genericTypes), + result); + } + else + { + throw new NotSupportedException("Don't know how to wrap the exception for " + asyncReturnType.FullName); + } + } + + /// + /// Wraps the exception from a synchronous method into the equivalent asynchronous return type. + /// + /// The asynchronous return type. + /// The exception to wrap. + /// The wrapped exception. + /// If we don't support the conversion. + protected virtual object? ToAsyncException(Type asyncReturnType, Exception ex) + { + if (typeof(Task) == asyncReturnType) + { + return Task.FromException(ex); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(Task<>), out Type[] genericTypes)) + { + return s_taskFromException + .MakeGenericMethod(genericTypes) + .Invoke(null, [ex]); + } + else if (typeof(ValueTask) == asyncReturnType) + { + return new ValueTask(Task.FromException(ex)); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(ValueTask<>), out genericTypes)) + { + var failedTask = s_taskFromException + .MakeGenericMethod(genericTypes) + .Invoke(null, [ex]); + return Activator.CreateInstance( + typeof(ValueTask<>).MakeGenericType(genericTypes), + failedTask); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncPageCollection<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncPageCollection<>).MakeGenericType(genericTypes), + ex); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(AsyncCollectionResult<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncCollectionResult<>).MakeGenericType(genericTypes), + ex); + } + else if (Ext.IsClosedGenericOf(asyncReturnType, typeof(IAsyncEnumerable<>), out genericTypes)) + { + return Activator.CreateInstance( + typeof(SyncToAsyncEnumerable<>).MakeGenericType(genericTypes), + ex); + } + else + { + throw new NotSupportedException("Don't know how to determine the synchronous equivalent return type of " + asyncReturnType.FullName); + } + } + + private static InvalidOperationException CreateEx(string description, MethodInfo method) + { + return new InvalidOperationException($"{description}. '{method.DeclaringType?.Name} -> {method.Name}'"); + } + + private static string RemoveAsyncSuffix(string? name) + { + if (name == null) + return string.Empty; + + int index = name.LastIndexOf(AsyncSuffix); + return index >= 0 + ? name.Substring(0, index) + : name; + } + + [DebuggerStepperBoundary] + private ISet DetermineValidSyncAsyncPairs(Type declaringType, BindingFlags flags) + { + // Group potential pairs based only on the method name removing the "Async" postfix + var potentialPairs = declaringType.GetMethods(flags) + .Where(m => !m.IsSpecialName) + .GroupBy(m => RemoveAsyncSuffix(m.Name)) + .OrderBy(g => g.Key) + .Select(g => new + { + g.Key, + Potentials = g.Select(m => new + { + m.Name, + Args = m.GetParameters().Select(p => p.ParameterType).ToArray(), + Return = m.ReturnType, + }) + // Order by name to ensure OperationName comes before OperationNameAsync + .OrderBy(p => p.Name) + // Match on method arguments + .GroupBy(g => g.Args, s_typeArrayEquality) + .Select(g => g.ToArray()) + }); + + // Now evaluate potential pairs to ensure that for each argument list for that method, there exists both a synchronous + // and asynchronous version with equivalent return types + HashSet validPairPrefixes = new(); + + foreach (var entry in potentialPairs) + { + bool allValid = entry.Potentials.All(matchedPair => + { + // because of the way we sorted above, we should have exactly 2 entries here, the first is the synchronous method + // the second the corresponding asynchronous method + return matchedPair.Length == 2 + && matchedPair[0].Name + AsyncSuffix == matchedPair[1].Name + && matchedPair[0].Return == ToSyncRetType(matchedPair[1].Return); + }); + + if (allValid) + { + validPairPrefixes.Add(entry.Key); + } + } + + return validPairPrefixes; + } + + /// + /// Helper comparer that compares all of the Types in an array for equality. + /// + private class TypeArrayEquality : IEqualityComparer + { + /// + public bool Equals(Type[]? x, Type[]? y) + { + if (ReferenceEquals(x, y)) + { + return true; + } + else if (x == null || y == null) + { + return false; + } + else if (x.LongLength != y.LongLength) + { + return false; + } + + for (long i = 0; i < x.LongLength; i++) + { + if (x[i] != y[i]) + { + return false; + } + } + + return true; + } + + /// + public int GetHashCode(Type[] obj) + { + if (obj == null) + { + return 0; + } + + int rollingHash = 1; // to distinguish empty case from null case + for (long i = 0; i < obj.LongLength; i++) + { + rollingHash = (rollingHash, obj[i].GetHashCode()).GetHashCode(); + } + + return rollingHash; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AutoSyncAsyncMixIn.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AutoSyncAsyncMixIn.cs new file mode 100644 index 000000000000..538f8fb75d16 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/AutoSyncAsyncMixIn.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.AutoSyncAsync; + +/// +/// An implementation of that allows you to get the original back, as well as a place +/// to store an additional context. +/// +public class AutoSyncAsyncMixIn : IAutoSyncAsync +{ + /// + /// Creates a new instance. + /// + /// The original instance. + public AutoSyncAsyncMixIn(object original, object? context = null) + { + Original = original; + Context = context; + } + + /// + public object Original { get; } + + /// + public object? Context { get; } +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsync/IAutoSyncAsync.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/IAutoSyncAsync.cs new file mode 100644 index 000000000000..551df75c52f0 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/IAutoSyncAsync.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.AutoSyncAsync; + +/// +/// An interface that serves as a way to identify a dynamically proxied class that supports automatic sync and async testing. This +/// also provides a way to get the the original un-proxied instance. +/// instance. +/// +public interface IAutoSyncAsync +{ + /// + /// Gets the original un-proxied instance back. + /// + public object Original { get; } + + /// + /// Any additional context associated with the instrumented object (e.g. options used to create it). + /// + public object? Context { get; } +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsync/TestProxyGenerationHook.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/TestProxyGenerationHook.cs new file mode 100644 index 000000000000..d11d5d86fdfa --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/TestProxyGenerationHook.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using Castle.DynamicProxy; +using NUnit.Framework.Interfaces; +using NUnit.Framework.Internal; + +namespace OpenAI.TestFramework.AutoSyncAsync +{ + /// + /// Controls which methods are skipped during dynamic proxy generation. + /// + public class TestProxyGenerationHook : IProxyGenerationHook + { + /// + public void MethodsInspected() + { } + + /// + public void NonProxyableMemberNotification(Type type, MemberInfo memberInfo) + { } + + /// + public bool ShouldInterceptMethod(Type type, MethodInfo methodInfo) + { + IMethodInfo? testMethod = TestExecutionContext.CurrentContext.CurrentTest.Method; + + if (methodInfo == null + // Skip for special names (i.e. getters and setters) + || methodInfo.IsSpecialName + // Also for dispose methods + || methodInfo.Name == nameof(IDisposable.Dispose) + || methodInfo.Name == nameof(IAsyncDisposable.DisposeAsync) + // If we are running a sync only or async only, skip intercepting altogether + || testMethod?.IsDefined(false) == true + || testMethod?.IsDefined(false) == true) + { + return false; + } + + return true; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsync/ThisLeakInterceptor.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/ThisLeakInterceptor.cs new file mode 100644 index 000000000000..c7d6c1e70c38 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsync/ThisLeakInterceptor.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics; +using Castle.DynamicProxy; + +namespace OpenAI.TestFramework.AutoSyncAsync; + +/// +/// A basic interceptor that prevents the leaking of the original un-proxied this instance as a return value. +/// +public class ThisLeakInterceptor : IInterceptor +{ + /// + [DebuggerStepThrough] + public void Intercept(IInvocation invocation) + { + invocation.Proceed(); + + if (invocation.ReturnValue == invocation.InvocationTarget) + { + invocation.ReturnValue = invocation.Proxy; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/AutoSyncAsyncTestFixtureAttribute.cs b/sdk/openai/tools/TestFramework/src/AutoSyncAsyncTestFixtureAttribute.cs new file mode 100644 index 000000000000..29983a94d92f --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/AutoSyncAsyncTestFixtureAttribute.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; +using NUnit.Framework.Interfaces; +using NUnit.Framework.Internal; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework; + +/// +/// Attribute used to indicate that a test fixture should automatically be be run in both synchronous and asynchronous mode. +/// +[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] +public class AutoSyncAsyncTestFixtureAttribute : NUnitAttribute, IFixtureBuilder2 +{ + /// + public IEnumerable BuildFrom(ITypeInfo typeInfo) + => BuildFrom(typeInfo, null!); + + /// + public IEnumerable BuildFrom(ITypeInfo typeInfo, IPreFilter filter) + { + List suites = + [ + .. new TestFixtureAttribute([false]).BuildFrom(typeInfo, new AndPreFilter(filter, new SyncAsyncPreFilter(false))), + .. new TestFixtureAttribute([true]).BuildFrom(typeInfo, new AndPreFilter(filter, new SyncAsyncPreFilter(true))), + ]; + + return suites; + } +} diff --git a/sdk/openai/tools/TestFramework/src/ClientTestBase.cs b/sdk/openai/tools/TestFramework/src/ClientTestBase.cs new file mode 100644 index 000000000000..7406e738e10d --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/ClientTestBase.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics; +using Castle.DynamicProxy; +using NUnit.Framework; +using NUnit.Framework.Internal; +using OpenAI.TestFramework.AutoSyncAsync; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework; + +/// +/// Base class for client test cases. This provides support for writing only a test that uses the Async version of +/// methods, and automatically creating a test that uses the equivalent Sync version of a method. Please note that +/// this will only work for public virtual methods. In order for this to work, you should write a test that uses the +/// async version of a method. +/// +[AutoSyncAsyncTestFixture] +public abstract class ClientTestBase +{ + private static ProxyGenerator? s_proxyGenerator = null; + private static ThisLeakInterceptor? s_thisLeakInterceptor = null; + private static AsyncToSyncInterceptor? s_asyncInterceptor = null; + private static AsyncToSyncInterceptor? s_syncInterceptor = null; + + private CancellationTokenSource? _cts = null; + + /// + /// Creates a new instance. + /// + /// True to run the async version of a test, false to run the sync version of a test. + public ClientTestBase(bool isAsync) + { + IsAsync = isAsync; + } + + /// + /// Gets whether or not we are running async tests. + /// + public virtual bool IsAsync { get; } + + /// + /// Gets the start time of the test. + /// + public virtual DateTimeOffset TestStartTime => TestExecutionContext.CurrentContext.StartTime.ToUniversalTime(); + + /// + /// Gets the test timeout. + /// + public virtual TimeSpan TestTimeout => Debugger.IsAttached + ? Default.DebuggerAttachedTestTimeout + : Default.TestTimeout; + + /// + /// Gets the cancellation token to use + /// + public virtual CancellationToken Token => _cts?.Token ?? default; + + [SetUp] + public void TestSetup() + { + _cts?.Dispose(); + _cts = new CancellationTokenSource(TestTimeout); + } + + [TearDown] + public void TestCleanup() + { + _cts?.Dispose(); + _cts = null; + } + + /// + /// Gets the instance to use to create proxies of classes + /// that allow you inject additional functionality in for testing. + /// + protected static ProxyGenerator ProxyGenerator => s_proxyGenerator ??= new ProxyGenerator(); + + /// + /// An interceptor that prevents leaking a reference to the original instance as a return value from methods. + /// + protected static ThisLeakInterceptor ThisLeakInterceptor => s_thisLeakInterceptor ??= new ThisLeakInterceptor(); + + /// + /// An interceptor to force the use of async version of a method. + /// + protected static AsyncToSyncInterceptor UseSyncMethodInterceptor => s_syncInterceptor ??= new AsyncToSyncInterceptor(false); + + /// + /// An interceptor to force the use of sync version of a method. + /// + protected static AsyncToSyncInterceptor UseAsyncMethodInterceptor => s_asyncInterceptor ??= new AsyncToSyncInterceptor(true); + + /// + /// Wraps a client for automatic sync/async testing. This will return a proxied version of the client that will allow you to + /// automatically use the sync versions of a method. + /// + /// The type of the client instance. + /// The client instance to instrument for testing. + /// (Optional) Any additional context to associate with the wrapped client. + /// (Optional) Any additional interceptors to use. + /// The proxied version of the client. + public T WrapClient(T client, object? context = null, params IInterceptor[] interceptors) where T : class + => (T)WrapClient(typeof(T), client, context, interceptors); + + /// + /// Gets the original client from a wrapped client. + /// + /// The type of the client. + /// The wrapped client instance. + /// The original client instance. + /// The the client passed was not wrapped. + public virtual T UnWrap(T wrapped) where T : class + { + if (wrapped is IAutoSyncAsync instrumented) + { + return (T)instrumented.Original; + } + + throw new NotSupportedException($"That instance was not wrapped using {nameof(WrapClient)}"); + } + + /// + /// Gets the context associated with the wrapped instance. + /// + /// The type of the client. + /// The wrapped client. + /// The associated context for the wrapped instance. Will be null if none was set. + /// The the instance passed was not wrapped. + public virtual object? GetClientContext(T client) where T : class + { + if (client is IAutoSyncAsync instrumented) + { + return instrumented.Context; + } + + throw new NotSupportedException($"That instance was not wrapped using {nameof(WrapClient)}"); + } + + /// + /// Wraps a client with sync/async equivalent methods for testing. This enables the automatic testing of the sync version + /// of methods if you write an async test case. + /// + /// The type of the client. + /// The client instance to wrap. + /// (Optional) Any additional context to associate with the wrapped client. + /// (Optional) Any additional interceptors to include. + /// The wrapped version of the client. + protected internal virtual object WrapClient(Type instanceType, object client, object? context, IEnumerable? interceptors) + { + List allInterceptors = new(); + + if (interceptors != null) + { + allInterceptors.AddRange(interceptors); + } + + allInterceptors.Add(ThisLeakInterceptor); + allInterceptors.Add(IsAsync ? UseAsyncMethodInterceptor : UseSyncMethodInterceptor); + + ProxyGenerationOptions options = new(new TestProxyGenerationHook()); + options.AddMixinInstance(new AutoSyncAsyncMixIn(client, context)); + + object proxy = ProxyGenerator.CreateClassProxyWithTarget( + instanceType, + [], + client, + options, + allInterceptors.ToArray()); + + return proxy; + } +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/CapturedMessage.cs b/sdk/openai/tools/TestFramework/src/Mocks/CapturedMessage.cs new file mode 100644 index 000000000000..854b8cd7d04c --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/CapturedMessage.cs @@ -0,0 +1,175 @@ +// Copyright(c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// A captured message. This is used as part of the . +/// +public abstract class CapturedMessage +{ + private static BinaryData? s_emptyData = null; + private static IReadOnlyDictionary>? s_emptyHeaders = null; + + /// + /// An empty header dictionary. + /// + public static IReadOnlyDictionary> EMPTY_HEADERS + => s_emptyHeaders ??= new Dictionary>(); + + /// + /// Empty binary data. + /// + public static BinaryData EMPTY_DATA => s_emptyData ??= new BinaryData(Array.Empty()); + + /// + /// Gets or sets the headers of the captured message. + /// + public IReadOnlyDictionary> Headers { get; init; } = EMPTY_HEADERS; + + /// + /// Gets or sets the content of the captured message. + /// + public BinaryData Content { get; init; } = EMPTY_DATA; + + /// + /// Copies the content from the provided to a new instance. + /// + /// The to copy the content from. + /// A new instance containing the copied content. + public static BinaryData CopyContent(HttpContent? content) + { + if (content == null) + { + return EMPTY_DATA; + } + + using Stream stream = content.ReadAsStreamAsync().Result; + return BinaryData.FromStream(stream); + } + + /// + /// Copies the headers from the provided and to a new dictionary. + /// + /// The to copy headers from. + /// The to copy headers from. + /// A new dictionary containing the copied headers. + public static IReadOnlyDictionary> CopyHeaders(HttpHeaders header, HttpContentHeaders? contentHeaders) + { + Dictionary> dict = new(StringComparer.OrdinalIgnoreCase); + foreach (var kvp in header) + { + dict[kvp.Key] = new List(kvp.Value); + } + + if (contentHeaders != null) + { + foreach (var kvp in contentHeaders) + { + var list = (List?)dict.GetValueOrDefault(kvp.Key); + if (list == null) + { + list = new List(); + dict[kvp.Key] = list; + } + + list.AddRange(kvp.Value); + } + } + + return dict; + } +} + +/// +/// A captured request. +/// +public class CapturedRequest : CapturedMessage +{ + /// + /// Creates a new instance. + /// + public CapturedRequest() + { } + + /// + /// Creates a new instance of using the provided . + /// + /// The to create the captured request from. + public CapturedRequest(HttpRequestMessage request) + { + if (request == null) + { + throw new ArgumentNullException(nameof(request)); + } + + Method = request.Method; + Uri = request.RequestUri; + Headers = CopyHeaders(request.Headers, request.Content?.Headers); + Content = CopyContent(request.Content); + } + + /// + /// Gets or sets the HTTP method of the captured request. + /// + public HttpMethod Method { get; init; } = HttpMethod.Get; + + /// + /// Gets or sets the URI of the captured request. + /// + public Uri? Uri { get; init; } +} + +/// +/// A captured response. +/// +public class CapturedResponse : CapturedMessage +{ + /// + /// Gets or sets the status code of the captured response. + /// + public HttpStatusCode Status { get; init; } = HttpStatusCode.OK; + + /// + /// Gets or sets the reason phrase of the captured response. + /// + public string? ReasonPhrase { get; init; } = "OK"; + + /// + /// Converts the captured response to an . + /// + /// The . + public HttpResponseMessage ToResponse() + { + const string contentPrefix = "Content-"; + + HttpResponseMessage response = new() + { + StatusCode = Status, + ReasonPhrase = ReasonPhrase + }; + + foreach (var kvp in Headers.Where(h => h.Key?.StartsWith(contentPrefix) == false)) + { + response.Headers.TryAddWithoutValidation(kvp.Key, kvp.Value); + } + + if (Content != null && Content.ToMemory().Length > 0) + { + response.Content = new StreamContent(Content.ToStream()); + foreach (var kvp in Headers.Where(h => h.Key?.StartsWith(contentPrefix) == true)) + { + response.Content.Headers.TryAddWithoutValidation(kvp.Key, kvp.Value); + } + } + + return response; + } +} + + diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs new file mode 100644 index 000000000000..86e871aa6987 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncCollectionResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Represents a mock implementation of the class. +/// +/// The type of the values in the collection. +public class MockAsyncCollectionResult : AsyncCollectionResult +{ + private readonly Func> _enumerateAsyncFunc; + + /// + /// Initializes a new instance of the class + /// with the specified asynchronous enumeration function and optional pipeline response. + /// + /// The function that asynchronously enumerates the values in the collection. + /// The optional pipeline response. + public MockAsyncCollectionResult(Func> enumerateAsyncFunc, PipelineResponse? response = null) : + base(response ?? new MockPipelineResponse()) + { + _enumerateAsyncFunc = enumerateAsyncFunc ?? throw new ArgumentNullException(nameof(enumerateAsyncFunc)); + } + + /// + public override IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) + => _enumerateAsyncFunc().GetAsyncEnumerator(cancellationToken); +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncPageCollection.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncPageCollection.cs new file mode 100644 index 000000000000..424681252282 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockAsyncPageCollection.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Represents a mock implementation of the class. +/// +/// The type of the values in the collection. +public class MockAsyncPageCollection : AsyncPageCollection +{ + private readonly Func> _enumerateAsyncFunc; + private readonly PipelineResponse _response; + private readonly int _itemsPerPage; + private PageResult? _currentPage; + + /// + /// Initializes a new instance. + /// + /// The function that enumerates the collection asynchronously. + /// The pipeline response. + public MockAsyncPageCollection(Func> enumerateAsyncFunc, PipelineResponse response, int itemsPerPage = 5) + { + if (itemsPerPage <= 0) + { + throw new ArgumentOutOfRangeException(nameof(itemsPerPage)); + } + + _enumerateAsyncFunc = enumerateAsyncFunc ?? throw new ArgumentNullException(nameof(enumerateAsyncFunc)); + _response = response; + _itemsPerPage = itemsPerPage; + } + + /// + protected override Task> GetCurrentPageAsyncCore() + => Task.FromResult(_currentPage ?? throw new InvalidOperationException("Please call MoveNextAsync first.")); + + /// + protected override async IAsyncEnumerator> GetAsyncEnumeratorCore(CancellationToken cancellationToken = default) + { + List items = new(_itemsPerPage); + int pageStart = 0; + int rolling = 0; + + await foreach (TValue value in _enumerateAsyncFunc()) + { + items.Add(value); + rolling++; + if (items.Count == _itemsPerPage) + { + _currentPage = PageResult.Create(items, ToContinuation(pageStart), ToContinuation(rolling), _response); + yield return _currentPage; + items.Clear(); + pageStart = rolling; + } + } + + if (items.Count > 0) + { + _currentPage = PageResult.Create(items, ToContinuation(pageStart), ToContinuation(rolling), _response); + yield return _currentPage; + } + } + + private static ContinuationToken ToContinuation(int offset) + => ContinuationToken.FromBytes(BinaryData.FromBytes(BitConverter.GetBytes(offset))); +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs new file mode 100644 index 000000000000..e12e34b3428c --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockCollectionResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks +{ + /// + /// Represents a mock implementation of the class. + /// + /// The type of the values in the collection. + public class MockCollectionResult : CollectionResult + { + private readonly Func> _enumerateFunc; + + /// + /// Initializes a new instance of the class with the specified enumeration + /// function and optional pipeline response. + /// + /// The function used to enumerate the collection. + /// The pipeline response associated with the collection. + public MockCollectionResult(Func> enumerateFunc, PipelineResponse? response = null) : + base(response ?? new MockPipelineResponse()) + { + _enumerateFunc = enumerateFunc ?? throw new ArgumentNullException(nameof(enumerateFunc)); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// An enumerator that can be used to iterate through the collection. + public override IEnumerator GetEnumerator() + => _enumerateFunc().GetEnumerator(); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockHeaders.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockHeaders.cs new file mode 100644 index 000000000000..7cac49376182 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockHeaders.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Basic implementation of headers. +/// +public class MockHeaders +{ + private IDictionary> _headers = + new Dictionary>(StringComparer.OrdinalIgnoreCase); + + /// + /// Adds a header value. + /// + /// The name of the header. + /// The value to add. + public virtual void Add(string name, string value) + { + IList? existing; + if (!_headers.TryGetValue(name, out existing)) + { + existing = new List(); + _headers[name] = existing; + } + + existing.Add(value); + } + + /// + /// Removes all values of a header. + /// + /// The name of the header to remove. + /// True if we removed a value, false otherwise. + public virtual bool Remove(string name) => _headers.Remove(name); + + /// + /// Sets the value for a header. This will override all existing values. + /// + /// The name of the header. + /// The value to set. + public virtual void Set(string name, string value) => _headers[name] = new List() { value }; + + /// + /// Gets an enumerator for the header values. In the case of a header with more than one value, they will be joined into + /// a single comma separated string. + /// + /// The enumerator. + public virtual IEnumerator> GetEnumerator() + => _headers + .Select(kvp => new KeyValuePair(kvp.Key, string.Join(",", kvp.Value))) + .GetEnumerator(); + + /// + /// Gets the value for a header. In the case of a header with more than one value, they will be joined into a single comma + /// separated string. + /// + /// The name of the header. + /// The value of the headers + /// True if the header was found, false otherwise. + public virtual bool TryGetValue(string name, out string? value) + { + if (_headers.TryGetValue(name, out IList? existing)) + { + value = string.Join(",", existing); + return true; + } + + value = null; + return false; + } + + /// + /// Gets the values for a header. + /// + /// The name of the header. + /// All of the values for the header. + /// True if the header was found, false otherwise. + public virtual bool TryGetValues(string name, out IEnumerable? values) + { + if (_headers.TryGetValue(name, out IList? existing)) + { + values = existing; + return true; + } + + values = null; + return false; + } +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockHttpMessageHandler.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockHttpMessageHandler.cs new file mode 100644 index 000000000000..74f4b998047f --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockHttpMessageHandler.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Net; +using System.Net.Http; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// A mock message handler that doesn't use the network. This captures all received requests, and allows you to specify a handler +/// to hand craft response messages. This can be useful for unit testing. +/// +public class MockHttpMessageHandler : HttpMessageHandler, IDisposable +{ + /// + /// Handles a captured request. + /// + /// The captured request. + /// The corresponding response. + public delegate CapturedResponse RequestHandlerDelegate(CapturedRequest request); + + private RequestHandlerDelegate _handler; + private List _requests; + private List _responses; + private PipelineTransport? _transport; + + /// + /// Creates a new instance. + /// + /// (Optional) The handler to use to generate responses. Default returns an empty + /// response body with HTTP 204 + public MockHttpMessageHandler(RequestHandlerDelegate? requestHandler = null) + { + _handler = requestHandler ?? ReturnEmpty; + _requests = new List(); + _responses = new List(); + } + + /// + /// Event raised when a request is received. + /// + public event EventHandler? OnRequest; + + /// + /// Event raised when a response is generated. + /// + public event EventHandler? OnResponse; + + /// + /// Gets the transport to pass to your System.ClientModel based clients. + /// + public PipelineTransport Transport => _transport ??= new HttpClientPipelineTransport(new HttpClient(this)); + + /// + /// All received requests. + /// + public IReadOnlyList Requests => _requests; + + /// + /// All generated responses. + /// + public IReadOnlyList Responses => _responses; + + /// + /// Default handler that always returns an empty JSON payload as the response with the correct headers set + /// + /// The request + /// An empty successful JSON response + public static CapturedResponse ReturnEmptyJson(CapturedRequest request) + => new() + { + Status = HttpStatusCode.OK, + ReasonPhrase = "OK", + Content = BinaryData.FromString("{}"), + Headers = new Dictionary>() + { + ["Content-Type"] = ["application/json"], + ["Content-Length"] = ["2"] + } + }; + + /// + /// Default handler that returns an empty HTTP 204 payload + /// + /// The request + /// An HTTP 204 empty response + public static CapturedResponse ReturnEmpty(CapturedRequest request) + => new() { Status = HttpStatusCode.NoContent }; + + private HttpResponseMessage HandleRequest(HttpRequestMessage request, CancellationToken token) + { + try + { + CapturedRequest capturedRequest = new(request); + OnRequest?.Invoke(this, capturedRequest); + _requests.Add(capturedRequest); + + CapturedResponse capturedResponse = _handler(capturedRequest); + OnResponse?.Invoke(this, capturedResponse); + _responses.Add(capturedResponse); + + return capturedResponse.ToResponse(); + } + catch (Exception ex) + { + throw new ClientResultException("Failed to process request", null, ex); + } + } + + #region HttpMessagHandler implementation + +#if NET + override +#endif + protected HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) + => HandleRequest(request, cancellationToken); + + protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + => Task.FromResult(HandleRequest(request, cancellationToken)); + + #endregion +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockPageCollection.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockPageCollection.cs new file mode 100644 index 000000000000..1f08987aeb65 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockPageCollection.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Represents a mock implementation of the class. +/// +/// The type of the values in the collection. +public class MockPageCollection : PageCollection +{ + private readonly Func> _enumerateFunc; + private readonly PipelineResponse _response; + private readonly int _itemsPerPage; + private PageResult? _currentPage; + + /// + /// Creates a new instance. + /// + /// The function used to enumerate the collection. + /// The pipeline response. + /// (Optional) The number of items per page. + public MockPageCollection(Func> enumerateFunc, PipelineResponse response, int itemsPerPage = 5) + { + if (itemsPerPage <= 0) + { + throw new ArgumentOutOfRangeException(nameof(itemsPerPage)); + } + + _enumerateFunc = enumerateFunc ?? throw new ArgumentNullException(nameof(enumerateFunc)); + _response = response; + _itemsPerPage = itemsPerPage; + } + + /// + protected override PageResult GetCurrentPageCore() + => _currentPage ?? throw new InvalidOperationException("Please call MoveNextAsync first."); + + /// + protected override IEnumerator> GetEnumeratorCore() + { + List items = new(_itemsPerPage); + int pageStart = 0; + int rolling = 0; + + foreach (TValue item in _enumerateFunc()) + { + items.Add(item); + rolling++; + if (items.Count == _itemsPerPage) + { + _currentPage = PageResult.Create(items, ToContinuation(pageStart), ToContinuation(rolling), _response); + yield return _currentPage; + items.Clear(); + pageStart = rolling; + } + } + + if (items.Count > 0) + { + _currentPage = PageResult.Create(items, ToContinuation(pageStart), null, _response); + yield return _currentPage; + } + } + + private static ContinuationToken ToContinuation(int offset) + => ContinuationToken.FromBytes(BinaryData.FromBytes(BitConverter.GetBytes(offset))); +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockPipelineResponse.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockPipelineResponse.cs new file mode 100644 index 000000000000..1ade396dfce6 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockPipelineResponse.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// A mock implementation of a pipeline response +/// +public class MockPipelineResponse : PipelineResponse +{ + private Stream? _contentStream; + private BinaryData? _buffered; + + /// + /// Creates a new instance. + /// + /// (Optional) The HTTP status. + /// (Optional) The HTTP reason phrase. + /// (Optional) The HTTP response body content. + public MockPipelineResponse( + int? status = null, + string? reasonPhrase = null, + BinaryData? content = null) + { + Status = status ?? 200; + ReasonPhrase = reasonPhrase ?? "OK"; + _buffered = content; + ContentStream = content?.ToStream(); + HeadersCore = new MockResponseHeaders(); + } + + /// + public override int Status { get; } + + /// + public override string ReasonPhrase { get; } + + /// + public override Stream? ContentStream + { + get => _contentStream; + set + { + _contentStream = value; + _buffered = null; + } + } + + /// + public override BinaryData Content => _buffered ?? throw new InvalidOperationException("Response content is not yet buffered"); + + /// + protected override PipelineResponseHeaders HeadersCore { get; } + + /// + public override BinaryData BufferContent(CancellationToken cancellationToken = default) + => BufferContentSyncAsync(false, cancellationToken).GetAwaiter().GetResult(); + + /// + public override ValueTask BufferContentAsync(CancellationToken cancellationToken = default) + => BufferContentSyncAsync(true, cancellationToken); + + /// + public override void Dispose() + { + ContentStream?.Dispose(); + } + + private async ValueTask BufferContentSyncAsync(bool isAsync, CancellationToken token) + { + if (_buffered != null) + { + return _buffered; + } + + _buffered = ContentStream == null + ? BinaryData.FromBytes(Array.Empty()) + : isAsync + ? await BinaryData.FromStreamAsync(ContentStream, token).ConfigureAwait(false) + : BinaryData.FromStream(ContentStream); + + ContentStream?.Dispose(); + ContentStream = _buffered.ToStream(); + return _buffered; + } +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockRequestHeaders.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockRequestHeaders.cs new file mode 100644 index 000000000000..e03c4cd181bd --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockRequestHeaders.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Mock implementation of request headers. +/// +public class MockRequestHeaders : PipelineRequestHeaders +{ + private MockHeaders _headers = new(); + + /// + public override void Add(string name, string value) + => _headers.Add(name, value); + + /// + public override bool Remove(string name) + => _headers.Remove(name); + + /// + public override void Set(string name, string value) + => _headers.Set(name, value); + + /// + public override IEnumerator> GetEnumerator() + => _headers.GetEnumerator(); + + /// + public override bool TryGetValue(string name, out string? value) + => _headers.TryGetValue(name, out value); + + /// + public override bool TryGetValues(string name, out IEnumerable? values) + => _headers.TryGetValues(name, out values); +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockResponseHeaders.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockResponseHeaders.cs new file mode 100644 index 000000000000..aead0b4b84b6 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockResponseHeaders.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Mock implementation of response headers. +/// +public class MockResponseHeaders : PipelineResponseHeaders +{ + private MockHeaders _headers = new(); + + /// + public override IEnumerator> GetEnumerator() + => _headers.GetEnumerator(); + + /// + public override bool TryGetValue(string name, out string? value) + => _headers.TryGetValue(name, out value); + + /// + public override bool TryGetValues(string name, out IEnumerable? values) + => _headers.TryGetValues(name, out values); +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockRestService.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockRestService.cs new file mode 100644 index 000000000000..58420f679331 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockRestService.cs @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Concurrent; +using System.Net; +using System.Net.Sockets; +using System.Text.Json; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// Represents a mock REST service for testing purposes. +/// +/// The type of data stored in the service. +public class MockRestService : IDisposable +{ + /// + /// Represents an entry in the mock REST service. + /// + /// The ID of the entry. + /// The data associated with the entry. + public record Entry(string id, TData data) + { +#if NETFRAMEWORK + public Entry() : this(string.Empty, default!) + { + // .Net framework System.Text.Json cannot deserialize records without a parameterless constructor + } +#endif + }; + + /// + /// Represents an error in the mock REST service. + /// + /// The error code. + /// The error message. + /// The stack trace of the error. + public record Error(int error, string message, string? stack = null); + + private static readonly JsonSerializerOptions s_options = new() + { + WriteIndented = true, +#pragma warning disable SYSLIB0020 + IgnoreNullValues = true +#pragma warning restore SYSLIB0020 + }; + + private ConcurrentDictionary _data; + private HttpListener _listener; + private CancellationTokenSource _cts; + private Task _workerTask; + + /// + /// Initializes a new instance of the class. + /// + /// (Optional) The base path of the service. + /// (Optional) The port number to listen on. If set to 0, a port will be automatically selected. + public MockRestService(string? basePath = null, ushort port = 0) + { + _data = new(); + basePath = basePath?.EnsureEndsWith("/"); + + int maxAttempts = port == 0 ? 15 : 1; + Exception? ex = null; + for (int i = 0; _listener == null && i < maxAttempts; i++) + { + _listener = TryStartListener(basePath ?? string.Empty, port, out ex)!; + } + + if (_listener == null || ex != null) + { + throw new ApplicationException("Failed to start the mock rest service", ex); + } + + HttpEndpoint = TerminatePathWithSlash(new Uri(_listener.Prefixes.First())); + _cts = new(); + _workerTask = Task.Run(() => WorkerAsync(_cts.Token), _cts.Token); + } + + /// + /// Gets the HTTP endpoint of the mock REST service. + /// + public Uri HttpEndpoint { get; } + + /// + /// Gets all entries in the mock REST service. + /// + /// An enumerable collection of entries. + public virtual IEnumerable GetAll() + => _data.Select(kvp => new Entry(kvp.Key, kvp.Value)); + + /// + /// Tries to get an entry from the mock REST service. + /// + /// The ID of the entry to get. + /// When this method returns, contains the entry associated with the specified ID, if found; otherwise, null. + /// true if the entry was found; otherwise, false. + public virtual bool TryGet(string id, out Entry? entry) + { + if (_data.TryGetValue(id, out TData? value)) + { + entry = new(id, value); + return true; + } + + entry = null; + return false; + } + + /// + /// Tries to add an entry to the mock REST service. + /// + /// The ID of the entry to add. + /// The data associated with the entry. + /// When this method returns, contains the added entry, if successful; otherwise, null. + /// true if the entry was added successfully; otherwise, false. + public virtual bool TryAdd(string id, TData data, out Entry? entry) + { + entry = null; + + if (_data.TryAdd(id, data)) + { + entry = new(id, data); + return true; + } + + return false; + } + + /// + /// Tries to delete an entry from the mock REST service. + /// + /// The ID of the entry to delete. + /// true if the entry was deleted successfully; otherwise, false. + public virtual bool TryDelete(string id) + => _data.TryRemove(id, out _); + + /// + /// Tries to update an entry in the mock REST service. + /// + /// The ID of the entry to update. + /// The updated data for the entry. + /// When this method returns, contains the updated entry, if successful; otherwise, null. + /// true if the entry was updated successfully; otherwise, false. + public virtual bool TryUpdate(string id, TData data, out Entry? entry) + { + _data[id] = data; + entry = new(id, data); + return true; + } + + /// + /// Resets the mock REST service removing all entries. + /// + public virtual void Reset() + => _data.Clear(); + + /// + /// Disposes of the resources used by the mock REST service. + /// + public void Dispose() + { + _cts.Cancel(); + _listener.Stop(); + try { _workerTask.Wait(500); } catch { } + _listener.Close(); + _cts.Dispose(); + } + + /// + /// Worker method that handles incoming HTTP requests. + /// + /// The cancellation token. + protected virtual async Task WorkerAsync(CancellationToken token) + { + while (!token.IsCancellationRequested) + { + HttpListenerContext context = await _listener.GetContextAsync().ConfigureAwait(false); + HttpListenerRequest request = context.Request; + HttpListenerResponse response = context.Response; + + if (request == null || request.Url == null) + { + context.Response?.Abort(); + continue; + } + + try + { + response.ContentLength64 = 0; + + string? id = GetId(HttpEndpoint, request.Url); + switch (request.HttpMethod.ToUpperInvariant()) + { + case "GET": + if (id == null) + { + // Send down all data + IEnumerable allData = GetAll(); + WriteJsonResponse(response, 200, allData); + } + else if (TryGet(id, out Entry? entry) && entry != null) + { + WriteJsonResponse(response, 200, entry); + } + else + { + response.StatusCode = (int)HttpStatusCode.NotFound; + } + break; + + case "POST": + if (id == null) + { + response.StatusCode = (int)HttpStatusCode.BadRequest; + } + else + { + TData? data = ReadBody(request); + if (data == null) + { + response.StatusCode = (int)HttpStatusCode.GatewayTimeout; + } + else if (TryAdd(id, data, out Entry? entry)) + { + if (entry == null) + { + response.StatusCode = (int)HttpStatusCode.NoContent; + } + else + { + WriteJsonResponse(response, 200, entry); + } + } + else + { + response.StatusCode = (int)HttpStatusCode.Conflict; + } + } + break; + + case "PUT": + if (id == null) + { + response.StatusCode = (int)HttpStatusCode.BadRequest; + } + else + { + TData? data = ReadBody(request); + if (data == null) + { + response.StatusCode = (int)HttpStatusCode.GatewayTimeout; + } + else if (TryUpdate(id, data, out Entry? entry)) + { + if (entry == null) + { + response.StatusCode = (int)HttpStatusCode.NoContent; + } + else + { + WriteJsonResponse(response, 200, entry); + } + } + else + { + response.StatusCode = (int)HttpStatusCode.NotFound; + response.ContentLength64 = 0; + } + } + break; + + case "DELETE": + response.ContentLength64 = 0; + if (id == null) + { + response.StatusCode = (int)HttpStatusCode.BadRequest; + } + else if (TryDelete(id)) + { + response.StatusCode = (int)HttpStatusCode.NoContent; + } + else + { + response.StatusCode = (int)HttpStatusCode.NotFound; + } + break; + + default: + response.StatusCode = (int)HttpStatusCode.MethodNotAllowed; + break; + } + + response.Close(); + } + catch (Exception ex) + { + response.StatusCode = (int)HttpStatusCode.InternalServerError; + try + { + if (response.OutputStream.Length > 0 || response.OutputStream.CanSeek) + { + response.OutputStream.SetLength(0); + } + + if (response.OutputStream.Length == 0) + { + WriteJsonResponse( + response, + (int)HttpStatusCode.InternalServerError, + new Error( + 500, + ex.Message +#if DEBUG + , ex.StackTrace +#endif + )); + } + } + catch { /* we tried */ } + } + } + } + + private static ushort GetFreePort() + { + TcpListener? listener = null; + try + { + listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + return (ushort)((IPEndPoint)listener.LocalEndpoint).Port; + } + finally + { + listener?.Stop(); + } + } + + private static HttpListener? TryStartListener(string basePath, ushort port, out Exception? ex) + { + if (port == 0) + { + port = GetFreePort(); + } + + HttpListener? listener = null; + try + { + listener = new(); + listener.Prefixes.Add($"http://localhost:{port}/{basePath}"); + listener.Start(); + ex = null; + return listener; + } + catch (Exception e) + { + listener?.Close(); + ex = e; + return null; + } + } + + private static Uri TerminatePathWithSlash(Uri uri) + { + if (uri.IsAbsoluteUri) + { + if (!uri.AbsolutePath.EndsWith("/")) + { + UriBuilder builder = new(uri); + builder.Path += '/'; + return builder.Uri; + } + } + else if (!uri.OriginalString.EndsWith("/")) + { + return new Uri(uri.OriginalString + '/', UriKind.RelativeOrAbsolute); + } + + return uri; + } + + private static string? GetId(Uri baseUri, Uri requestUri) + { + Uri normalizedRequestUri = TerminatePathWithSlash(requestUri); + Uri relative = baseUri.MakeRelativeUri(normalizedRequestUri); + return relative.OriginalString.Split(["/"], StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(); + } + + private static TData? ReadBody(HttpListenerRequest request) + { + if (request.ContentLength64 == 0) + { + return default; + } + + return JsonHelpers.Deserialize(request.InputStream, s_options); + } + + private static void WriteJsonResponse(HttpListenerResponse response, int status, T data) + { + response.StatusCode = status; + + using MemoryStream buffer = new(); + JsonHelpers.Serialize(buffer, data, s_options); + buffer.Seek(0, SeekOrigin.Begin); + + response.ContentType = "application/json"; + response.ContentLength64 = buffer.Length; + buffer.CopyTo(response.OutputStream); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs b/sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs new file mode 100644 index 000000000000..a3fb851d3968 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Mocks/MockRestServiceClient.cs @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Globalization; +using System.Net.Http; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Mocks; + +/// +/// A client for . +/// +/// The type of data used by the client. +public class MockRestServiceClient : IDisposable +{ + private ClientPipeline _pipeline; + private Uri _baseUri; + + /// + /// Only used to generate a dynamic proxy for testing. Do not use this yourself. + /// + internal MockRestServiceClient() + { + _pipeline = null!; + _baseUri = null!; + } + + /// + /// Initializes a new instance of the class with the specified service URI and options. + /// + /// The service URI. + /// The client pipeline options. + public MockRestServiceClient(Uri serviceUri, ClientPipelineOptions? options = null) + { + _pipeline = ClientPipeline.Create(options); + _baseUri = serviceUri ?? throw new ArgumentNullException(nameof(serviceUri)); + } + + /// + /// Adds data asynchronously to the service with the specified ID. + /// + /// The ID of the data. + /// The data to add. + /// The cancellation token. + /// A task representing the asynchronous operation. + public virtual Task AddAsync(string id, TData data, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + ValidateData(data); + return SendSyncOrAsync(true, HttpMethod.Post, id, data, token).AsTask(); + } + + /// + /// Adds data synchronously to the service with the specified ID. + /// + /// The ID of the data. + /// The data to add. + /// The cancellation token. + /// The result of the operation. + public virtual ClientResult Add(string id, TData data, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + ValidateData(data); + return SendSyncOrAsync(false, HttpMethod.Post, id, data, token).GetAwaiter().GetResult(); + } + + /// + /// Gets data asynchronously from the service with the specified ID. Will return null if the data does not exist. + /// + /// The ID of the data. + /// The cancellation token. + /// A task representing the asynchronous operation. + public virtual async Task> GetAsync(string id, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + try + { + ClientResult result = await SendSyncOrAsync(true, HttpMethod.Get, id, default, token) + .ConfigureAwait(false); + + var response = result.GetRawResponse(); + return ClientResult.FromOptionalValue( + response.Content.ToObjectFromJson.Entry>().data, + response); + } + catch (ClientResultException ex) + { + if (ex.GetRawResponse()?.Status == 404) + { + return ClientResult.FromOptionalValue(default, ex.GetRawResponse()!); + } + + throw; + } + } + + /// + /// Gets data synchronously from the service with the specified ID. Will return null if the data does not exist. + /// + /// The ID of the data. + /// The cancellation token. + /// The result of the operation. + public virtual ClientResult Get(string id, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + try + { + ClientResult result = SendSyncOrAsync(false, HttpMethod.Get, id, default, token).GetAwaiter().GetResult(); + var response = result.GetRawResponse(); + return ClientResult.FromOptionalValue( + response.Content.ToObjectFromJson.Entry>().data, + response); + } + catch (ClientResultException ex) + { + if (ex.GetRawResponse()?.Status == 404) + { + return ClientResult.FromOptionalValue(default, ex.GetRawResponse()!); + } + + throw; + } + } + + /// + /// Removes data asynchronously from the service with the specified ID. + /// + /// The ID of the data. + /// The cancellation token. + /// A task representing the asynchronous operation. + public virtual async Task> RemoveAsync(string id, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + try + { + ClientResult result = await SendSyncOrAsync(true, HttpMethod.Delete, id, default, token); + return ClientResult.FromValue(true, result.GetRawResponse()); + } + catch (ClientResultException ex) + { + if (ex.GetRawResponse()?.Status == 404) + { + return ClientResult.FromValue(false, ex.GetRawResponse()!); + } + + throw; + } + } + + /// + /// Removes data synchronously from the service with the specified ID. + /// + /// The ID of the data. + /// The cancellation token. + /// The result of the operation. + public virtual ClientResult Remove(string id, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(id)) + throw new ArgumentException("Value cannot be null or whitespace.", nameof(id)); + + try + { + ClientResult result = SendSyncOrAsync(false, HttpMethod.Delete, id, default, token).GetAwaiter().GetResult(); + return ClientResult.FromValue(true, result.GetRawResponse()); + } + catch (ClientResultException ex) + { + if (ex.GetRawResponse()?.Status == 404) + { + return ClientResult.FromValue(false, ex.GetRawResponse()!); + } + + throw; + } + } + + /// + /// Disposes of the resources used by the client. + /// + public virtual void Dispose() + { + // no obvious way to dispose of the pipeline, nor the inner transport + } + + /// + /// Validates the data before sending it to the service. + /// + /// The data to validate. + protected virtual void ValidateData(TData? data) + { + if (data == null) + { + throw new ArgumentNullException(nameof(data)); + } + } + + /// + /// Sends the request to the service synchronously or asynchronously. This will serialize the passed in data to JSON using the default + /// serializer. + /// + /// Indicates whether the request should be sent asynchronously. + /// The HTTP method. + /// The ID of the data. + /// The data to send. + /// The cancellation token. + /// The result of the operation. + protected async ValueTask SendSyncOrAsync(bool isAsync, HttpMethod method, string? id, TData? data, CancellationToken token) + { + UriBuilder builder = new(_baseUri); + if (id != null) + { + builder.Path += id; + } + + PipelineMessage message = _pipeline.CreateMessage(); + message.Request.Method = method.Method; + message.Request.Uri = builder.Uri; + message.Apply(new RequestOptions() + { + CancellationToken = token, + BufferResponse = true + }); + + if (data == null) + { + message.Request.Headers.Set("Content-Length", "0"); + } + else + { + using MemoryStream stream = new(); + JsonHelpers.Serialize(stream, data); + var binaryData = BinaryData.FromBytes(new ReadOnlyMemory(stream.GetBuffer(), 0, (int)stream.Length)); + + message.Request.Headers.Set("Content-Length", stream.Length.ToString(CultureInfo.InvariantCulture)); + message.Request.Headers.Set("Content-Type", "application/json"); + message.Request.Content = BinaryContent.Create(binaryData); + } + + if (isAsync) + { + await _pipeline.SendAsync(message).ConfigureAwait(false); + } + else + { + _pipeline.Send(message); + } + + if (message.Response?.IsError == true) + { + if (message.Response.Content?.ToMemory().Length > 0) + { + var error = message.Response.Content.ToObjectFromJson.Error>(); + throw new ClientResultException($"Error {error.error}: {error.message}", message.Response); + } + + throw new ClientResultException(message.Response); + } + + return ClientResult.FromResponse(message.Response!); + } +} diff --git a/sdk/openai/tools/TestFramework/src/OpenAI.TestFramework.csproj b/sdk/openai/tools/TestFramework/src/OpenAI.TestFramework.csproj new file mode 100644 index 000000000000..dc92fd798ff7 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/OpenAI.TestFramework.csproj @@ -0,0 +1,39 @@ + + + + $(RequiredTargetFrameworks) + enable + enable + latest + + + + + Utils\Polyfill\%(RecursiveDir)\%(Filename).cs + + + + + + + + + + + + + + 0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7 + + + + + + + <_Parameter1>TestProxyPath + <_Parameter2>$(NuGetPackageRoot)\azure.sdk.tools.testproxy\$(TestProxyVersion)\tools\net6.0\any\Azure.Sdk.Tools.TestProxy.dll + + + + diff --git a/sdk/openai/tools/TestFramework/src/RecordedClientTestBase.cs b/sdk/openai/tools/TestFramework/src/RecordedClientTestBase.cs new file mode 100644 index 000000000000..27d6ca2e7b2e --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/RecordedClientTestBase.cs @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Diagnostics; +using System.Net; +using System.Text; +using NUnit.Framework; +using NUnit.Framework.Internal; +using OpenAI.TestFramework.Recording; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.Proxy.Service; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework; + +/// +/// Base class for client test cases that supports recording and playback of HTTP/HTTPS REST requests. This recording +/// support is provided by use of the Test Proxy . +/// This provides the basic framework to start the Test Proxy, create a recording for a test or playback a recording +/// for a test. It also provides support for automatic testing of async and sync versions of methods (see +/// for more details). +/// +[NonParallelizable] +public abstract class RecordedClientTestBase : ClientTestBase +{ + /// + /// Invalid characters that will be removed from test names when creating recordings. + /// + /// + /// Using Windows version as it is the most restrictive of all platforms: + /// + /// + protected static readonly ISet s_invalidChars = new HashSet() + { + '\"', '<', '>', '|', '\0', + (char)1, (char)2, (char)3, (char)4, (char)5, (char)6, (char)7, (char)8, (char)9, (char)10, + (char)11, (char)12, (char)13, (char)14, (char)15, (char)16, (char)17, (char)18, (char)19, (char)20, + (char)21, (char)22, (char)23, (char)24, (char)25, (char)26, (char)27, (char)28, (char)29, (char)30, + (char)31, ':', '*', '?', '\\', '/' + }; + + private DateTimeOffset _testStartTime; + private TestRecordingOptions _options; + + /// + /// Creates a new instance. + /// + /// True to run the async version of a test, false to run the sync version of a test. + public RecordedClientTestBase(bool isAsync) : this(isAsync, null) + { } + + /// + /// Creates a new instance. + /// + /// True to run the async version of a test, false to run the sync version of a test. + /// (Optional) The recorded test mode to use. If unset, the default recorded test mode will be used. + public RecordedClientTestBase(bool isAsync, RecordedTestMode? mode = null) : base(isAsync) + { + _options = new TestRecordingOptions(); + Mode = mode ?? GetDefaultRecordedTestMode(); + } + + /// + public override DateTimeOffset TestStartTime => _testStartTime; + + /// + /// Gets the test proxy instance to use for the current test case. + /// + public ProxyService? Proxy { get; protected internal set; } + + /// + /// Gets or sets the current recording mode for the test. + /// + public RecordedTestMode Mode { get; set; } + + /// + /// Gets or sets the recording options to use for the current test. This will be pre-populated with a sensible configuration. + /// + public TestRecordingOptions RecordingOptions + { + get => _options; + set => _options = value ?? throw new ArgumentNullException(nameof(value)); + } + + /// + /// Gets the recording for the current test. + /// + public TestRecording? Recording { get; protected internal set; } + + /// + /// Gets the maximum amount of time to wait for starting/tearing down the test proxy, as well as the maximum amount of time + /// to wait for configuring a recording session, and then saving it or closing it. + /// + public virtual TimeSpan TestProxyWaitTime => Debugger.IsAttached + ? Default.DebuggerAttachedTestTimeout + : Default.TestProxyWaitTime; + + /// + /// Gets the test timeout. + /// + public override TimeSpan TestTimeout + { + get + { + if (Debugger.IsAttached) + { + return Default.DebuggerAttachedTestTimeout; + } + + switch (Mode) + { + default: + case RecordedTestMode.Record: + case RecordedTestMode.Live: + return TimeSpan.FromSeconds(60); + + case RecordedTestMode.Playback: + return Default.TestTimeout; + } + } + } + + /// + /// Determines whether or not to use Fiddler. If this is true, then the recording transport will be updated to use Fiddler + /// as the intermediary when talking to the test proxy, as well as accept the Fiddler root certificate. + /// + public virtual bool UseFiddler + { + get + { + // Check to see if Fiddler is already running and capturing traffic by checking to see if a proxy is configured for + // 127.0.0.1:8888 with no credentials + try + { + Uri dummyUri = new("https://not.a.real.uri.com"); + + IWebProxy webProxy = WebRequest.GetSystemWebProxy(); + Uri? proxyUri = webProxy?.GetProxy(dummyUri); + if (proxyUri == null || proxyUri == dummyUri) + { + return false; + } + + // assume default of 127.0.0.1:8888 with no credentials + var cred = webProxy?.Credentials?.GetCredential(dummyUri, string.Empty); + return proxyUri.Host == "127.0.0.1" + && proxyUri.Port == 8888 + && string.IsNullOrWhiteSpace(cred?.UserName) + && string.IsNullOrWhiteSpace(cred?.Password); + } + catch + { + return false; + } + } + } + + /// + /// Checks if the recording has a recorded value for . If there is none, the + /// will be added and return. Otherwise the existing value will be returned. + /// + /// The name of the value. + /// The value to add. + /// The existing value, or the newly added value. + /// If you called this function outside of a test run. + public string? GetOrAddRecordedValue(string name, string valueToAdd) + => GetOrAddRecordedValue(name, () => valueToAdd); + + /// + /// Checks if the recording has a recorded value for . If there is none, a value will be created, added + /// and returned. Otherwise the existing value will be returned. + /// + /// The name of the value. + /// The factory used to create the value. + /// The existing value, or the newly added value. + /// If you called this function outside of a test run. + public virtual string GetOrAddRecordedValue(string name, Func valueFactory) + { + if (Recording == null) + { + throw new InvalidOperationException("Recorded value should not be retrieved outside the test method invocation"); + } + + return Recording.GetOrAddVariable(name, valueFactory); + } + + /// + /// Starts the test proxy for the current test. This will be called once at the start of the test fixture. + /// + /// Asynchronous task. + [OneTimeSetUp] + public virtual async Task StartTestProxyAsync() + { + using CancellationTokenSource cts = new(TestProxyWaitTime); + + ProxyServiceOptions options = CreateProxyServiceOptions(); + Proxy = await ProxyService.CreateNewAsync(options, cts.Token).ConfigureAwait(false); + } + + [OneTimeTearDown] + public virtual Task StopTestProxyAsync() + { + Proxy?.Dispose(); + Proxy = null; + + //TODO FIXME: Do we need to do any cleanup here? + return Task.CompletedTask; + } + + /// + /// Starts the test proxy (if it has not already been started), and then configures the recording session for the current + /// test. This should also set the property to the new recording session. + /// + /// Asynchronous task. + [SetUp] + public virtual async Task StartTestRecordingAsync() + { + // Check if the current NUnit test method has a specific attribute applied to it + if (!IsCurrentTestRecorded()) + { + return; + } + + if (Proxy == null) + { + throw new InvalidOperationException("The proxy service was not set and/or started"); + } + + _testStartTime = DateTimeOffset.UtcNow; + + // TODO FIXME: Add logic to ignore certain tests here by throwing IgnoreException()? + + using CancellationTokenSource cts = new(TestProxyWaitTime); + Recording = await StartAndConfigureRecordingSessionAsync(Proxy, cts.Token).ConfigureAwait(false); + + // don't include test proxy overhead as part of the test time + _testStartTime = DateTimeOffset.UtcNow; + } + + /// + /// Stops a recording session for the current test. If the test passed and we are in recording mode, the recording will be saved, + /// otherwise it will be discarded. + /// + /// Asynchronous task. + [TearDown] + public virtual async Task StopTestRecordingAsync() + { + if (!IsCurrentTestRecorded()) + { + return; + } + + bool testsPassed = TestContext.CurrentContext.Result.Outcome.Status == NUnit.Framework.Interfaces.TestStatus.Passed; + using CancellationTokenSource cts = new(TestProxyWaitTime); + + if (Recording != null) + { + await Recording.FinishAsync(testsPassed, cts.Token).ConfigureAwait(false); + } + } + + /// + /// Configures the client options for a System.ClientModel based service client. This will be used to configure the transport + /// such that all requests are routed to the test proxy during recording (for capture), and playback (for replaying captured + /// requests). + /// + /// The type of the client options. + /// The options to configure. + /// The configured client options. + /// The current recording mode is not supported. + /// There was no test recording configured for this test. + public virtual TClientOptions ConfigureClientOptions(TClientOptions options) + where TClientOptions : ClientPipelineOptions + { + if (!IsCurrentTestRecorded()) + { + return options; + } + + // If we are in playback, or record mode we should set the transport to the test proxy transport, except + // in the case where we've explicitly specified the transport ourselves in case we are doing some custom + // work. + if (options.Transport != null) + { + return options; + } + + switch (Mode) + { + case RecordedTestMode.Live: + // no need to to anything special + return options; + + case RecordedTestMode.Record: + // continue + break; + + case RecordedTestMode.Playback: + // force the use of a fixed retry with a short timeout + options.RetryPolicy = new TestClientRetryPolicy(delay: TimeSpan.FromMilliseconds(100)); + break; + + default: + throw new NotSupportedException("The following mode is not supported: " + Mode); + } + + if (Recording == null) + { + throw new InvalidOperationException("Please call this from within a test method invocation"); + } + + ProxyTransportOptions transportOptions = Recording.GetProxyTransportOptions(); + transportOptions.UseFiddler = UseFiddler; + if (_options.RequestOverride != null) + { + transportOptions.ShouldRecordRequest = _options.RequestOverride; + } + + options.Transport = new ProxyTransport(transportOptions); + return options; + } + + /// + /// Gets the default recorded test mode to use. + /// + /// The test mode to use. + protected virtual RecordedTestMode GetDefaultRecordedTestMode() => RecordedTestMode.Playback; + + /// + /// Gets the name of recording JSON file that contains the recording. This will be based on a sanitized version + /// of test name, and "Async" will be automatically appended when running the asynchronous versions of tests. + /// + /// The name of the test to use. + protected virtual string GetRecordedTestFileName() + { + const string c_asyncSuffix = "Async"; + TestContext.TestAdapter testAdapter = TestContext.CurrentContext.Test; + + StringBuilder builder = new(testAdapter.Name.Length + c_asyncSuffix.Length); + foreach (char c in testAdapter.Name) + { + builder.Append(s_invalidChars.Contains(c) ? '%' : c); + } + + if (IsAsync) + { + builder.Append(c_asyncSuffix); + } + + builder.Append(".json"); + + return builder.ToString(); + } + + /// + /// Configures a recording/playback session for the current test on the test proxy. This is called at the start of every test. + /// It is responsible for configuring all the necessary sanitizers, matchers, and transforms for the test proxy. + /// + /// The test proxy service to configure the recording session for. + /// The cancellation token to use. + /// The configured test recording session. + /// The test proxy service instance did not have a valid client configured. + /// The recording mode is not supported. + protected virtual async Task StartAndConfigureRecordingSessionAsync(ProxyService proxy, CancellationToken token) + { + var client = proxy.Client ?? throw new ArgumentNullException("Test proxy client was null"); + IDictionary? variables = null; + + ProxyClientResult result; + switch (Mode) + { + case RecordedTestMode.Live: + // nothing to see here + return new TestRecording(string.Empty, RecordedTestMode.Live, proxy); + + case RecordedTestMode.Playback: + var playbackResult = await client.StartPlaybackAsync(CreateRecordingSessionStartInfo(), token).ConfigureAwait(false); + variables = playbackResult.Value; + result = playbackResult; + break; + + case RecordedTestMode.Record: + result = await client.StartRecordingAsync(CreateRecordingSessionStartInfo(), token).ConfigureAwait(false); + break; + + default: + throw new NotSupportedException("Don't know how to handle recording mode: " + Mode); + } + + string? recordingId = result.RecordingId; + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new InvalidOperationException("Recording test proxy did not return a recording ID"); + } + + TestRecording recording = new TestRecording(recordingId!, Mode, proxy, variables); + await recording.ApplyOptions(_options, token).ConfigureAwait(false); + return recording; + } + + /// + /// Determines whether or not the current test should be recorded (or played back from a file). + /// + /// True to enable the use of the recording test proxy, false otherwise. + protected virtual bool IsCurrentTestRecorded() + { + return TestExecutionContext.CurrentContext.CurrentTest.GetCustomAttributes(true).Any(); + } + + /// + /// Creates the options used when starting a new instance of the test proxy service. + /// + /// The options to use. + protected abstract ProxyServiceOptions CreateProxyServiceOptions(); + + /// + /// Creates the information used to configured a recording/playback session for the current test on the test proxy. + /// + /// The information to use. + protected abstract RecordingStartInformation CreateRecordingSessionStartInfo(); +} diff --git a/sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs b/sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs new file mode 100644 index 000000000000..81d94268cac9 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/RecordedTestAttribute.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; + +namespace OpenAI.TestFramework; + +/// +/// An attribute used to indicate that a test should be recorded (or played back from a file). When you inherit from +/// in your test class, and add this attribute to your test function, and then +/// make sure to call +/// on the client options you use to configure a client, this should automatically enable the recording/playback +/// functionality. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] +public class RecordedTestAttribute : TestAttribute +{ +} diff --git a/sdk/openai/tools/TestFramework/src/RecordedTestMode.cs b/sdk/openai/tools/TestFramework/src/RecordedTestMode.cs new file mode 100644 index 000000000000..bc0371ccf5f9 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/RecordedTestMode.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework; + +/// +/// The recording mode. +/// +public enum RecordedTestMode +{ + /// + /// Talk to live services. No recording or playback is used. + /// + Live, + + /// + /// Record the test and overwrite any existing recordings. + /// + Record, + + /// + /// Playback the test from a recording. + /// + Playback, +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Condition.cs b/sdk/openai/tools/TestFramework/src/Recording/Condition.cs new file mode 100644 index 000000000000..6b0bdad00b0e --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Condition.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording; + +/// +/// A condition used to evaluate whether or not a sanitizer should be applied. +/// +public class Condition +{ + /// Gets or sets the uri regex. + public string? UriRegex { get; set; } + + /// Header condition to apply. + public HeaderCondition? ResponseHeader { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/HeaderCondition.cs b/sdk/openai/tools/TestFramework/src/Recording/HeaderCondition.cs new file mode 100644 index 000000000000..12d2ba55cef6 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/HeaderCondition.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording; + +/// +/// Header condition to apply. +/// +public class HeaderCondition +{ + /// Gets or sets the key. + public string? Key { get; set; } + /// Gets or sets the value regex. + public string? ValueRegex { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Matchers/BaseMatcher.cs b/sdk/openai/tools/TestFramework/src/Recording/Matchers/BaseMatcher.cs new file mode 100644 index 000000000000..c4578d763bf7 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Matchers/BaseMatcher.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.Matchers; + +/// +/// The base class for matchers that are applied during a playback session to match an incoming request +/// to a recorded one. +/// +public abstract class BaseMatcher : IUtf8JsonSerializable +{ + /// + /// Creates a new instance. + /// + /// The type of this sanitizer (e.g. GeneralRegexSanitizer). + /// If the type was null. + protected BaseMatcher(string type) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + } + + /// + /// Gets the type of the matcher (e.g. BodilessMatcher). + /// + [JsonIgnore] + public string Type { get; } + + /// + public virtual void Write(Utf8JsonWriter writer, JsonSerializerOptions? options = null) + { + // By default use reflection based serialization + JsonSerializer.Serialize(writer, this, GetType(), Default.InnerRecordingJsonOptions); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Matchers/CustomMatcher.cs b/sdk/openai/tools/TestFramework/src/Recording/Matchers/CustomMatcher.cs new file mode 100644 index 000000000000..80e0f1b6d41b --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Matchers/CustomMatcher.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Matchers; + +/// +/// This matcher exposes the default matcher in a customizable way. Currently this merely includes enabling/disabling body match and +/// adding additional excluded headers. All optional settings are safely defaulted. This means that providing zero additional +/// configuration will produce a sanitizer that is functionally identical to the default. +/// +public class CustomMatcher() : BaseMatcher("CustomDefaultMatcher") +{ + /// + /// A comma separated list of additional headers that should be excluded during matching. "Excluded" headers are entirely ignored. + /// Unlike "ignored" headers, the presence (or lack of presence) of a header will not cause mismatch. + /// + public string? ExcludedHeaders { get; set; } + + /// + /// Should the body value be compared during lookup operations? + /// + public bool? CompareBodies { get; set; } + + /// + /// A comma separated list of additional headers that should be ignored during matching. Any headers that are "ignored" will not + /// do value comparison when matching. This means that if the recording has a header that isn't in the request, a test mismatch + /// exception will be thrown noting the lack of header in the request. This also applies if the header is present in the request + /// but not recording. + /// + public string? IgnoredHeaders { get; set; } + + /// + /// A comma separated list of query parameters that should be ignored during matching. + /// + public string? IgnoredQueryParameters { get; set; } + + /// + /// By default, the test-proxy does not sort query params before matching. Setting true will sort query params alphabetically + /// before comparing URI. + /// + public bool? IgnoreQueryOrdering { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Matchers/ExistingMatcher.cs b/sdk/openai/tools/TestFramework/src/Recording/Matchers/ExistingMatcher.cs new file mode 100644 index 000000000000..8d2cb4eab40f --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Matchers/ExistingMatcher.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; + +namespace OpenAI.TestFramework.Recording.Matchers; + +/// +/// Used for specifying the use of pre-existing matchers defined in the test proxy. +/// +/// The name of the existing matcher. +public class ExistingMatcher(string existingMatcherName) : BaseMatcher(existingMatcherName) +{ + private static ExistingMatcher? _bodiless = null; + private static ExistingMatcher? _headerless = null; + + /// + /// This matcher adjusts the "match" operation to EXCLUDE the body when matching a request to a recording's entries. + /// + public static ExistingMatcher Bodiless => _bodiless ??= new ExistingMatcher("BodilessMatcher"); + + /// + /// NOT RECOMMENDED. This matcher adjusts the "match" operation to ignore header differences when matching a request. + /// Be aware that wholly ignoring headers during matching might incur unexpected issues down the line. + /// + public static ExistingMatcher Headerless => _headerless ??= new ExistingMatcher("HeaderlessMatcher"); + + /// + public override void Write(Utf8JsonWriter writer, JsonSerializerOptions? options = null) + { + // Pre-existing matchers use an empty JSON object. + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClient.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClient.cs new file mode 100644 index 000000000000..55660d990b2b --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClient.cs @@ -0,0 +1,679 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Net.Http; +using System.Text.Json; +using OpenAI.TestFramework.Recording.Matchers; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.Proxy.Service; +using OpenAI.TestFramework.Recording.Sanitizers; +using OpenAI.TestFramework.Recording.Transforms; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.RecordingProxy; + +/// +/// A client for configuring the recording text proxy. Please see here for more information: +/// https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md +/// +public class ProxyClient +{ + protected internal const string X_RECORDING_ID_HEADER = "x-recording-id"; + + private ProxyClientOptions _options; + private ClientPipeline _pipeline; + + /// + /// For testing only. + /// + internal ProxyClient() + { + _options = new(new Uri("http://localhost:0")); + _pipeline = ClientPipeline.Create(); + } + + /// + /// Creates a new instance. + /// + /// The options to use. + public ProxyClient(ProxyClientOptions options) + { + _options = options ?? throw new ArgumentNullException(nameof(options)); + _pipeline = ClientPipeline.Create(options); + } + + /// + /// Starts playback session of recordings. + /// + /// The configuration to use for starting playback. + /// The cancellation token to use. + /// The result that includes any recorded variables. + public virtual ProxyClientResult> StartPlayback(RecordingStartInformation startInfo, CancellationToken token = default) + { + if (startInfo == null) + { + throw new ArgumentNullException(nameof(startInfo)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "playback/start", startInfo, token); + return SendSyncOrAsync>(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Starts playback session of recordings asynchronously. + /// + /// The configuration to use for starting playback. + /// The cancellation token to use. + /// The result that includes any recorded variables. + public virtual async Task>> StartPlaybackAsync(RecordingStartInformation startInfo, CancellationToken token = default) + { + if (startInfo == null) + { + throw new ArgumentNullException(nameof(startInfo)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "playback/start", startInfo, token); + return await SendSyncOrAsync>(true, message, token).ConfigureAwait(false); + } + + /// + /// Stops a playback session. + /// + /// The ID for the playback session to stop. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult StopPlayback(string recordingId, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "playback/stop", null, token, new() + { + [X_RECORDING_ID_HEADER] = recordingId, + }); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Stops a playback session asynchronously. + /// + /// The ID for the playback session to stop. + /// The cancellation token to use. + /// The client result. + public virtual async Task StopPlaybackAsync(string recordingId, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "playback/stop", null, token, new() + { + [X_RECORDING_ID_HEADER] = recordingId, + }); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Starts a recording session. + /// + /// The configuration to use for the recording session. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult StartRecording(RecordingStartInformation startInfo, CancellationToken token = default) + { + if (startInfo == null) + { + throw new ArgumentNullException(nameof(startInfo)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "record/start", startInfo, token); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Starts a recording session asynchronously. + /// + /// The configuration to use for the recording session. + /// The cancellation token to use. + /// The client result. + public virtual async Task StartRecordingAsync(RecordingStartInformation startInfo, CancellationToken token = default) + { + if (startInfo == null) + { + throw new ArgumentNullException(nameof(startInfo)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "record/start", startInfo, token); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Stops a recording session. + /// + /// The identifier for the recording session. + /// (Optional) Any additional variables to include with the recording. + /// (Optional) Set this to true to turn off recording. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult StopRecording(string recordingId, IDictionary? variables = null, bool skipRecording = false, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + + Dictionary additionalHeaders = new() + { + [X_RECORDING_ID_HEADER] = recordingId + }; + + if (skipRecording) + { + additionalHeaders["x-recording-skip"] = "request-response"; + } + + variables ??= new Dictionary(); + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "record/stop", variables, token, additionalHeaders); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Stops a recording session asynchronously. + /// + /// The ID for the recording session to stop. + /// (Optional) Any additional variables to include with the recording. + /// (Optional) Set this to true to turn off recording. + /// The cancellation token to use. + /// The client result. + public virtual async Task StopRecordingAsync(string recordingId, IDictionary? variables = null, bool skipRecording = false, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + + Dictionary additionalHeaders = new() + { + [X_RECORDING_ID_HEADER] = recordingId + }; + + if (skipRecording) + { + additionalHeaders["x-recording-skip"] = "request-response"; + } + + variables ??= new Dictionary(); + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "record/stop", variables, token, additionalHeaders); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Sets options for the proxy. + /// + /// The identifier for the playback/recording session. + /// The options to set. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult SetRecordingTransportOptions(string recordingId, ProxyServiceOptions options, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + else if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/setrecordingoptions", options, token, new() + { + [X_RECORDING_ID_HEADER] = recordingId, + }); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Sets options for the proxy asynchronously. + /// + /// The identifier for the playback/recording session. + /// The options to set. + /// The cancellation token to use. + /// The client result. + public virtual async Task SetRecordingTransportOptionsAsync(string recordingId, ProxyServiceOptions options, CancellationToken token = default) + { + if (string.IsNullOrWhiteSpace(recordingId)) + { + throw new ArgumentException("Recording ID cannot be null, empty, or white space only"); + } + else if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/setrecordingoptions", options, token, new() + { + [X_RECORDING_ID_HEADER] = recordingId, + }); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Removes some pre-defined sanitizers to be used during recording/playback by specifying their IDs. + /// + /// The set of sanitizer IDs to remove. + /// (Optional) If specified, the sanitizers will be removed for a particular session only. + /// If null, the sanitizers will be removed globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult RemoveSanitizers(ISet sanitizerIds, string? recordingId = null, CancellationToken token = default) + { + if (sanitizerIds == null) + { + throw new ArgumentNullException(nameof(sanitizerIds)); + } + + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest( + HttpMethod.Post, + "admin/removesanitizers", + new SanitizerIdList() { Sanitizers = sanitizerIds.ToArray() }, + token, + headers); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Removes some pre-defined sanitizers to be used during recording/playback by specifying their IDs. + /// + /// The set of sanitizer IDs to remove. + /// (Optional) If specified, the sanitizers will be removed for a particular session only. + /// If null, the sanitizers will be removed globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual async Task RemoveSanitizersAsync(ISet sanitizerIds, string? recordingId = null, CancellationToken token = default) + { + if (sanitizerIds == null) + { + throw new ArgumentNullException(nameof(sanitizerIds)); + } + + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest( + HttpMethod.Post, + "admin/removesanitizers", + new SanitizerIdList() { Sanitizers = sanitizerIds.ToArray() }, + token, + headers); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Adds sanitizers for the recording test proxy. + /// + /// The sanitizers to add. + /// (Optional) If specified, the sanitizers will added for a particular session only. + /// If null, the sanitizers will be added globally on the test proxy. + /// The cancellation token to use. + /// The client result with the set of sanitizer IDs added. + public virtual ProxyClientResult> AddSanitizers(IEnumerable sanitizers, string? recordingId = null, CancellationToken token = default) + { + if (sanitizers == null) + { + throw new ArgumentNullException(nameof(sanitizers)); + } + + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "Admin/AddSanitizers", sanitizers, token, headers); + ProxyClientResult result = SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + return new ProxyClientResult>( + result.Value.Sanitizers ?? Array.Empty(), + result.GetRawResponse()); + } + + /// + /// Adds sanitizers for the recording test proxy asynchronously. + /// + /// The sanitizers to add. + /// (Optional) If specified, the sanitizers will added for a particular session only. + /// If null, the sanitizers will be added globally on the test proxy. + /// The cancellation token to use. + /// The client result with the set of sanitizer IDs added. + public virtual async Task>> AddSanitizersAsync(IEnumerable sanitizers, string? recordingId = null, CancellationToken token = default) + { + if (sanitizers == null) + { + throw new ArgumentNullException(nameof(sanitizers)); + } + + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "Admin/AddSanitizers", sanitizers, token, headers); + ProxyClientResult result = await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + return new ProxyClientResult>( + result.Value.Sanitizers ?? Array.Empty(), + result.GetRawResponse()); + } + + /// + /// Sets the matcher to use. + /// + /// The matcher to use. + /// (Optional) If specified, the matcher will be set for a particular session only. + /// If null, the matcher will be set globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult SetMatcher(BaseMatcher matcher, string? recordingId = null, CancellationToken token = default) + { + if (matcher == null) + { + throw new ArgumentNullException(nameof(matcher)); + } + + Dictionary headers = new() + { + ["x-abstraction-identifier"] = matcher.Type + }; + + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/setmatcher", matcher, token, headers); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Sets the matcher to use asynchronously. + /// + /// The matcher to use. + /// (Optional) If specified, the matcher will be set for a particular session only. + /// If null, the matcher will be set globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual async Task SetMatcherAsync(BaseMatcher matcher, string? recordingId = null, CancellationToken token = default) + { + if (matcher == null) + { + throw new ArgumentNullException(nameof(matcher)); + } + + Dictionary headers = new() + { + ["x-abstraction-identifier"] = matcher.Type + }; + + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/setmatcher", matcher, token, headers); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Adds a transform. + /// + /// The transform to add. + /// (Optional) If specified, the transform will be added for a particular session only. + /// If null, the transform will be added globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult AddTransform(BaseTransform transform, string? recordingId = null, CancellationToken token = default) + { + if (transform == null) + { + throw new ArgumentNullException(nameof(transform)); + } + + Dictionary headers = new() + { + ["x-abstraction-identifier"] = transform.Type + }; + + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/addtransform", transform, token, headers); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Adds a transform asynchronously. + /// + /// The transform to add. + /// (Optional) If specified, the transform will be added for a particular session only. + /// If null, the transform will be added globally on the test proxy. + /// The cancellation token to use. + /// The client result. + public virtual async Task AddTransformAsync(BaseTransform transform, string? recordingId = null, CancellationToken token = default) + { + if (transform == null) + { + throw new ArgumentNullException(nameof(transform)); + } + + Dictionary headers = new() + { + ["x-abstraction-identifier"] = transform.Type + }; + + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "admin/addtransform", transform, token, headers); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Resets the sanitizers, matcher, and transforms to the default. + /// + /// (Optional) If specified, only the particular session will be reset. + /// If null, the reset will apply globally. + /// The cancellation token to use. + /// The client result. + public virtual ProxyClientResult Reset(string? recordingId = null, CancellationToken token = default) + { + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "Admin/Reset", null, token, headers); + return SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + } + + /// + /// Resets the sanitizers, matcher, and transforms to the default asynchronously. + /// + /// (Optional) If specified, only the particular session will be reset. + /// If null, the reset will apply globally. + /// The cancellation token to use. + /// The client result. + public virtual async Task ResetAsync(string? recordingId = null, CancellationToken token = default) + { + Dictionary headers = new(); + if (recordingId != null) + { + headers[X_RECORDING_ID_HEADER] = recordingId; + } + + PipelineMessage message = CreateJsonRequest(HttpMethod.Post, "Admin/Reset", null, token, headers); + return await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + } + + /// + /// Lists the available sanitizers, matchers, and transforms. + /// + /// The cancellation token. + /// The client result with the HTML returned from the service. + public virtual ProxyClientResult ListAvailable(CancellationToken token = default) + { + PipelineMessage message = CreateJsonRequest(HttpMethod.Get, "Info/Available", null, token); + ProxyClientResult result = SendSyncOrAsync(false, message, token).GetAwaiter().GetResult(); + return new ProxyClientResult(result.GetRawResponse().Content.ToString(), result.GetRawResponse()); + } + + /// + /// Lists the available sanitizers, matchers, and transforms asynchronously. + /// + /// The cancellation token. + /// The client result with the HTML returned from the service. + public virtual async Task> ListAvailableAsync(CancellationToken token = default) + { + PipelineMessage message = CreateJsonRequest(HttpMethod.Get, "Info/Available", null, token); + ProxyClientResult result = await SendSyncOrAsync(true, message, token).ConfigureAwait(false); + return new ProxyClientResult(result.GetRawResponse().Content.ToString(), result.GetRawResponse()); + } + + protected virtual PipelineMessage CreateJsonRequest(HttpMethod method, string path, TBody? body, CancellationToken token, Dictionary? headers = null) + { + PipelineMessage message = _pipeline.CreateMessage(); + message.Apply(new RequestOptions + { + CancellationToken = token, + BufferResponse = true + }); + + PipelineRequest request = message.Request; + request.Method = method.Method; + request.Uri = new Uri(_options.HttpEndpoint, path); + request.Headers.Add("Accept", "application/json"); + + if (headers != null) + { + foreach (var kvp in headers) + { + request.Headers.Add(kvp.Key, kvp.Value); + } + } + + if (body != null) + { + MemoryStream stream = new(); + using Utf8JsonWriter writer = new(stream); + JsonSerializer.Serialize(writer, body, Default.RecordingJsonOptions); + BinaryData jsonBody = BinaryData.FromBytes(new ReadOnlyMemory(stream.GetBuffer(), 0, (int)stream.Length)); + + request.Headers.Add("Content-Type", "application/json"); + request.Content = BinaryContent.Create(jsonBody); + } + + return message; + } + + protected virtual async ValueTask SendSyncOrAsync(bool isAsync, PipelineMessage message, CancellationToken token) + { + if (isAsync) + { + await _pipeline.SendAsync(message).ConfigureAwait(false); + } + else + { + _pipeline.Send(message); + } + + PipelineResponse response = message.Response ?? throw new ClientResultException("Response was null", message.Response); + if (response.IsError) + { + if (response.Content.ToMemory().Length > 0) + { + string contentType = response.Headers.GetFirstOrDefault("Content-Type") ?? string.Empty; + + if (contentType.StartsWith("text/", StringComparison.OrdinalIgnoreCase)) + { + string error = response.Content.ToString(); + throw new ClientResultException(error, response); + } + else if (contentType.StartsWith("application/json", StringComparison.OrdinalIgnoreCase)) + { + string error; + try + { + var parsed = response.Content.ToObjectFromJson(new() + { + PropertyNameCaseInsensitive = true + }); + + error = $"{parsed.Status}: {parsed.Message}"; + } + catch + { + error = response.Content.ToString(); + } + + throw new ClientResultException(error, response); + } + } + + throw new ClientResultException(response); + } + + return new ProxyClientResult(response); + } + + protected virtual async ValueTask> SendSyncOrAsync(bool isAsync, PipelineMessage message, CancellationToken token) + { + if (isAsync) + { + await SendSyncOrAsync(isAsync, message, token).ConfigureAwait(false); + } + else + { + SendSyncOrAsync(isAsync, message, token).GetAwaiter().GetResult(); + } + + PipelineResponse response = message.Response!; // we've already validated this is not null in the previous call + + try + { + TResponse? parsed = JsonSerializer.Deserialize(response.Content.ToMemory().Span, Default.TestProxyJsonOptions); + if (parsed == null) + { + throw new InvalidDataException("Response parsed to null"); + } + + return new ProxyClientResult(parsed, response); + } + catch (Exception ex) + { + throw new ClientResultException("Failed to deserialize response", message.Response, ex); + } + } + + private struct ErrorResponse + { + public string? Message { get; set; } + public string? Status { get; set; } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientOptions.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientOptions.cs new file mode 100644 index 000000000000..bb35323c9f7e --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Recording.RecordingProxy; + +/// +/// Options for the test proxy client. +/// +public class ProxyClientOptions : ClientPipelineOptions +{ + /// + /// Creates a new instance. + /// + /// The HTTP endpoint. + /// The endpoint was null. + /// The endpoint was not absolute. + public ProxyClientOptions(Uri http) + { + if (http == null) throw new ArgumentNullException(nameof(http)); + else if (!http.IsAbsoluteUri) throw new ArgumentException("URI must be absolute", nameof(http)); + + HttpEndpoint = http; + } + + /// + /// The HTTP endpoint to use + /// + public Uri HttpEndpoint { get; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientResult.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientResult.cs new file mode 100644 index 000000000000..a1e16d300d52 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyClientResult.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.RecordingProxy +{ + /// + /// Represents the result of a proxy client operation. + /// + public class ProxyClientResult : ClientResult + { + /// + /// Initializes a new instance of the class. + /// + /// (Optional) The pipeline response. + public ProxyClientResult(PipelineResponse? response = null) + { + if (response != null) + { + SetRawResponse(response); + } + } + + /// + /// Gets the recording ID from the response headers. + /// + public string? RecordingId => GetRawResponse().Headers.GetFirstOrDefault(ProxyClient.X_RECORDING_ID_HEADER); + } + + /// + /// Represents the result of a proxy client operation. + /// + /// The type of the result value. + public class ProxyClientResult : ProxyClientResult + { + /// + /// Initializes a new instance of the class. + /// + /// The result value. + /// (Optional) The pipeline response. + public ProxyClientResult(TResult value, PipelineResponse? response = null) + { + Value = value; + if (response != null) + { + SetRawResponse(response); + } + } + + /// + /// Gets the result value. + /// + public virtual TResult Value { get; } + + /// + /// Implicitly converts the to the result value. + /// + /// The instance. + /// The result value. + public static implicit operator TResult(ProxyClientResult result) => result.Value; + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyService.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyService.cs new file mode 100644 index 000000000000..8d6460afd0c6 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyService.cs @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Text; +using NUnit.Framework; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Utils.Processes; + +namespace OpenAI.TestFramework.Recording.Proxy; + +/// +/// Represents the test proxy. See here for more information: +/// https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md +/// +public class ProxyService : IDisposable +{ + private const int c_maxLines = 50; + + private Process _testProxyProcess; + private Uri? _http; + private Uri? _https; + private TaskCompletionSource<(int, int)> _portsAvailableTcs; + private StringBuilder _errorOutput; + private int _lines; + private ProxyClient? _client; + private WindowsJob? _windowsJob; + + /// + /// Creates a new instance. + /// + /// The options to use. + /// was null. + private ProxyService(ProxyServiceOptions options) + { + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + options.Validate(); + + ProcessStartInfo startInfo = new() + { + FileName = options.DotnetExecutable, + Arguments = $@"""{options.TestProxyDll}"" start -u --storage-location=""{options.StorageLocationDir}""", + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + EnvironmentVariables = + { + ["ASPNETCORE_URLS"] = $"http://127.0.0.1:{options.HttpPort};https://127.0.0.1:{options.HttpsPort}", + ["Logging__LogLevel__Azure.Sdk.Tools.TestProxy"] = "Error", + ["Logging__LogLevel__Default"] = "Error", + ["Logging__LogLevel__Microsoft.AspNetCore"] = "Error", + ["Logging__LogLevel__Microsoft.Hosting.Lifetime"] = "Information", + } + }; + + if (options.DevCertFile != null) + { + startInfo.EnvironmentVariables["ASPNETCORE_Kestrel__Certificates__Default__Path"] = options.DevCertFile; + if (options.DevCertPassword != null) + { + startInfo.EnvironmentVariables["ASPNETCORE_Kestrel__Certificates__Default__Password"] = options.DevCertPassword; + } + } + + _errorOutput = new(); + _portsAvailableTcs = new(); + _testProxyProcess = new Process() + { + EnableRaisingEvents = true, + StartInfo = startInfo + }; + + _testProxyProcess.Exited += (_, _) => + { + _portsAvailableTcs.TrySetException(new InvalidOperationException("Test proxy process exited unexpectedly")); + }; + _testProxyProcess.ErrorDataReceived += HandleStdErr; + _testProxyProcess.OutputDataReceived += HandleStdOut; + + _windowsJob = null; + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + // If running on Windows, use a Job to instruct the OS to kill the test proxy service process + // should this current process die for any reason. + _windowsJob = new($"TestProxy_{Process.GetCurrentProcess().Id}"); + } + } + + /// + /// Gets the client to use to communicate with this recording test proxy. + /// + public ProxyClient Client => _client + ?? throw new InvalidOperationException("Please wait for the proxy to finish starting first"); + + /// + /// Gets the HTTP endpoint the test recording proxy is listening on. + /// + public Uri HttpEndpoint => _http + ?? throw new InvalidOperationException("Please wait for the proxy to finish starting first"); + + /// + /// Gets the HTTPS endpoint the test recording proxy is listening on. + /// + public Uri HttpsEndpoint => _https + ?? throw new InvalidOperationException("Please wait for the proxy to finish starting first"); + + /// + /// Creates a new instance of the recording test proxy. + /// + /// The options to use for the proxy. + /// The cancellation token to use. + /// The initialized recording test proxy instance. + public static async Task CreateNewAsync(ProxyServiceOptions options, CancellationToken token = default) + { + token.ThrowIfCancellationRequested(); + + ProxyService proxy = new ProxyService(options); + + // Try to make sure the test proxy process is terminated when we exit + AppDomain.CurrentDomain.DomainUnload += (_, _) => proxy.Dispose(); + // TODO FIXME: On Windows, use a job to ensure the OS will properly kill the process + + await proxy.StartAsync(token).ConfigureAwait(false); + return proxy; + } + + /// + /// Tears down the recording test proxy instance. + /// + public void Dispose() + { + _portsAvailableTcs.TrySetException(new ObjectDisposedException(nameof(ProxyService))); + try + { + _testProxyProcess.Kill(); + if (_windowsJob != null) + { + // do NOT call Dispose here. This will terminate this process too. + } + } catch { /* we tried */ } + } + + /// + /// Checks to see if any errors were encountered in the test proxy, and if so throws an exception. + /// + /// If there were any errors encountered. + public void ThrowOnErrors() + { + lock (_errorOutput) + { + if (_errorOutput.Length > 0) + { + string error = _errorOutput.ToString(); + _errorOutput.Clear(); + throw new InvalidOperationException($"An error occurred in the test proxy:\n{error}"); + } + } + } + + /// + /// For testing purposes only + /// + /// The client to set. + internal void SetClient(ProxyClient client) + { + _client = client; + } + + /// + /// Starts the recording test proxy instance, and waits until we can read the ports it is listening on for + /// HTTP and HTTPS. + /// + /// The cancellation token to use. + /// Asynchronous tas + /// The test proxy failed to start, or we encountered some other error. + protected async Task StartAsync(CancellationToken token = default) + { + token.Register(_portsAvailableTcs.SetCanceled); + + bool success = _testProxyProcess.Start(); + if (!success) + { + throw new InvalidOperationException("The test proxy process failed to start"); + } + + _windowsJob?.Add(_testProxyProcess); + + _testProxyProcess.BeginOutputReadLine(); + _testProxyProcess.BeginErrorReadLine(); + + await _portsAvailableTcs.Task.ConfigureAwait(false); + } + + private static Uri? ParseListeningOnUri(string line) + { + const string nowListeningOn = "Now listening on: "; + int index = line.IndexOf(nowListeningOn, StringComparison.OrdinalIgnoreCase); + if (index < 0) + { + return null; + } + + Uri.TryCreate(line.AsSpan().Slice(index + nowListeningOn.Length).Trim().ToString(), UriKind.Absolute, out Uri? uri); + return uri; + } + + private void HandleStdErr(object sender, DataReceivedEventArgs args) + { + if (args?.Data != null) + { + lock (_errorOutput) + { + _errorOutput.Append(args.Data); + } + + TestContext.Progress.WriteLine(args.Data); + } + } + + private void HandleStdOut(object sender, DataReceivedEventArgs args) + { + if (_lines++ >= c_maxLines) + { + _portsAvailableTcs.TrySetException(new InvalidOperationException( + $"Failed to start the test proxy. One or both the ports was not populated. http: {_http}, https: {_https}")); + _testProxyProcess.OutputDataReceived -= HandleStdOut; + return; + } + else if (args?.Data == null) + { + return; + } + + Uri? uri = ParseListeningOnUri(args.Data); + if (_http == null && uri?.Scheme == "http") + { + _http = uri; + _client = new ProxyClient(new ProxyClientOptions(_http!)); + } + else if (_https == null && uri?.Scheme == "https") + { + _https = uri; + } + + if (_http != null && _https != null) + { + _testProxyProcess.OutputDataReceived -= HandleStdOut; + _portsAvailableTcs.TrySetResult((_http.Port, _https.Port)); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyServiceOptions.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyServiceOptions.cs new file mode 100644 index 000000000000..2f3e3d27f7b6 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyServiceOptions.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Proxy; + +/// +/// Options for starting the recording test proxy. +/// +public class ProxyServiceOptions +{ + /// + /// Gets the full path to the dotnet executable. + /// + required public string DotnetExecutable { get; set; } + + /// + /// Gets the full path to the test proxy DLL. + /// + required public string TestProxyDll { get; set; } + + /// + /// The path to the directory to store or read recordings from. + /// + required public string StorageLocationDir { get; set; } + + /// + /// (Optional) The file to use for the HTTPS endpoint certificate. + /// + public string? DevCertFile { get; set; } + + /// + /// (Optional) The password to use for opening the for the HTTPS endpoint. + /// + public string? DevCertPassword { get; set; } + + /// + /// (Optional) The HTTP port the test proxy should listen on. Set this to 0 to have the next available port be automatically selected. + /// + public ushort HttpPort { get; set; } + + /// + /// (Optional) The HTTPS port the test proxy should listen on. Set this to 0 to have the next available port be automatically selected. + /// + public ushort HttpsPort { get; set; } + + /// + /// Validates the configuration. + /// + /// The storage location directory was could not be found. + /// The HTTPS certificate file could not be found. + /// No password was specified for the developer certificate file. + internal protected virtual void Validate() + { + List exceptions = new(); + + if (!File.Exists(DotnetExecutable)) + { + exceptions.Add(new FileNotFoundException("Could not find (or read from) the dotnet executable: " + DotnetExecutable)); + } + else if (!File.Exists(TestProxyDll)) + { + exceptions.Add(new FileNotFoundException("Could not find (or read from) the test proxy DLL: " + TestProxyDll)); + } + else if (!Directory.Exists(StorageLocationDir)) + { + exceptions.Add(new DirectoryNotFoundException("Could not find (or read from) the following directory: " + StorageLocationDir)); + } + else if (DevCertFile != null && !File.Exists(DevCertFile)) + { + exceptions.Add(new FileNotFoundException("Could not find (or read from) the HTTPS certificate file: " + DevCertFile)); + } + else if (DevCertFile != null && DevCertPassword == null) + { + exceptions.Add(new InvalidOperationException($"You must set the {nameof(DevCertPassword)} property if you specify the {nameof(DevCertFile)}")); + } + + if (exceptions.Any()) + { + throw new AggregateException("The test proxy service configuration is invalid", exceptions); ; + } + } +} diff --git a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ProxyTransport.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransport.cs similarity index 50% rename from sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ProxyTransport.cs rename to sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransport.cs index 729bfbcc572a..69cb9a8fcd6a 100644 --- a/sdk/openai/Azure.AI.OpenAI/tests/Utils/Pipeline/ProxyTransport.cs +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransport.cs @@ -1,74 +1,63 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - -using System; +using System.ClientModel; using System.ClientModel.Primitives; -using System.Net; using System.Net.Http; using System.Text.Json; -using System.Threading.Tasks; -using Azure.Core.TestFramework; -namespace Azure.AI.OpenAI.Tests.Utils.Pipeline; +namespace OpenAI.TestFramework.Recording.RecordingProxy; /// -/// A re-implementation of Azure.Core.TestFramework.ProxyTransport but for the new System.ClientModel pipeline types +/// Implements a that will redirect all HTTP/HTTPS requests to the test proxy for recording or playback. +/// Depending on the mode, the test proxy will then either forward the request to the upstream service and record the request and response, +/// or playback the response from a previous recording. /// public class ProxyTransport : PipelineTransport { private const string DevCertIssuer = "CN=localhost"; private const string FiddlerCertIssuer = "CN=DO_NOT_TRUST_FiddlerRoot, O=DO_NOT_TRUST, OU=Created by http://www.fiddler2.com"; + private const string FiddlerHost = "ipv4.fiddler"; - private readonly Func _filter; - private readonly string _proxyHost; - - // The common test code makes liberal use of internals in several places. That will not stop me... - private readonly NonPublic.Accessor _recordingHasRequests = - NonPublic.FromProperty(nameof(TestRecording.HasRequests)); - private readonly NonPublic.Accessor _recordingMismatch = - NonPublic.FromField("MismatchException"); + private readonly ProxyTransportOptions _options; - public ProxyTransport(TestProxy proxy, TestRecording recording, Func filter) + /// + /// Initializes a new instance of the class. + /// + /// The options for the proxy transport. + public ProxyTransport(ProxyTransportOptions options) { - Proxy = proxy ?? throw new ArgumentNullException(nameof(proxy)); - Recording = recording ?? throw new ArgumentNullException(nameof(recording)); - _filter = filter ?? throw new ArgumentNullException(nameof(filter)); + _options = options ?? throw new ArgumentNullException(nameof(options)); string certIssuer; - if (UseFiddler()) + if (_options.UseFiddler) { certIssuer = FiddlerCertIssuer; - _proxyHost = "ipv4.fiddler"; } else { certIssuer = DevCertIssuer; - _proxyHost = TestProxy.IpAddress; } HttpClientHandler handler = new() { ServerCertificateCustomValidationCallback = (_, certificate, _, _) => certificate?.Issuer == certIssuer, - UseCookies = Core.AppContextSwitchHelper.GetConfigValue( - "Azure.Core.Pipeline.HttpClientTransport.EnableCookies", - "AZURE_CORE_HTTPCLIENT_ENABLE_COOKIES"), - AllowAutoRedirect = false + UseCookies = _options.AllowCookies, + AllowAutoRedirect = _options.AllowAutoRedirect }; InnerTransport = new HttpClientPipelineTransport(new HttpClient(handler)); } + /// + /// The actual transport to use for sending requests, and receiving responses. + /// protected PipelineTransport InnerTransport { get; } - protected TestProxy Proxy { get; } - - protected TestRecording Recording { get; } - + /// protected override PipelineMessage CreateMessageCore() { - Exception? ex = _recordingMismatch.Get(Recording); + Exception? ex = _options.MismatchException?.GetValue(); if (ex != null) { throw ex; @@ -76,43 +65,29 @@ protected override PipelineMessage CreateMessageCore() PipelineMessage message = InnerTransport.CreateMessage(); PipelineRequest request = message.Request; - _recordingHasRequests.Set(Recording, true); - - string requestId; - lock (Recording.Random) - { - if (Recording.UseDefaultGuidFormatForClientRequestId) - { - // User want the client format to use the default format - requestId = Recording.Random.NewGuid().ToString(); - } - else - { - // Make sure ClientRequestId are the same across request and response - requestId = Recording.Random.NewGuid().ToString("N"); - } - } // PipelineRequest no longer has a ClientRequestId property, so we need to set it on the headers directly - request.Headers.Add("x-ms-client-request-id", requestId); + request.Headers.Add("x-ms-client-request-id", _options.RequestId); return message; } + /// protected override void ProcessCore(PipelineMessage message) => ProcessCoreSyncOrAsync(message, async: false).GetAwaiter().GetResult(); + /// protected override ValueTask ProcessCoreAsync(PipelineMessage message) => ProcessCoreSyncOrAsync(message, async: true); + /// + /// Processes the pipeline message synchronously or asynchronously. + /// + /// The pipeline message to process. + /// A flag indicating whether to process asynchronously. + /// A representing the asynchronous operation. protected virtual async ValueTask ProcessCoreSyncOrAsync(PipelineMessage message, bool async) { - if (Recording.Mode == RecordedTestMode.Playback && _filter() == EntryRecordModel.DoNotRecord) - { - throw new InvalidOperationException( - "Operations that are enclosed in a 'TestRecording.DisableRecordingScope' created with the 'DisableRecording' method should not be executed in Playback mode." + - "Instead, update the test to skip the operation when in Playback mode by checking the 'Mode' property of 'RecordedTestBase'."); - } try { RedirectToTestProxy(message); @@ -125,7 +100,7 @@ protected virtual async ValueTask ProcessCoreSyncOrAsync(PipelineMessage message InnerTransport.Process(message); } - await ProcessResponseSyncAsync(message, true).ConfigureAwait(false); + await ProcessResponseSyncAsync(message, async).ConfigureAwait(false); } finally { @@ -151,6 +126,12 @@ protected virtual async ValueTask ProcessCoreSyncOrAsync(PipelineMessage message } } + /// + /// Processes the response synchronously or asynchronously. + /// + /// The pipeline message containing the response. + /// A flag indicating whether to process asynchronously. + /// A representing the asynchronous operation. protected virtual async ValueTask ProcessResponseSyncAsync(PipelineMessage message, bool async) { if (message.Response?.Headers.TryGetValues("x-request-mismatch", out _) == true) @@ -163,38 +144,52 @@ protected virtual async ValueTask ProcessResponseSyncAsync(PipelineMessage messa using var doc = async ? await JsonDocument.ParseAsync(message.Response.ContentStream).ConfigureAwait(false) : JsonDocument.Parse(message.Response.ContentStream); - throw new TestRecordingMismatchException(doc.RootElement.GetProperty("Message").GetString()); + throw new TestRecordingMismatchException(doc.RootElement.GetProperty("Message").GetString(), null); } } // copied from https://github.com/Azure/azure-sdk-for-net/blob/main/common/Perf/Azure.Test.Perf/TestProxyPolicy.cs + /// + /// Redirects the pipeline message to the test proxy based on the recording mode. + /// + /// The pipeline message to redirect. protected virtual void RedirectToTestProxy(PipelineMessage message) { - if (Recording.Mode == RecordedTestMode.Record) + if (_options.Mode == RecordedTestMode.Record) { - switch (_filter()) + switch (_options.ShouldRecordRequest(message.Request)) { - case EntryRecordModel.Record: + case RequestRecordMode.Record: break; - case EntryRecordModel.RecordWithoutRequestBody: + case RequestRecordMode.RecordWithoutRequestBody: message.Request.Headers.Set("x-recording-skip", "request-body"); break; - case EntryRecordModel.DoNotRecord: + case RequestRecordMode.DoNotRecord: message.Request.Headers.Set("x-recording-skip", "request-response"); break; } } - else if (Recording.Mode == RecordedTestMode.Playback) + else if (_options.Mode == RecordedTestMode.Playback) { - if (_filter() == EntryRecordModel.RecordWithoutRequestBody) + switch (_options.ShouldRecordRequest(message.Request)) { - message.Request.Content = null; + case RequestRecordMode.Record: + break; + case RequestRecordMode.RecordWithoutRequestBody: + // CAUTION: setting the request content to null has the unfortunate side effect of causing any HttpClient backed + // implementation of networking to not send up any Content-??? headers as well which can cause test + // mismatches. Let's work around this by setting some empty content. + message.Request.Content = BinaryContent.Create(BinaryData.FromBytes(Array.Empty())); + break; + case RequestRecordMode.DoNotRecord: + throw new InvalidOperationException( + "Cannot playback when recording has been disabled. Please make sure to skip the test or request."); } } var request = message.Request; - request.Headers.Set("x-recording-id", Recording.RecordingId); - request.Headers.Set("x-recording-mode", Recording.Mode.ToString().ToLower()); + request.Headers.Set("x-recording-id", _options.RecordingId); + request.Headers.Set("x-recording-mode", _options.Mode.ToString().ToLowerInvariant()); if (request.Uri is null) { @@ -208,49 +203,14 @@ protected virtual void RedirectToTestProxy(PipelineMessage message) Host = request.Uri.Host, Port = request.Uri.Port, }; - request.Headers.Set("x-recording-upstream-base-uri", builder.ToString()); + Uri baseUri = request.Uri.Scheme == "https" ? _options.HttpsEndpoint : _options.HttpEndpoint; + builder = new(request.Uri); - builder.Host = _proxyHost; - builder.Port = request.Uri.Scheme == "https" ? Proxy.ProxyPortHttps!.Value : Proxy.ProxyPortHttp!.Value; + builder.Host = _options.UseFiddler ? FiddlerHost : baseUri.Host; + builder.Port = baseUri.Port; request.Uri = builder.Uri; } - - private static bool UseFiddler() - { - // Of course TestEnvironment.EnableFiddler is internal only so reproduce the code here - string? enableFiddlerStr = TestContext.Parameters["EnableFiddler"] - ?? Environment.GetEnvironmentVariable("AZURE_ENABLE_FIDDLER"); - - if (bool.TryParse(enableFiddlerStr, out bool enableFiddler)) - { - return enableFiddler; - } - - // Try to detect if there is a current proxy set and it is Fiddler - try - { - Uri dummyUri = new("https://not.a.real.uri.com"); - - IWebProxy webProxy = WebRequest.GetSystemWebProxy(); - Uri? proxyUri = webProxy?.GetProxy(dummyUri); - if (proxyUri == null || proxyUri == dummyUri) - { - return false; - } - - // assume default of 127.0.0.1:8888 with no credentials - var cred = webProxy?.Credentials?.GetCredential(dummyUri, string.Empty); - return proxyUri.Host == "127.0.0.1" - && proxyUri.Port == 8888 - && string.IsNullOrWhiteSpace(cred?.UserName) - && string.IsNullOrWhiteSpace(cred?.Password); - } - catch - { - return false; - } - } } diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransportOptions.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransportOptions.cs new file mode 100644 index 000000000000..a0087e850846 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/ProxyTransportOptions.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.RecordingProxy; + +/// +/// The options for the recording test proxy transport. +/// +public class ProxyTransportOptions +{ + private Func? _shouldRecordRequest; + + /// + /// Gets or sets the test proxy HTTP endpoint. + /// + required public Uri HttpEndpoint { get; set; } + + /// + /// Gets or sets the test proxy HTTPS endpoint. + /// + required public Uri HttpsEndpoint { get; set; } + + /// + /// Gets or sets the current test recording mode. + /// + required public RecordedTestMode Mode { get; set; } + + /// + /// Gets or sets the identifier for the recording. + /// + required public string RecordingId { get; set; } + + /// + /// The ID for the request. Please make sure that a consistent ID is used during recording and playback to avoid + /// mismatches. + /// + required public string RequestId { get; set; } + + /// + /// Gets or sets the delegate used to get/set the test recording mismatch exception. + /// + public PropertyDelegate? MismatchException { get; set; } + + /// + /// Gets or sets a value indicating whether to use Fiddler. If this is true, the transport will be updated to accept + /// the Fiddler root certificate. + /// + public bool UseFiddler { get; set; } + + /// + /// Gets or sets the predicate used to determine whether or not a particular request should not be recorded. + /// Default behaviour is to defer to what the matchers/sanitizers do. + /// + public Func ShouldRecordRequest + { + get => _shouldRecordRequest ?? (_ => RequestRecordMode.Record); + set => _shouldRecordRequest = value; + } + + /// + /// Gets or sets a value indicating whether to allow cookies while sending and receiving requests. + /// + public bool AllowCookies { get; set; } + + /// + /// Gets or sets a value indicating whether to allow auto redirect when processing server responses. + /// + public bool AllowAutoRedirect { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/RequestRecordMode.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/RequestRecordMode.cs new file mode 100644 index 000000000000..d8a782327c8d --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/RequestRecordMode.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.RecordingProxy; + +/// +/// Enumeration of possible values of how to record a request. This acts as an override. +/// +public enum RequestRecordMode +{ + /// + /// Records the request. + /// + Record, + /// + /// Records the request headers but skips the request body. + /// + RecordWithoutRequestBody, + /// + /// Does not record the request (nor the response). + /// + DoNotRecord, +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/PemPair.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/PemPair.cs new file mode 100644 index 000000000000..15c72d94e992 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/PemPair.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Proxy.Service; + +/// +/// Information about certificates for the test proxy service. +/// +public class PemPair +{ + /// Gets or sets the pem value. + public string? PemValue { get; set; } + /// Gets or sets the pem key. + public string? PemKey { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceRecordingOptions.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceRecordingOptions.cs new file mode 100644 index 000000000000..449e90926015 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceRecordingOptions.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Proxy.Service; + +/// +/// Options for the test proxy. +/// +public class ProxyServiceRecordingOptions +{ + /// + /// Whether or not to follow redirects + /// + public bool? HandleRedirects { get; set; } + + /// + /// If set, this will change the "root" path the test proxy uses when loading a recording. + /// + public string? ContextDirectory { get; set; } + + /// + /// Options for the transport. + /// + public ProxyServiceTransportCustomizations? Transport { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceTransportCustomizations.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceTransportCustomizations.cs new file mode 100644 index 000000000000..6be1ba257e34 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/ProxyServiceTransportCustomizations.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.Proxy.Service; + +/// +/// Transport customizations for the test proxy service. +/// +public class ProxyServiceTransportCustomizations() +{ + /// Gets or sets the allow auto redirect. + public bool? AllowAutoRedirect { get; set; } + + /// + /// If specified, the public key contained here will be used during validation of the SSL connection by + /// comparing thumbprints. + /// + public string? TLSValidationCert { get; set; } + + /// + /// If specified, the will only be applied to the specified host. + /// + public string? TSLValidationCertHost { get; set; } + + /// + /// Each certificate pair contained within this list should be added to the clientHandler for the server + /// or an individual recording. + /// + public IList? Certificates { get; set; } + + /// + /// During playback, a response is normally returned all at once. By offering this response time, we can + /// "stretch" the writing of the response bytes over a time range of milliseconds. + /// + [JsonConverter(typeof(TimespanToMillisecondConverter))] + public TimeSpan? PlaybackResponseTime { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/RecordingStartInformation.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/RecordingStartInformation.cs new file mode 100644 index 000000000000..e3526592a288 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/RecordingStartInformation.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; + +namespace OpenAI.TestFramework.Recording.Proxy.Service; + +/// +/// Information for starting a recording or playback session with the recording test proxy. +/// +public class RecordingStartInformation +{ + /// + /// Gets or sets the file to save recordings to, or to play back requests from. + /// + [JsonPropertyName("x-recording-file")] + required public string RecordingFile { get; set; } + + /// + /// Gets or sets the path to the "assets.json" file to use for integration with external Git + /// repositories. This enables the proxy to work against repositories that do not emplace their + /// test recordings directly alongside their test implementations. + /// + /// + /// Please refer to the documentation for more information: + /// https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/documentation/asset-sync/README.md + /// + [JsonPropertyName("x-recording-assets-file")] + public string? AssetsFile { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/SanitizerIdList.cs b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/SanitizerIdList.cs new file mode 100644 index 000000000000..f0982542b7be --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Proxy/Service/SanitizerIdList.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Proxy.Service; + +/// +/// Request to remove sanitizers for the test proxy. +/// +public struct SanitizerIdList +{ + /// + /// The IDs of the sanitizers to remove. + /// + public string[]? Sanitizers { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseRegexSanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseRegexSanitizer.cs new file mode 100644 index 000000000000..3c52f35b8362 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseRegexSanitizer.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// The case class for regex based sanitizers +/// +public abstract class BaseRegexSanitizer(string type) : BaseSanitizer(type) +{ + /// + /// Gets the regular expression to match what to replace. + /// + public string? Regex { get; set; } + + /// + /// Gets or sets the value to replace the match with. + /// + public string? Value { get; set; } + + /// + /// Gets or sets the group in the regex match to replace. + /// + public string? GroupForReplace { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseSanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseSanitizer.cs new file mode 100644 index 000000000000..011145bf58a0 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BaseSanitizer.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// The base class for all test proxy recording sanitizers +/// +public abstract class BaseSanitizer : IUtf8JsonSerializable +{ + /// + /// Creates a new instance. + /// + /// The type of this sanitizer (e.g. GeneralRegexSanitizer). + /// If the type was null. + protected BaseSanitizer(string type) + { + Type = type ?? throw new ArgumentNullException(nameof(Type)); + } + + /// + /// Gets the type of the sanitizer (e.g. HeaderRegexSanitizer). + /// + [JsonIgnore] + public string Type { get; } + + /// + public void Write(Utf8JsonWriter writer, JsonSerializerOptions? options = null) + { + writer.WriteStartObject(); + { + writer.WriteString("Name"u8, Type); + writer.WritePropertyName("Body"u8); + + SerializeInner(writer, options); + } + writer.WriteEndObject(); + } + + /// + /// Serializes the child types. By default this will use reflection based serialization. + /// + /// The writer to write to. + protected virtual void SerializeInner(Utf8JsonWriter writer, JsonSerializerOptions? options = null) + { + // By default use reflection based serialization + JsonSerializer.Serialize(writer, this, GetType(), Default.InnerRecordingJsonOptions); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyKeySanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyKeySanitizer.cs new file mode 100644 index 000000000000..87b3f67e1da3 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyKeySanitizer.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// Sanitizer for a request body that matches a particular value in JSON using a JPath expression. +/// +public class BodyKeySanitizer : BaseRegexSanitizer +{ + /// + /// Creates a new instance. + /// + /// The JSON path to match. + /// If the JSON path is null. + public BodyKeySanitizer(string jsonPath) : base("BodyKeySanitizer") + { + JsonPath = jsonPath ?? throw new ArgumentNullException(nameof(jsonPath)); + } + + /// + /// The JPath expression to match a particular value to sanitize. + /// + public string JsonPath { get; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyRegexSanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyRegexSanitizer.cs new file mode 100644 index 000000000000..e49b6f625f4d --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/BodyRegexSanitizer.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// Sanitizer for the body of a request or response. +/// +public class BodyRegexSanitizer : BaseRegexSanitizer +{ + /// + /// Creates a new instance. + /// + /// Gets the regular expression to match what to replace. + /// If was null. + public BodyRegexSanitizer(string regex) : base("BodyRegexSanitizer") + { + Regex = regex ?? throw new ArgumentNullException(nameof(regex)); + } + + /// + /// Condition to apply for the sanitization or transform. If the condition is not met, sanitization is not performed. + /// + public Condition? Condition { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/HeaderRegexSanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/HeaderRegexSanitizer.cs new file mode 100644 index 000000000000..d1a76fc0455d --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/HeaderRegexSanitizer.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// Sanitizer for a request header. +/// +public class HeaderRegexSanitizer : BaseRegexSanitizer +{ + /// + /// Creates a new instance. + /// + /// The header to sanitize. + /// If the is null. + public HeaderRegexSanitizer(string key) : base("HeaderRegexSanitizer") + { + Key = key ?? throw new ArgumentNullException(nameof(key)); + } + + /// + /// The name of the header to sanitize. + /// + public string Key { get; } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/UriRegexSanitizer.cs b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/UriRegexSanitizer.cs new file mode 100644 index 000000000000..3c5bad68e871 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Sanitizers/UriRegexSanitizer.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Sanitizers; + +/// +/// Sanitizer for a request URI. +/// +public class UriRegexSanitizer : BaseRegexSanitizer +{ + /// + /// Creates a new instance. + /// + /// The regular expression to match in the request URI. + /// If the regular expression is null. + public UriRegexSanitizer(string regex) : base("UriRegexSanitizer") + { + Regex = regex ?? throw new ArgumentNullException(nameof(regex)); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/TestRandom.cs b/sdk/openai/tools/TestFramework/src/Recording/TestRandom.cs new file mode 100644 index 000000000000..d3b6bccb6a3b --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/TestRandom.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording; + +/// +/// Represents an implementation of the class used for test recordings. +/// +public class TestRandom : Random +{ + private RecordedTestMode _mode; + + /// + /// Initializes a new instance of the class. + /// + /// The recorded test mode. + /// The seed value. + public TestRandom(RecordedTestMode mode, int seed) : base(seed) + { + _mode = mode; + } + + /// + /// Generates a new based on the recorded test mode. + /// + /// A new . + public Guid NewGuid() + { + if (_mode == RecordedTestMode.Live) + { + return Guid.NewGuid(); + } + + var bytes = new byte[16]; + NextBytes(bytes); + return new Guid(bytes); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/TestRecording.cs b/sdk/openai/tools/TestFramework/src/Recording/TestRecording.cs new file mode 100644 index 000000000000..d58573f9e58a --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/TestRecording.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Globalization; +using System.Security.Cryptography; +using OpenAI.TestFramework.Recording.Matchers; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording; + +/// +/// Represents a test recording session. This is used to record or playback requests and responses. It also provides +/// a random generator that is consistent between recording and playback sessions. +/// +public class TestRecording : IAsyncDisposable +{ + /// + /// The key to use to store the random seed in the recording. + /// + public const string RandomSeedVariableKey = "RandomSeed"; + + private SortedDictionary _variables; + + /// + /// Creates a new instance. + /// + /// The unique identifier for the recording. + /// The current recording mode. + /// The test proxy service instance to use for the recording. + /// (Optional) Any variables populate this recording this. This is normally used in + /// playback mode to pass in any variables saved as part of the recording. + /// Any of the required parameters are null. + /// Some expected values were missing or null. + /// The current recording mode is not supported. + public TestRecording(string id, RecordedTestMode mode, ProxyService proxy, IDictionary? variables = null) + { + ID = id ?? throw new ArgumentNullException(nameof(id)); + Mode = mode; + Proxy = proxy ?? throw new ArgumentNullException(nameof(proxy)); + _variables = variables == null + ? new() + : new(variables); + + if (Proxy.Client == null) + { + throw new InvalidOperationException("Recording test proxy did not have a client defined"); + } + + int seed; + switch (Mode) + { + case RecordedTestMode.Live: + Random = new TestRandom(Mode, GetRandomSeed()); + break; + + case RecordedTestMode.Record: + seed = GetRandomSeed(); + _variables[RandomSeedVariableKey] = seed.ToString(CultureInfo.InvariantCulture); + Random = new TestRandom(Mode, seed); + break; + + case RecordedTestMode.Playback: + if (Variables.TryGetValue(RandomSeedVariableKey, out string? seedString) + && int.TryParse(seedString, NumberStyles.Integer, CultureInfo.InvariantCulture, out seed)) + { + Random = new TestRandom(Mode, seed); + } + else + { + // To maximise backwards compatibility with the recordings from the previous test framework, we'll just use a random + // seed if one wasn't set instead of failing here. Worst case, we'll get recording mismatches if this is not configured + // correctly. + Random = new TestRandom(Mode, GetRandomSeed()); + } + break; + + default: + throw new NotSupportedException("Unsupported recording mode: " + Mode); + } + } + + /// + /// Gets the unique identifier for this recording. + /// + public string ID { get; } + + /// + /// Gets the current recording mode. + /// + public RecordedTestMode Mode { get; } + + /// + /// Gets the random generator to use for this recording. Using this ensures consistent random values generated during + /// recording, as well as during playback. + /// + public TestRandom Random { get; } + + /// + /// Gets the proxy service associated with the recording. + /// + protected internal ProxyService Proxy { get; } + + /// + /// Gets any variables associated with the recording. + /// + protected IReadOnlyDictionary Variables => _variables; + + /// + /// Disposes of the recording session. If you were recording, this will try to save your captured requests and + /// responses. If you were playing back, this will stop the playback session. + /// + /// Asynchronous task + public virtual ValueTask DisposeAsync() => FinishAsync(true); + + /// + /// Finishes the recording session. This will stop recording or playback. If you were recording, you can use + /// to determine whether or not captured requests and responses will be saved. + /// + /// True to save any captured requests and responses to the file specified in your + /// . False to not save. This is only used if + /// you were recording. + /// The cancellation token to use. + /// Asynchronous task + /// If the recording mode is not supported. + public async virtual ValueTask FinishAsync(bool save, CancellationToken token = default) + { + switch (Mode) + { + case RecordedTestMode.Live: + // nothing to see here, move along + break; + case RecordedTestMode.Playback: + await Proxy.Client.StopPlaybackAsync(ID, token).ConfigureAwait(false); + break; + case RecordedTestMode.Record: + await Proxy.Client.StopRecordingAsync(ID, _variables, !save, token).ConfigureAwait(false); + break; + default: + throw new NotSupportedException("The following mode is not supported: " + Mode); + } + + Proxy.ThrowOnErrors(); + } + + /// + /// Gets a recorded variable. + /// + /// The name of the variable. + /// The variable value, or null if the variable was not set. + public virtual string? GetVariable(string name) + { + return _variables.GetValueOrDefault(name); + } + + /// + /// Sets a recorded variable to a value. + /// + /// The name of the variable. + /// The value to set. + public virtual void SetVariable(string name, string value) + { + _variables[name] = value; + } + + /// + /// Gets a recorded variable, or if it was not set, creates and adds a new variable. + /// + /// The name of the variable. + /// The factory used to create a value if none was previously set. + /// The already existing value, or the newly added value. + public virtual string GetOrAddVariable(string name, Func valueFactory) + { + string? value; + if (!_variables.TryGetValue(name, out value) || value == null) + { + value = valueFactory(); + SetVariable(name, value); + } + + return value; + } + + /// + /// Gets the options to use as the options for creating transport to pass to clients. This will allow the clients to + /// forward requests to the test proxy. + /// + /// The options to use. + public virtual ProxyTransportOptions GetProxyTransportOptions() + { + return new() + { + HttpEndpoint = Proxy.HttpEndpoint, + HttpsEndpoint = Proxy.HttpsEndpoint, + Mode = Mode, + RecordingId = ID, + RequestId = Random.NewGuid().ToString() + }; + } + + /// + /// Applies recording options to the current recording. + /// + /// The recording options to apply for this recording/playback session. + /// The cancellation token to use. + /// Asynchronous task + public virtual async Task ApplyOptions(TestRecordingOptions options, CancellationToken token) + { + if (options.Sanitizers.Any()) + { + await Proxy.Client.AddSanitizersAsync(options.Sanitizers, ID, token).ConfigureAwait(false); + } + + if (options.SanitizersToRemove.Any()) + { + await Proxy.Client.RemoveSanitizersAsync(options.SanitizersToRemove, ID, token).ConfigureAwait(false); + } + + if (Mode == RecordedTestMode.Playback) + { + BaseMatcher matcher = options.Matcher ?? new CustomMatcher() + { + CompareBodies = options.CompareBodies, + ExcludedHeaders = options.ExcludedHeaders.JoinOrNull(","), + IgnoredHeaders = options.IgnoredHeaders.JoinOrNull(","), + IgnoredQueryParameters = options.IgnoredQueryParameters.JoinOrNull(","), + }; + + await Proxy.Client.SetMatcherAsync(matcher, ID, token).ConfigureAwait(false); + + foreach (var transform in options.Transforms) + { + await Proxy.Client.AddTransformAsync(transform, ID, token).ConfigureAwait(false); + } + } + } + + private static int GetRandomSeed() + { +#if NET6_0_OR_GREATER + return RandomNumberGenerator.GetInt32(int.MaxValue); +#else + byte[] bytes = new byte[4]; + using var rng = RandomNumberGenerator.Create(); + rng.GetBytes(bytes); + return BitConverter.ToInt32(bytes, 0); +#endif + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/TestRecordingMismatchException.cs b/sdk/openai/tools/TestFramework/src/Recording/TestRecordingMismatchException.cs new file mode 100644 index 000000000000..3f6af0242620 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/TestRecordingMismatchException.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.Serialization; + +namespace OpenAI.TestFramework.Recording; + +/// +/// Exception thrown when the test recording does not match during playback. +/// +[Serializable] +public class TestRecordingMismatchException : Exception +{ + /// + /// Creates a new instance + /// + public TestRecordingMismatchException() + { + } + + /// + /// Creates a new instance. + /// + /// The exception message. + public TestRecordingMismatchException(string message) : base(message) + { + } + + /// + /// Creates a new instance. + /// + /// The exception message. + /// The inner exception. + public TestRecordingMismatchException(string? message, Exception? innerException = null) : base(message, innerException) + { + } + +#if !NET8_0_OR_GREATER + /// + protected TestRecordingMismatchException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } +#endif +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/TestRecordingOptions.cs b/sdk/openai/tools/TestFramework/src/Recording/TestRecordingOptions.cs new file mode 100644 index 000000000000..de97b0d89d9d --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/TestRecordingOptions.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using OpenAI.TestFramework.Recording.Matchers; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Recording.Sanitizers; +using OpenAI.TestFramework.Recording.Transforms; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording; + +/// +/// Options to configure a test recording. This can be used to set sanitizers to apply to the URI, headers, and/or body of a request +/// before matching, and before saving the recording. This can also be used to specify which matcher will be used to match a request +/// to a recorded one during playback. Finally this can be used to set the transforms applied to responses from the test proxy. +/// +public class TestRecordingOptions +{ + /// + /// Creates a new instance + /// + public TestRecordingOptions() + { } + + /// + /// The list of sanitizers to apply to request before matching, and before saving a recording. + /// + public IList Sanitizers { get; } = new List(); + + /// + /// Gets or sets the matcher to use. If this is unset, a custom matcher will be created based on the options specified in this class. + /// + public BaseMatcher? Matcher { get; set; } + + /// + /// The list of transforms to apply when returning a response during playback. + /// + public IList Transforms { get; } = new List(); + + /// + /// The sanitizers to remove from the list of default sanitizers. More details about default sanitizers can be found here: + /// https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md#removing-a-sanitizer. + /// + /// You can find the list of sanitizer IDs to remove in two ways: + /// + /// Sending a GET request to http://{proxy_endpoint}/Info/Active + /// Looking at the source code for the test proxy here: + /// https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/Common/SanitizerDictionary.cs + /// + /// + public ISet SanitizersToRemove { get; } = new HashSet() + { + // For now, we should leave the default sanitizers in place since it is better to err on the side of caution + }; + + /// + /// Query parameters that we are only interested in checking if a value is set, but don't care about the actual value set. + /// + public ISet IgnoredQueryParameters { get; } = new HashSet(); + + /// + /// Headers that we are only interested in checking if a value is set, but don't care about the actual value set. + /// + public ISet IgnoredHeaders { get; } = new HashSet() + { + "Date", + "x-ms-date", + "User-Agent", + }; + + /// + /// Headers to completely disregard when recording and matching. In other words it is as if these headers were never set. + /// + public ISet ExcludedHeaders { get; } = new HashSet() + { +#if NETFRAMEWORK + // .Net framework will add some headers not found in newer .Net versions so let's completely ignore them here. It is also + // different in how it handles setting the Content-Length header when there is no body as compared to .Net + "Connection", + "Content-Length", +#endif + }; + + /// + /// Whether or not we want to compare bodies from the request and the recorded request during playback. Default + /// is true. + /// + public bool CompareBodies { get; set; } = true; + + /// + /// A function used to override if recording is enabled for a particular request. This will override other settings present + /// here. + /// + public Func? RequestOverride { get; set; } + + /// + /// Helper method to simplify sanitizing specific headers values. This will add a entry + /// to . The default replacement value will be set to . + /// + /// The keys to sanitize. + public void SanitizeHeaders(params string[] keys) + => SanitizeHeaders(Default.SanitizedValue, keys); + + /// + /// Helper method to simplify sanitizing specific headers values. This will add a entry + /// to . + /// + /// The value to replace matches with. + /// The keys to sanitize. + public virtual void SanitizeHeaders(string sanitizedValue, IEnumerable keys) + { + if (keys == null) + { + return; + } + + foreach (var key in keys) + { + Sanitizers.Add(new HeaderRegexSanitizer(key) { Value = sanitizedValue }); + } + } + + /// + /// Helper method to sanitize specific parts of a JSON request body. This will add a entry + /// to for each JSON path provided in . The default replacement value + /// will be set to . + /// + /// The JSON paths to sanitize. + public void SanitizeJsonBody(params string[] jsonPaths) + => SanitizeJsonBody(Default.SanitizedValue, jsonPaths); + + /// + /// Helper method to sanitize specific parts of a JSON request body. This will add a entry + /// to for each JSON path provided in . + /// + /// The value to replace matches with. + /// The JSON paths to sanitize. + public virtual void SanitizeJsonBody(string sanitizedValue, IEnumerable jsonPaths) + { + if (jsonPaths == null) + { + return; + } + + foreach (var key in jsonPaths) + { + Sanitizers.Add(new BodyKeySanitizer(key) { Value = sanitizedValue }); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Transforms/BaseTransform.cs b/sdk/openai/tools/TestFramework/src/Recording/Transforms/BaseTransform.cs new file mode 100644 index 000000000000..11be5e1be083 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Transforms/BaseTransform.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Recording.Transforms; + +/// +/// Base class for test recording proxy transforms. Transforms are applied when returning a request during playback. +/// +public abstract class BaseTransform : IUtf8JsonSerializable +{ + /// + /// Creates a new instance. + /// + /// The type of this sanitizer (e.g. GeneralRegexSanitizer). + /// If the type was null. + protected BaseTransform(string type) + { + Type = type ?? throw new ArgumentNullException(nameof(Type)); + } + + /// + /// Gets the type of the sanitizer (e.g. HeaderRegexSanitizer). + /// + [JsonIgnore] + public string Type { get; } + + /// + public virtual void Write(Utf8JsonWriter writer, JsonSerializerOptions? options = null) + { + // By default use reflection based serialization + JsonSerializer.Serialize(writer, this, GetType(), Default.InnerRecordingJsonOptions); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Recording/Transforms/HeaderTransform.cs b/sdk/openai/tools/TestFramework/src/Recording/Transforms/HeaderTransform.cs new file mode 100644 index 000000000000..4817f84c512c --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Recording/Transforms/HeaderTransform.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Recording.Transforms; + +/// +/// Transform applied to headers before the response is generated during recording playback. +/// +public class HeaderTransform : BaseTransform +{ + /// + /// Creates a new instance. + /// + /// The response header to set. + /// If the is null. + public HeaderTransform(string key) : base("HeaderTransform") + { + Key = key ?? throw new ArgumentNullException(nameof(key)); + } + + /// + /// Gets the header to transform. + /// + public string Key { get; } + + /// + /// Gets or sets the value to set. + /// + public string? Value { get; set; } + + /// + /// The condition to apply for this transform. If the condition is not met, no transform is performed. + /// + public Condition? Condition { get; set; } +} diff --git a/sdk/openai/tools/TestFramework/src/SyncOnlyAttribute.cs b/sdk/openai/tools/TestFramework/src/SyncOnlyAttribute.cs new file mode 100644 index 000000000000..2d00681f9cbe --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/SyncOnlyAttribute.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; + +namespace OpenAI.TestFramework; + +/// +/// Attribute that can be applied to a test to indicate it only runs in synchronous mode. +/// +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] +public class SyncOnlyAttribute() : NUnitAttribute +{ +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/AndPreFilters.cs b/sdk/openai/tools/TestFramework/src/Utils/AndPreFilters.cs new file mode 100644 index 000000000000..714bb78e1836 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/AndPreFilters.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using NUnit.Framework.Interfaces; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Represents a pre-filter that combines multiple pre-filters using a logical AND operation. +/// +public class AndPreFilter : IPreFilter +{ + private IEnumerable _filters; + + /// + /// Initializes a new instance. + /// + /// The pre-filters to combine. + public AndPreFilter(params IPreFilter[] filters) : this((IEnumerable)filters) + { } + + /// + /// Initializes a new instance. + /// + /// The pre-filters to combine. + public AndPreFilter(IEnumerable filters) + { + _filters = filters?.Where(p => p != null) ?? Array.Empty(); + } + + /// + public bool IsMatch(Type type) => _filters.All(p => p.IsMatch(type)); + + /// + public bool IsMatch(Type type, MethodInfo method) => _filters.All(p => p.IsMatch(type, method)); +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/AssemblyHelper.cs b/sdk/openai/tools/TestFramework/src/Utils/AssemblyHelper.cs new file mode 100644 index 000000000000..ae11a0eed22a --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/AssemblyHelper.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using System.Runtime.InteropServices; + +namespace OpenAI.TestFramework.Utils +{ + /// + /// Assembly related helper methods + /// + public static class AssemblyHelper + { + /// + /// Gets the value of the named assembly metadata attribute for the assembly where the is defined. + /// + /// The type whose assembly we want to read from. + /// The name of the metadata assembly attribute to read. + /// The value of the metadata attribute, or null if none was specified or could be found. + public static string? GetAssemblyMetadata(string name) + => GetAssemblyMetadata(typeof(T).Assembly, name); + + /// + /// Gets the value of the named assembly metadata attribute from assembly. + /// + /// The assembly to read the metadata attribute from + /// The name of the metadata assembly attribute to read. + /// The value of the metadata attribute, or null if none was specified or could be found. + public static string? GetAssemblyMetadata(this Assembly assembly, string name) + { + return assembly + ?.GetCustomAttributes() + .FirstOrDefault(a => a.Key == name && !string.IsNullOrWhiteSpace(a.Value)) + ?.Value; + } + + /// + /// Gets the root source directory for the assembly that defines the type . + /// + /// The type whose assembly source path we want to read. + /// The directory containing the original source path, or null if it was not set or did not exist. + public static DirectoryInfo? GetAssemblySourceDir() + => GetAssemblySourceDir(typeof(T).Assembly); + + /// + /// Gets the source path for the assembly. In order for this to work, you will need to set the assembly metadata attribute + /// your project file as follows: + /// + /// <ItemGroup> + /// <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute"> + /// <_Parameter1>SourcePath</_Parameter1> + /// <_Parameter2>$(MSBuildProjectDirectory)</_Parameter2> + /// </AssemblyAttribute> + /// </ItemGroup> + /// + /// + /// The assembly whose source path we want to find. + /// The directory containing the original source path, or null if it was not set or did not exist. + public static DirectoryInfo? GetAssemblySourceDir(this Assembly assembly) + { + string? sourcePath = assembly.GetAssemblyMetadata("SourcePath"); + if (sourcePath == null) + { + return null; + } + + DirectoryInfo dir = new(sourcePath); + return dir.Exists + ? dir + : null; + } + + /// + /// Finds the dotnet executable path for the current system. It does this by reading the DOTNET_INSTALL_DIR environment variable + /// first, and then inspecting all folders in the current PATH environment variable. + /// + /// The path to the found dotnet executable, or null if none could be found. + public static FileInfo? GetDotnetExecutable() + { + string dotnetExeName = "dotnet"; + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + dotnetExeName += ".exe"; + } + + List searchDirs = + [ + Environment.GetEnvironmentVariable("DOTNET_INSTALL_DIR"), + ..Environment.GetEnvironmentVariable("PATH") + ?.Split(Path.PathSeparator) + ?? Array.Empty() + ]; + + return searchDirs + .Where(dir => !string.IsNullOrWhiteSpace(dir)) + .Select(dir => new FileInfo(Path.Combine(dir!, dotnetExeName))) + .FirstOrDefault(file => file.Exists); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/Default.cs b/sdk/openai/tools/TestFramework/src/Utils/Default.cs new file mode 100644 index 000000000000..5774a477498a --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/Default.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Options used for various recordings. +/// +public static class Default +{ + private static JsonSerializerOptions? _recordingJsonOptions; + private static JsonSerializerOptions? _innerRecordingJsonOptions; + private static JsonSerializerOptions? _testProxyJsonOptions; + private static TimeSpan? _testProxyWaitTime; + private static TimeSpan? _requestRetryDelay; + private static TimeSpan? _debuggerTestTimeout; + private static TimeSpan? _defaultTestTimeout; + + /// + /// Gets the default value to replace matches with while sanitizing. + /// + public const string SanitizedValue = "Sanitized"; + + /// + /// Gets the JSON serialization options to use for recording sanitizers, matchers, and transforms child instances. + /// + public static JsonSerializerOptions InnerRecordingJsonOptions => _innerRecordingJsonOptions ??= new() + { + PropertyNameCaseInsensitive = true, + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + WriteIndented = true, +#if NET + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, +#else + IgnoreNullValues = true, +#endif + }; + + /// + /// Gets the JSON serialization options to use for recording sanitizers, matchers, and transforms. + /// + public static JsonSerializerOptions RecordingJsonOptions + { + get + { + if (_recordingJsonOptions == null) + { + _recordingJsonOptions = InnerRecordingJsonOptions.Clone(); + _recordingJsonOptions.Converters.Add( + +#if NET6_0 + // .Net 6.0 seems to have a weird bug here. This is not needed for .Net framework, nor .Net 7+ + new Utf8JsonSerializableConverterFactory() +#else + new Utf8JsonSerializableConverter() +#endif + ); + } + + return _recordingJsonOptions; + } + } + + + /// + /// Gets the JSON serialization options to use for the test proxy + /// + public static JsonSerializerOptions TestProxyJsonOptions => _testProxyJsonOptions ??= new() + { + PropertyNameCaseInsensitive = true, + WriteIndented = true, +#if NET + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, +#else + IgnoreNullValues = true, +#endif + }; + + /// + /// The default maximum amount of time to wait to for the test proxy operations to finish (e.g. start up + /// and configuration, or saving a recording and teardown). + /// + public static TimeSpan TestProxyWaitTime => _testProxyWaitTime ??= TimeSpan.FromMinutes(2); + + /// + /// Gets the maximum number of times to retry requests + /// + public const int MaxRequestRetries = 3; + + /// + /// The amount of time to wait between requests. + /// + public static TimeSpan RequestRetryDelay => _requestRetryDelay ??= TimeSpan.FromSeconds(0.8); + + /// + /// The amount of time to wait when the debugger is attached. This is much higher than normal to allow for more time while debugging. + /// + public static TimeSpan DebuggerAttachedTestTimeout => _debuggerTestTimeout ??= TimeSpan.FromMinutes(15); + + /// + /// The default test timeout. + /// + public static TimeSpan TestTimeout => _defaultTestTimeout ??= TimeSpan.FromSeconds(15); +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/Extensions.cs b/sdk/openai/tools/TestFramework/src/Utils/Extensions.cs new file mode 100644 index 000000000000..437e8dc05b7a --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/Extensions.cs @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Diagnostics; + +namespace OpenAI.TestFramework.Utils; + +/// +/// String related extension methods. +/// +public static class StringExtensions +{ + /// + /// Ensures that a string ends with a specified suffix. + /// + /// The string value. + /// The suffix to check for. + /// The string comparison type. Default is . + /// The original string if it ended in the suffix, or a new string value with the suffix appended. + public static string EnsureEndsWith(this string value, string suffix, StringComparison comparison = StringComparison.Ordinal) + { + if (value == null) + { + return null!; + } + + if (value.EndsWith(suffix, comparison)) + { + return value; + } + + return value + suffix; + } + + /// + /// Ensures that a string ends with a specified suffix. + /// + /// The string value. + /// The suffix to check for. + /// The string comparison type. Default is . + /// The original string if it ended in the suffix, or a new string value with the suffix appended. + public static string EnsureEndsWith(this string value, char suffix, StringComparison comparison = StringComparison.Ordinal) + => EnsureEndsWith(value, suffix.ToString(), comparison); +} + +/// +/// Extension methods for System.ClientModel types. +/// +public static class ScmExtensions +{ + /// + /// Gets the first value associated with the specified header name from the pipeline request headers. + /// + /// The pipeline request headers. + /// The name of the header. + /// The first non-empty value associated with the specified header name, or null if the header is not found or has no non-empty values. + public static string? GetFirstOrDefault(this PipelineRequestHeaders headers, string name) + { + if (headers?.TryGetValues(name, out IEnumerable? values) == true) + { + return values?.FirstOrDefault(v => !string.IsNullOrWhiteSpace(v)); + } + + return null; + } + + /// + /// Gets the first value associated with the specified header name from the pipeline response headers. + /// + /// The pipeline response headers. + /// The name of the header. + /// The first non-empty value associated with the specified header name, or null if the header is not found or has no non-empty values. + public static string? GetFirstOrDefault(this PipelineResponseHeaders headers, string name) + { + if (headers?.TryGetValues(name, out IEnumerable? values) == true) + { + return values?.FirstOrDefault(v => !string.IsNullOrWhiteSpace(v)); + } + + return null; + } +} + +/// +/// Extensions for collections +/// +public static class CollectionExtensions +{ + /// + /// Adds the elements to a collection. + /// + /// The type of the elements in the collection. + /// The collection to add elements to. + /// The items to add. + public static void AddRange(this ICollection collection, IEnumerable itemsToAdd) + { + foreach (T item in itemsToAdd) + { + collection.Add(item); + } + } + + /// + /// Joins the elements of a collection into a single string using the specified separator. + /// Returns null if the collection is null or empty. + /// + /// The collection of strings to join. + /// The separator string. + /// A string that consists of the elements of the collection joined by the separator, or null if the collection is null or empty. + public static string? JoinOrNull(this IEnumerable values, string separator) + { + if (values == null || !values.Any()) + { + return null; + } + + return string.Join(separator, values); + } + +#if NETFRAMEWORK + /// + /// Gets the value associated with the specified key from the dictionary, or returns the default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The value associated with the specified key, or the default value if the key is not found. + public static TVal? GetValueOrDefault(this IReadOnlyDictionary dict, TKey key) + => GetValueOrDefault(dict, key, default!); + + /// + /// Gets the value associated with the specified key from the dictionary, or returns the specified default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The default value to return if the key is not found. + /// The value associated with the specified key, or the specified default value if the key is not found. + public static TVal GetValueOrDefault(this IReadOnlyDictionary dict, TKey key, TVal defaultValue) + { + if (dict?.TryGetValue(key, out TVal? value) == true) + { + return value; + } + + return defaultValue; + } +#endif + + /// + /// Gets the value associated with the specified key from the dictionary, or returns the default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The value associated with the specified key, or the default value if the key is not found. + public static TVal? GetValueOrDefault(this Dictionary dict, TKey key) where TKey : notnull + => GetValueOrDefault((IDictionary)dict, key, default!); + + /// + /// Gets the value associated with the specified key from the dictionary, or returns the specified default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The default value to return if the key is not found. + /// The value associated with the specified key, or the specified default value if the key is not found. + public static TVal GetValueOrDefault(this Dictionary dict, TKey key, TVal defaultValue) where TKey : notnull + => GetValueOrDefault((IDictionary)dict, key, defaultValue); + + /// + /// Gets the value associated with the specified key from the sorted dictionary, or returns the default value if the key is not found. + /// + /// The type of the keys in the sorted dictionary. + /// The type of the values in the sorted dictionary. + /// The sorted dictionary. + /// The key to locate. + /// The value associated with the specified key, or the default value if the key is not found. + public static TVal? GetValueOrDefault(this SortedDictionary dict, TKey key) where TKey : notnull + => GetValueOrDefault((IDictionary)dict, key, default!); + + /// + /// Gets the value associated with the specified key from the sorted dictionary, or returns the specified default value if the key is not found. + /// + /// The type of the keys in the sorted dictionary. + /// The type of the values in the sorted dictionary. + /// The sorted dictionary. + /// The key to locate. + /// The default value to return if the key is not found. + /// The value associated with the specified key, or the specified default value if the key is not found. + public static TVal GetValueOrDefault(this SortedDictionary dict, TKey key, TVal defaultValue) where TKey : notnull + => GetValueOrDefault((IDictionary)dict, key, defaultValue); + + /// + /// Gets the value associated with the specified key from the dictionary, or returns the default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The value associated with the specified key, or the default value if the key is not found. + public static TVal? GetValueOrDefault(this IDictionary dict, TKey key) + => GetValueOrDefault(dict, key, default!); + + /// + /// Gets the value associated with the specified key from the dictionary, or returns the specified default value if the key is not found. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The default value to return if the key is not found. + /// The value associated with the specified key, or the specified default value if the key is not found. + public static TVal GetValueOrDefault(this IDictionary dict, TKey key, TVal defaultValue) + { + if (dict?.TryGetValue(key, out TVal? value) == true) + { + return value; + } + + return defaultValue; + } + + /// + /// Gets the value associated with the specified key from the dictionary, or creates and adds a new value if the key did not exist. + /// + /// The type of the keys in the dictionary. + /// The type of the values in the dictionary. + /// The dictionary. + /// The key to locate. + /// The function used to create a value for the key if it is not found in the dictionary. + /// The value associated with the specified key, or the value created by the if the key is not found. + public static TValue GetOrAdd(this IDictionary dictionary, TKey key, Func valueFactory) + { + if (dictionary == null) + { + throw new ArgumentNullException(nameof(dictionary)); + } + + if (!dictionary.TryGetValue(key, out TValue? value)) + { + value = valueFactory(key); + dictionary[key] = value; + } + + return value!; + } + + /// + /// Asynchronously returns the first element of a sequence. + /// is found. + /// + /// The type of the elements in the sequence. + /// The sequence to search. + /// A cancellation token to cancel the operation. + /// Asynchronous task. + public static ValueTask FirstOrDefaultAsync(this IAsyncEnumerable enumerable, CancellationToken token = default) + => FirstOrDefaultAsync(enumerable, _ => true); + + /// + /// Asynchronously returns the first element of a sequence that satisfies a specified condition or a default value if no such element + /// is found. + /// + /// The type of the elements in the sequence. + /// The sequence to search. + /// A function to test each element for a condition. + /// A cancellation token to cancel the operation. + /// Asynchronous task. + public static async ValueTask FirstOrDefaultAsync(this IAsyncEnumerable enumerable, Predicate predicate, CancellationToken token = default) + { + await foreach (T item in enumerable.WithCancellation(token)) + { + if (predicate(item)) + { + return item; + } + } + + return default!; + } + + /// + /// Converts an to a asynchronously. + /// + /// The type of the elements in the enumerable. + /// The to convert. + /// The cancellation token. + /// Asynchronous task to do the conversion. + public static async Task> ToListAsync(this IAsyncEnumerable asyncEnumerable, CancellationToken token = default) + { + List list = new List(); + await foreach (T item in asyncEnumerable.WithCancellation(token)) + { + list.Add(item); + } + return list; + } + + /// + /// Converts an async enumerable of pages to a asynchronously. + /// + /// The type of the elements in the enumerable. + /// The to convert. + /// The cancellation token. + /// Asynchronous task to do the conversion. + public static async Task> ToListAsync(this IAsyncEnumerable> pageAsyncEnumerable, CancellationToken token = default) + { + List list = new List(); + await foreach(PageResult page in pageAsyncEnumerable.WithCancellation(token)) + { + list.AddRange(page.Values); + } + return list; + } +} + +/// +/// Helpers for working with paths. +/// +public static class PathHelpers +{ + /// + /// Create a relative path from one path to another. Paths will be resolved before calculating the difference. + /// + /// The source path the output should be relative to. This path is always considered to be a directory. + /// The destination path. + /// The relative path or if the paths don't share the same root. + public static string GetRelativePath(string relativeTo, string path) + { + +#if NET + return Path.GetRelativePath(relativeTo, path); +#else + relativeTo = Path.GetFullPath(relativeTo).EnsureEndsWith(Path.DirectorySeparatorChar); + path = Path.GetFullPath(path).EnsureEndsWith(Path.DirectorySeparatorChar); + + Uri relativeToUri = new Uri(relativeTo); + Uri pathUri = new Uri(path); + + if (relativeToUri.Scheme != pathUri.Scheme) + { + return path; + } + + Uri relative = relativeToUri.MakeRelativeUri(pathUri); + return Uri.UnescapeDataString(relative.ToString()) + .Replace('/', '\\'); +#endif + } +} + + +/// +/// Extensions for types. +/// +public static class TypeExtensions +{ + /// + /// Determines whether the specified type either implements the open generic type specified, + /// or inherits from the open generic type specified. + /// + /// The type to inspect. + /// The open generic type. + /// The arguments of the closed generic type. + /// True if the type implements, or inherits, or is a closed version of the open type. + [DebuggerStepThrough] + public static bool IsClosedGenericOf(this Type type, Type openGeneric, out Type[] closedTypeArguments) + { + Type? closedType = null; + + if (openGeneric.IsInterface) + { + closedType = type.GetInterfaces() + .FirstOrDefault(iType => IsAssignableToOpen(iType, openGeneric)); + } + + if (closedType == null) + { + for (Type? current = type; current != null && closedType == null; current = current.BaseType) + { + if (IsAssignableToOpen(current, openGeneric)) + { + closedType = current; + } + } + } + + closedTypeArguments = closedType?.GetGenericArguments() ?? Array.Empty(); + return closedType != null; + } + + /// + /// Determines if the type is or inherits from the open generic type. + /// + /// The type. + /// The open generic type. + /// True if the open generic type could be assigned from the type. + [DebuggerStepThrough] + public static bool IsAssignableToOpen(this Type type, Type openGeneric) + { + if (!type.IsGenericType || !type.IsConstructedGenericType) + { + return false; + } + + return openGeneric.IsAssignableFrom(type.GetGenericTypeDefinition()); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/IUtf8JsonSerializable.cs b/sdk/openai/tools/TestFramework/src/Utils/IUtf8JsonSerializable.cs new file mode 100644 index 000000000000..7b81c3532f3f --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/IUtf8JsonSerializable.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Interface applied to types that can be serialized to JSON. +/// +public interface IUtf8JsonSerializable +{ + /// + /// Writes this instance as JSON to the writer. + /// + /// The writer to write to. + /// The options to use when writing. + void Write(Utf8JsonWriter writer, JsonSerializerOptions? options = null); +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/JsonHelpers.cs b/sdk/openai/tools/TestFramework/src/Utils/JsonHelpers.cs new file mode 100644 index 000000000000..ed6752ca4c30 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/JsonHelpers.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace OpenAI.TestFramework.Utils; + +public static class JsonHelpers +{ + /// + /// Serializes the specified data to a stream using as a UTF-8 encoded JSON text. + /// + /// The type of the data to serialize. + /// The stream to write the serialized data to. + /// The data to serialize. + /// (Optional) Options to use when serializing. + public static void Serialize(Stream stream, T data, JsonSerializerOptions? options = null) + { +#if NETFRAMEWORK + using (Utf8JsonWriter writer = new(stream)) + { + JsonSerializer.Serialize(writer, data, options); + writer.Flush(); + } +#else + JsonSerializer.Serialize(stream, data, options); +#endif + } + + /// + /// Deserializes UTF-8 encoded JSON text from a stream. + /// + /// The type of the data to deserialize. + /// The stream to read the serialized data from. + /// (Optional) Options to use when deserializing. + /// The deserialized data. + public static T? Deserialize(Stream stream, JsonSerializerOptions? options = null) + { +#if NETFRAMEWORK + // For now let's keep it simple and load entire JSON bytes into memory + using MemoryStream buffer = new(); + stream.CopyTo(buffer); + + ReadOnlySpan jsonBytes = buffer.GetBuffer().AsSpan(0, (int)buffer.Length); + return JsonSerializer.Deserialize(jsonBytes, options); +#else + return JsonSerializer.Deserialize(stream, options); +#endif + } + +#if NET6_0_OR_GREATER + // .Net 6 and newer already have the extension method we need defined in JsonSerializer +#else + // TODO FIXME once we move to newer versions of System.Text.Json we can directly use the + // JsonSerializer extension method for elements + public static T? Deserialize(this JsonElement element, JsonSerializerOptions? options = null) + { + using MemoryStream stream = new(); + using Utf8JsonWriter writer = new(stream, new() + { + Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping, + Indented = false, + SkipValidation = true + }); + element.WriteTo(writer); + writer.Flush(); + + stream.Seek(0, SeekOrigin.Begin); + if (((ulong)stream.Length & 0xffffffff00000000) != 0ul) + { + throw new ArgumentOutOfRangeException("JsonElement is too large"); + } + + ReadOnlySpan span = new(stream.GetBuffer(), 0, (int)stream.Length); + return JsonSerializer.Deserialize(span, options); + } +#endif + + /// + /// Serializes a value to a JsonElement. + /// + /// Type of the data to serialize. + /// The value to serialize. + /// (Optional) Options to use when serializing. + /// The serialized value as a JsonElement. + public static JsonElement SerializeToElement(T value, JsonSerializerOptions? options = null) + { +#if NET6_0_OR_GREATER + return JsonSerializer.SerializeToElement(value, options); +#else + using MemoryStream stream = new(); + Serialize(stream, value, options); + stream.Seek(0, SeekOrigin.Begin); + return JsonDocument.Parse(stream).RootElement; +#endif + } + + /// + /// Creates a clone of the specified JSON serializer options. + /// + /// The JSON serializer options to clone. + /// (Optional) Filter to apply for selecting specific converters to include in the cloned options. + /// A clone of the JSON serializer options. + public static JsonSerializerOptions Clone(this JsonSerializerOptions options, Predicate? converterFilter = null) + { +#if NET + JsonSerializerOptions cloned = new JsonSerializerOptions(options); + if (converterFilter != null) + { + cloned.Converters.Clear(); + foreach (var converter in options.Converters.Where(c => converterFilter(c))) + { + cloned.Converters.Add(converter); + } + } + + return cloned; +#else + JsonSerializerOptions clone = new() + { + AllowTrailingCommas = options.AllowTrailingCommas, + DefaultBufferSize = options.DefaultBufferSize, + DictionaryKeyPolicy = options.DictionaryKeyPolicy, + Encoder = options.Encoder, + IgnoreNullValues = options.IgnoreNullValues, + IgnoreReadOnlyProperties = options.IgnoreReadOnlyProperties, + MaxDepth = options.MaxDepth, + PropertyNameCaseInsensitive = options.PropertyNameCaseInsensitive, + PropertyNamingPolicy = options.PropertyNamingPolicy, + ReadCommentHandling = options.ReadCommentHandling, + WriteIndented = options.WriteIndented, + }; + + foreach (var converter in options.Converters.Where(c => converterFilter?.Invoke(c) ?? true)) + { + clone.Converters.Add(converter); + } + + return clone; +#endif + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/PropertyDelegate.cs b/sdk/openai/tools/TestFramework/src/Utils/PropertyDelegate.cs new file mode 100644 index 000000000000..3c2f467cf80a --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/PropertyDelegate.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Utils; + +/// +/// Represents a delegate for getting and setting property values. +/// +/// The type of the property value. +public struct PropertyDelegate +{ + private Func? _getter; + private Action? _setter; + + /// + /// Initializes a new instance of the struct. + /// + /// The delegate used to get the property value. + /// The delegate used to set the property value. + public PropertyDelegate(Func getter, Action setter) + { + _getter = getter ?? throw new ArgumentNullException(nameof(getter)); + _setter = setter ?? throw new ArgumentNullException(nameof(setter)); + } + + /// + /// Gets the value of the property. + /// + /// The value of the property. + public TVal GetValue() + { + if (_getter != null) + return _getter(); + else + throw new InvalidOperationException("No getter was set"); + } + + /// + /// Sets the value of the property. + /// + /// The value to set. + public void SetValue(TVal val) + { + if (_setter != null) + _setter(val); + else + throw new InvalidOperationException("No setter was set"); + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/SyncAsyncPreFilter.cs b/sdk/openai/tools/TestFramework/src/Utils/SyncAsyncPreFilter.cs new file mode 100644 index 000000000000..a2c32fc1a087 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/SyncAsyncPreFilter.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using NUnit.Framework.Interfaces; + +namespace OpenAI.TestFramework.Utils +{ + /// + /// Filter to exclude sync only or async only tests in the appropriate test run. + /// + public class SyncAsyncPreFilter : IPreFilter + { + private bool _isAsync; + + /// + /// Creates a new instance. + /// + /// True to filter for an async test run, false to filter for sync test run. + public SyncAsyncPreFilter(bool isAsync) + { + _isAsync = isAsync; + } + + /// + public bool IsMatch(Type type) + => type.GetCustomAttribute() != null; + + /// + public bool IsMatch(Type type, MethodInfo method) + { + if (!IsMatch(type)) + { + return false; + } + + return _isAsync && method.GetCustomAttribute() == null + || !_isAsync && method.GetCustomAttribute() == null; + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/TestClientRetryPolicy.cs b/sdk/openai/tools/TestFramework/src/Utils/TestClientRetryPolicy.cs new file mode 100644 index 000000000000..517ff5576421 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/TestClientRetryPolicy.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; +using System.Diagnostics; +using System.Reflection; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Represents a retry policy to be used when testing clients. +/// +public class TestClientRetryPolicy : ClientRetryPolicy +{ + private Func _getRetries; + + /// + /// Initializes a new instance of the class. + /// + /// The maximum number of retries. + /// The delay between retries. + /// Indicates whether the delay should be exponential. + public TestClientRetryPolicy(int maxRetries = Utils.Default.MaxRequestRetries, TimeSpan? delay = null, bool exponentialDelay = false) + : base(maxRetries) + { + MaxRetries = MaxRetries; + Delay = delay ?? Utils.Default.RequestRetryDelay; + IsExponentialDelay = exponentialDelay; + + // Of course, even reading the number of retries property on the PipelineMessage is internal only. + // So reflection it is + _getRetries = (Func) + (typeof(PipelineMessage).GetProperty("RetryCount", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance) + ?.GetGetMethod(true) + ?.CreateDelegate(typeof(Func)) + ?? throw new InvalidOperationException("Failed to get RetryCount property")); + } + + /// + /// Gets the maximum number of retries. + /// + public int MaxRetries { get; } + + /// + /// Gets the delay between retries. + /// + public TimeSpan Delay { get; } + + /// + /// Gets a value indicating whether the delay should be exponential. + /// + public bool IsExponentialDelay { get; } + + /// + protected override TimeSpan GetNextDelay(PipelineMessage message, int tryCount) + { + TimeSpan delay = IsExponentialDelay + ? TimeSpan.FromMilliseconds((1 << tryCount - 1) * Delay.TotalMilliseconds) + : Delay; + + return delay; + } + + /// + protected override bool ShouldRetry(PipelineMessage message, Exception? exception) + { + if (_getRetries(message) >= MaxRetries) + { + return false; + } + + if (!message.ResponseClassifier.TryClassify(message, exception, out bool isRetriable) + && !PipelineMessageClassifier.Default.TryClassify(message, exception, out isRetriable)) + { + Debug.Assert(false, "Failed to classify message"); + } + + return isRetriable; + } + + /// + protected override ValueTask ShouldRetryAsync(PipelineMessage message, Exception? exception) + => new ValueTask(ShouldRetry(message, exception)); +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/TestPipelinePolicy.cs b/sdk/openai/tools/TestFramework/src/Utils/TestPipelinePolicy.cs new file mode 100644 index 000000000000..bc004f1bcee5 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/TestPipelinePolicy.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel.Primitives; + +namespace OpenAI.TestFramework.Utils; + +/// +/// A pipeline policy that raises events before a request sent, and after response has been received. +/// +public class TestPipelinePolicy() : PipelinePolicy() +{ + /// + /// Creates a new instance. This will instantiate the and + /// events based on and respectively. + /// + /// (Optional) Action to perform before sending a request. + /// (Optional) Action to perform after a response is received. + public TestPipelinePolicy(Action? requestAction, Action? responseAction) : this() + { + if (requestAction != null) BeforeRequest += (s, e) => requestAction(e); + + if (responseAction != null) AfterResponse += (s, e) => responseAction(e); + } + + /// + /// Event raised before a request is sent. + /// + public event EventHandler? BeforeRequest; + + /// + /// Event raised after a response has been received. + /// + public event EventHandler? AfterResponse; + + /// + public override void Process(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) + { + BeforeRequest?.Invoke(this, message.Request); + ProcessNext(message, pipeline, currentIndex); + if (message.Response != null) + { + AfterResponse?.Invoke(this, message.Response); + } + } + + /// + public override async ValueTask ProcessAsync(PipelineMessage message, IReadOnlyList pipeline, int currentIndex) + { + BeforeRequest?.Invoke(this, message.Request); + await ProcessNextAsync(message, pipeline, currentIndex).ConfigureAwait(false); + if (message.Response != null) + { + AfterResponse?.Invoke(this, message.Response); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/TimespanToMillisecondConverter.cs b/sdk/openai/tools/TestFramework/src/Utils/TimespanToMillisecondConverter.cs new file mode 100644 index 000000000000..7045f956b75c --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/TimespanToMillisecondConverter.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Globalization; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Converter for TimeSpans to/from integer millisecond values in JSON. +/// +public class TimespanToMillisecondConverter : JsonConverter +{ + /// + /// Reads a value from JSON. + /// + /// The to read from. + /// The type of the object to convert. + /// The serializer options. + /// The deserialized value. + public override TimeSpan? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case JsonTokenType.Null: + return null; + + case JsonTokenType.Number: + return TimeSpan.FromMilliseconds(reader.GetInt32()); + + case JsonTokenType.String: + string? strValue = reader.GetString(); + if (int.TryParse(strValue, NumberStyles.Integer, CultureInfo.InvariantCulture, out int milliseconds)) + { + return TimeSpan.FromMilliseconds(milliseconds); + } + else + { + throw new JsonException("Invalid millisecond value: " + strValue); + } + + default: + throw new JsonException($"Don't know how to parse '{reader.TokenType}' as a millisecond value"); + } + } + + /// + /// Writes a value to JSON. + /// + /// The to write to. + /// The value to write. + /// The serializer options. + public override void Write(Utf8JsonWriter writer, TimeSpan? value, JsonSerializerOptions options) + { + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteNumberValue((int)Math.Ceiling(value.Value.TotalMilliseconds)); + } + } +} diff --git a/sdk/openai/tools/TestFramework/src/Utils/Utf8JsonSerializableConverter.cs b/sdk/openai/tools/TestFramework/src/Utils/Utf8JsonSerializableConverter.cs new file mode 100644 index 000000000000..3613f66c0349 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/Utf8JsonSerializableConverter.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace OpenAI.TestFramework.Utils; + +/// +/// Converter for types that implement . +/// +public class Utf8JsonSerializableConverter : JsonConverter +{ + private static Utf8JsonSerializableConverter? s_instance; + + /// + /// Gets the shared instance of the converter. + /// + public static Utf8JsonSerializableConverter Instance => s_instance ??= new(); + + /// + public override bool CanConvert(Type typeToConvert) + => typeof(IUtf8JsonSerializable).IsAssignableFrom(typeToConvert); + + /// + public override IUtf8JsonSerializable Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + => throw new NotSupportedException("Only writing JSON is supported"); + + /// + public override void Write(Utf8JsonWriter writer, IUtf8JsonSerializable value, JsonSerializerOptions options) + => value.Write(writer); +} + +#if NET6_0 +/// +/// .Net 6.0 has some odd quirks and is particularly pedantic with converters so directly using Utf8JsonSerializableConverter would +/// result in an InvalidCastException. The work around is to use a converter factory. Thankfully, neither .Net Framework, nor .Net 7+ +/// exhibit this behavior. +/// +public class Utf8JsonSerializableConverterFactory : JsonConverterFactory +{ + public override bool CanConvert(Type typeToConvert) => typeof(IUtf8JsonSerializable).IsAssignableFrom(typeToConvert); + public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) + => (JsonConverter?)Activator.CreateInstance(typeof(InnerConverter<>).MakeGenericType(typeToConvert)); + + private class InnerConverter : JsonConverter where T : IUtf8JsonSerializable + { + public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + => (T)Utf8JsonSerializableConverter.Instance.Read(ref reader, typeToConvert, options); + + public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options) + => Utf8JsonSerializableConverter.Instance.Write(writer, value, options); + } +} +#endif diff --git a/sdk/openai/tools/TestFramework/src/Utils/WindowsJob.cs b/sdk/openai/tools/TestFramework/src/Utils/WindowsJob.cs new file mode 100644 index 000000000000..a5eb2570b1d1 --- /dev/null +++ b/sdk/openai/tools/TestFramework/src/Utils/WindowsJob.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics; +using System.Runtime.ConstrainedExecution; +using System.Runtime.InteropServices; +using System.Security; + +namespace OpenAI.TestFramework.Utils.Processes; + +/// +/// A job provides a way to link several processes together on Windows. In this way, they can all be +/// terminated by calling the method. The OS will also automatically terminate +/// the linked processes if the owner process terminates. +/// +public class WindowsJob : IDisposable +{ + private IntPtr _jobHandle; + private int _disposed; + + /// + /// Creates a new job + /// + /// (Optional) The name to associate + public WindowsJob(string? name = null) + { + if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + throw new NotSupportedException("This is only supported on Windows platforms"); + } + + var securityAttributes = new SECURITY_ATTRIBUTES() + { + nLength = (uint)Marshal.SizeOf(typeof(SECURITY_ATTRIBUTES)), + lpSecurityDescriptor = IntPtr.Zero, + bInheritHandle = false + }; + + // Create the job handle + _jobHandle = CreateJobObject(ref securityAttributes, name); + if (_jobHandle == IntPtr.Zero) + { + throw new COMException("Failed to create job", Marshal.GetLastWin32Error()); + } + + // Set the job state so that all associated handles are closed + var extendedInfo = new JOBOBJECT_EXTENDED_LIMIT_INFORMATION() + { + BasicLimitInformation = new JOBOBJECT_BASIC_LIMIT_INFORMATION() + { + LimitFlags = JobObjectLimits.LIMIT_KILL_ON_JOB_CLOSE + } + }; + + int length = Marshal.SizeOf(typeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION)); + IntPtr ptr = IntPtr.Zero; + try + { + ptr = Marshal.AllocHGlobal(length); + Marshal.StructureToPtr(extendedInfo, ptr, false); + + bool success = SetInformationJobObject( + _jobHandle, + JOBOBJECTINFOCLASS.JobObjectExtendedLimitInformation, + ptr, + (uint)length); + + if (!success) + { + throw new COMException("Failed to set the job extended information", Marshal.GetLastWin32Error()); + } + } + finally + { + Marshal.FreeHGlobal(ptr); + } + } + + /// + /// Adds a process to the job + /// + /// The process to add + public void Add(Process process) + { + if (process == null) + { + throw new ArgumentNullException(nameof(process)); + } + else if (process.Handle == IntPtr.Zero) + { + throw new ArgumentException("The specified process has a NULL handle"); + } + + bool success = AssignProcessToJobObject(_jobHandle, process.Handle); + if (!success) + { + throw new COMException("Failed to add the process to the job", Marshal.GetLastWin32Error()); + } + } + + /// + /// Closes the job. This will close all linked processes + /// + public void Close() + { + CloseHandle(_jobHandle); + _jobHandle = IntPtr.Zero; + } + + /// + /// Disposes of the job. This will also close all linked process. + /// + public void Dispose() + { + if (Interlocked.Exchange(ref _disposed, 1) == 0) + { + Close(); + } + } + + #region native methods + + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + internal static extern IntPtr CreateJobObject([In] ref SECURITY_ATTRIBUTES lpJobAttributes, string? lpName); + + [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + internal static extern IntPtr OpenJobObject(uint dwDesiredAccess, bool bInheritHandles, string lpName); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool AssignProcessToJobObject(IntPtr hJob, IntPtr hProcess); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool SetInformationJobObject( + [In] IntPtr hJob, + JOBOBJECTINFOCLASS JobObjectInfoClass, + [In] IntPtr lpJobObjectInfo, + uint cbJobObjectInfoLength); + + [DllImport("kernel32.dll", SetLastError = true)] +#if NETFRAMEWORK + [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif + [SuppressUnmanagedCodeSecurity] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool CloseHandle(IntPtr hObject); + +#endregion + + #region native types + + [StructLayout(LayoutKind.Sequential)] + internal struct SECURITY_ATTRIBUTES + { + public uint nLength; + public IntPtr lpSecurityDescriptor; + public bool bInheritHandle; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct JOBOBJECT_BASIC_LIMIT_INFORMATION + { + public Int64 PerProcessUserTimeLimit; + public Int64 PerJobUserTimeLimit; + public JobObjectLimits LimitFlags; + public UIntPtr MinimumWorkingSetSize; + public UIntPtr MaximumWorkingSetSize; + public UInt32 ActiveProcessLimit; + public UIntPtr Affinity; + public UInt32 PriorityClass; + public UInt32 SchedulingClass; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION + { + public JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation; + public IO_COUNTERS IoInfo; + public UIntPtr ProcessMemoryLimit; + public UIntPtr JobMemoryLimit; + public UIntPtr PeakProcessMemoryUsed; + public UIntPtr PeakJobMemoryUsed; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct IO_COUNTERS + { + public UInt64 ReadOperationCount; + public UInt64 WriteOperationCount; + public UInt64 OtherOperationCount; + public UInt64 ReadTransferCount; + public UInt64 WriteTransferCount; + public UInt64 OtherTransferCount; + } + + internal enum JOBOBJECTINFOCLASS + { + JobObjectExtendedLimitInformation = 9, + } + + internal enum JobObjectLimits : UInt32 + { + LIMIT_KILL_ON_JOB_CLOSE = 0x00002000, + } +} + +#endregion diff --git a/sdk/openai/tools/TestFramework/tests/AdaptersTests.cs b/sdk/openai/tools/TestFramework/tests/AdaptersTests.cs new file mode 100644 index 000000000000..266d388a3537 --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/AdaptersTests.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.Diagnostics; +using NUnit.Framework; +using OpenAI.TestFramework.Adapters; +using OpenAI.TestFramework.Mocks; + +namespace OpenAI.TestFramework.Tests; + +[TestFixture] +public class AdaptersTests +{ + public CancellationToken Token => + new CancellationTokenSource(Debugger.IsAttached + ? TimeSpan.FromMinutes(15) + : TimeSpan.FromSeconds(5)) + .Token; + + [Test] + public async Task TestSyncToAsyncEnumerator() + { + const int start = 0; + const int num = 100; + + IEnumerator sync = Enumerable.Range(start, num).GetEnumerator(); + await using SyncToAsyncEnumerator async = new(sync, Token); + + for (int i = start; i < num; i++) + { + bool success = await async.MoveNextAsync(); + Assert.That(success, Is.True); + Assert.That(async.Current, Is.EqualTo(i)); + } + } + + [Test] + public async Task TestSyncToAsyncResultCollection() + { + const int start = 0; + const int num = 100; + + MockCollectionResult sync = new(() => Enumerable.Range(start, num)); + SyncToAsyncCollectionResult asyncAdapter = new(sync); + + await using var asyncEnumerator = asyncAdapter.GetAsyncEnumerator(Token); + + for (int i = start; i < num; i++) + { + bool success = await asyncEnumerator.MoveNextAsync(); + Assert.That(success, Is.True); + Assert.That(asyncEnumerator.Current, Is.EqualTo(i)); + } + } + + [Test] + public async Task TestFailedSyncToAsyncResultCollection() + { + MockCollectionResult sync = new(Fail); + SyncToAsyncCollectionResult asyncAdapter = new(sync); + + await using var asyncEnumerator = asyncAdapter.GetAsyncEnumerator(Token); + Assert.ThrowsAsync(() => asyncEnumerator.MoveNextAsync().AsTask()); + } + + [Test] + public async Task TestSyncToAsyncPageableCollection() + { + const int start = 0; + const int num = 100; + const int itemsPerPage = 10; + int expectedPages = (int)Math.Ceiling((double)num / itemsPerPage); + + MockPageCollection sync = new(() => Enumerable.Range(start, num), new MockPipelineResponse(), itemsPerPage); + SyncToAsyncPageCollection asyncAdapter = new(sync); + + int numPages = 0; + int expected = 0; + await foreach (var page in asyncAdapter) + { + numPages++; + foreach (int actual in page.Values) + { + Assert.That(actual, Is.EqualTo(expected)); + expected++; + } + } + + Assert.That(numPages, Is.EqualTo(expectedPages)); + } + + [Test] + public async Task TestFailedSyncToAsyncPageableCollection() + { + MockPageCollection sync = new(Fail, new MockPipelineResponse()); + SyncToAsyncPageCollection asyncAdapter = new(sync); + + await using var asyncEnumerator = ((IAsyncEnumerable>)asyncAdapter).GetAsyncEnumerator(Token); + Assert.ThrowsAsync(() => asyncEnumerator.MoveNextAsync().AsTask()); + } + + private static IEnumerable Fail() + { + throw new ApplicationException("This should fail"); + } +} diff --git a/sdk/openai/tools/TestFramework/tests/AutoSyncAsyncTests.cs b/sdk/openai/tools/TestFramework/tests/AutoSyncAsyncTests.cs new file mode 100644 index 000000000000..44f13bee39f1 --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/AutoSyncAsyncTests.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using NUnit.Framework; +using OpenAI.TestFramework.Tests.Helpers; + +namespace OpenAI.TestFramework.Tests; + +public class AutoSyncAsyncTests(bool useAsync) : ClientTestBase(useAsync) +{ + private static readonly string EX_MSG = Guid.NewGuid().ToString(); + + [Test] + [SyncOnly] + public void OnlyInSyncMode() + { + Assert.That(IsAsync, Is.False); + } + + [Test] + [AsyncOnly] + public void OnlyInAsyncMode() + { + Assert.That(IsAsync, Is.True); + } + + [Test] + public void CanGetOriginal() + { + MockClient original = new MockClient(); + + MockClient instrumented = WrapClient(original); + Assert.That(instrumented, Is.Not.Null); + Assert.That(ReferenceEquals(original, instrumented), Is.False); + Assert.That(typeof(MockClient).IsAssignableFrom(instrumented.GetType()), Is.True); + + MockClient recovered = UnWrap(instrumented); + Assert.That(recovered, Is.Not.Null); + Assert.That(ReferenceEquals(original, recovered), Is.True); + } + + [Test] + public void CanGetContext() + { + var context = new MockClientContext(); + + MockClient client = WrapClient(new MockClient(), context); + Assert.That(client, Is.Not.Null); + + var recoveredContext = GetClientContext(client) as MockClientContext; + Assert.That(recoveredContext, Is.Not.Null); + Assert.That(recoveredContext!.Id, Is.EqualTo(context.Id)); + Assert.That(ReferenceEquals(recoveredContext, context), Is.True); + } + + [Test] + public async Task TaskWorks() + { + MockClient client = WrapClient(new MockClient()); + await client.DoAsync(); + AssertCorrectFunctionCalled(client); + } + + [Test] + public void FailedTaskWorks() + { + MockClient client = WrapClient(new MockClient()); + ArgumentException? ex = Assert.ThrowsAsync(() => client.FailAsync(EX_MSG)); + Assert.That(ex, Is.Not.Null); + Assert.That(ex!.Message, Is.EqualTo(EX_MSG)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public async Task TaskWithResultWorks() + { + MockClient client = WrapClient(new MockClient()); + int count = await client.CountAsync(); + Assert.That(count, Is.EqualTo(IsAsync ? 12 : 5)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public void FailedTaskWithResultWorks() + { + MockClient client = WrapClient(new MockClient()); + ArgumentException? ex = Assert.ThrowsAsync(() => client.FailWithResultAsync(EX_MSG)); + Assert.That(ex, Is.Not.Null); + Assert.That(ex!.Message, Is.EqualTo(EX_MSG)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public async Task ResultCollectionWorks() + { + const int num = 3; + const int increment = 2; + + MockClient client = WrapClient(new MockClient()); + AsyncCollectionResult coll = client.ResultCollectionAsync(num, increment); + + Assert.IsNotNull(coll); + Assert.That(coll.GetRawResponse(), Is.Not.Null); + Assert.That(coll.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(coll.GetRawResponse().ReasonPhrase, Is.EqualTo("OK")); + + int numResults = 0; + await foreach (int i in coll) + { + Assert.That(i, Is.EqualTo(numResults * increment)); + numResults++; + } + + Assert.That(numResults, Is.EqualTo(num)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public void FailedResultCollection() + { + MockClient client = WrapClient(new MockClient()); + + // For now we mimic how the OpenAI and Azure OpenAI libraries work in that no service requests are sent + // until we try to enumerate the async collections. So exceptions aren't expected initially + AsyncCollectionResult coll = client.FailResultCollectionAsync(EX_MSG); + Assert.That(coll, Is.Not.Null); + + IAsyncEnumerator enumerator = coll.GetAsyncEnumerator(); + Assert.That(enumerator, Is.Not.Null); + ArgumentException? ex = Assert.ThrowsAsync(() => enumerator.MoveNextAsync().AsTask()); + Assert.That(ex, Is.Not.Null); + Assert.That(ex!.Message, Is.EqualTo(EX_MSG)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public async Task PageableCollectionWorks() + { + const int num = 50; + const int increment = 1; + const int itemsPerPage = 20; + int expectedPages = (int)Math.Ceiling((double)num / itemsPerPage); + + MockClient client = WrapClient(new MockClient()); + AsyncPageCollection coll = client.PageableCollectionAsync(num, increment, itemsPerPage); + Assert.IsNotNull(coll); + + int numPages = 0; + int numResults = 0; + await foreach(PageResult page in coll) + { + Assert.That(page.GetRawResponse(), Is.Not.Null); + Assert.That(page.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(page.GetRawResponse().ReasonPhrase, Is.EqualTo("OK")); + + numPages++; + foreach (int actual in page.Values) + { + Assert.That(actual, Is.EqualTo(numResults * increment)); + numResults++; + } + } + + Assert.That(numResults, Is.EqualTo(num)); + Assert.That(numPages, Is.EqualTo(expectedPages)); + AssertCorrectFunctionCalled(client); + } + + [Test] + public void FailedPageableCollection() + { + MockClient client = WrapClient(new MockClient()); + + // For now we mimic how the OpenAI and Azure OpenAI libraries work in that no service requests are sent + // until we try to enumerate the async collections. So exceptions aren't expected initially + AsyncPageCollection coll = client.FailPageableCollectionAsync(EX_MSG); + Assert.That(coll, Is.Not.Null); + + IAsyncEnumerator> enumerator = ((IAsyncEnumerable>)coll).GetAsyncEnumerator(); + Assert.That(enumerator, Is.Not.Null); + ArgumentException? ex = Assert.ThrowsAsync(() => enumerator.MoveNextAsync().AsTask()); + Assert.That(ex, Is.Not.Null); + Assert.That(ex!.Message, Is.EqualTo(EX_MSG)); + AssertCorrectFunctionCalled(client); + } + + private void AssertCorrectFunctionCalled(MockClient client, int expectedCalls = 1) + { + if (IsAsync) + { + Assert.That(client.AsyncHit, Is.EqualTo(expectedCalls)); + Assert.That(client.SyncHit, Is.EqualTo(0)); + } + else + { + Assert.That(client.AsyncHit, Is.EqualTo(0)); + Assert.That(client.SyncHit, Is.EqualTo(expectedCalls)); + } + } +} diff --git a/sdk/openai/tools/TestFramework/tests/Helpers/MockClient.cs b/sdk/openai/tools/TestFramework/tests/Helpers/MockClient.cs new file mode 100644 index 000000000000..9eac6054d6f0 --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/Helpers/MockClient.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.Runtime.CompilerServices; +using OpenAI.TestFramework.Mocks; + +namespace OpenAI.TestFramework.Tests.Helpers; + +public class MockClient +{ + private int _asyncHit; + private int _syncHit; + + public virtual int AsyncHit => _asyncHit; + public virtual int SyncHit => _syncHit; + + public virtual Task DoAsync() + { + Interlocked.Increment(ref _asyncHit); + return Task.Delay(200); + } + + public virtual void Do() + { + Interlocked.Increment(ref _syncHit); + } + + public virtual Task FailAsync(string message) + { + Interlocked.Increment(ref _asyncHit); + return Task.FromException(new ArgumentException(message)); + } + + public virtual void Fail(string message) + { + Interlocked.Increment(ref _syncHit); + throw new ArgumentException(message); + } + + public virtual async Task CountAsync() + { + Interlocked.Increment(ref _asyncHit); + await Task.Delay(100).ConfigureAwait(false); + return 12; + } + + public virtual int Count() + { + Interlocked.Increment(ref _syncHit); + return 5; + } + + public virtual Task FailWithResultAsync(string message) + { + Interlocked.Increment(ref _asyncHit); + return Task.FromException(new ArgumentException(message)); + } + + public virtual int FailWithResult(string message) + { + Interlocked.Increment(ref _syncHit); + throw new ArgumentException(message); + } + + public virtual AsyncCollectionResult ResultCollectionAsync(int num, int increment = 5) + { + Interlocked.Increment(ref _asyncHit); + return new MockAsyncCollectionResult(() => EnumerateAsync(num, increment)); + } + + public virtual CollectionResult ResultCollection(int num, int increment = 5) + { + Interlocked.Increment(ref _syncHit); + return new MockCollectionResult(() => Enumerate(num, increment)); + } + + public virtual AsyncCollectionResult FailResultCollectionAsync(string message) + { + Interlocked.Increment(ref _asyncHit); + return new MockAsyncCollectionResult(() => FailEnumerateAsync(message)); + } + + public virtual CollectionResult FailResultCollection(string message) + { + Interlocked.Increment(ref _syncHit); + return new MockCollectionResult(() => FailEnumerate(message)); + } + + public virtual AsyncPageCollection PageableCollectionAsync(int num, int increment, int itemsPerPage) + { + Interlocked.Increment(ref _asyncHit); + return new MockAsyncPageCollection(() => EnumerateAsync(num, increment), new MockPipelineResponse(), itemsPerPage); + } + + public virtual PageCollection PageableCollection(int num, int increment, int itemsPerPage) + { + Interlocked.Increment(ref _syncHit); + return new MockPageCollection(() => Enumerate(num, increment), new MockPipelineResponse(), itemsPerPage); + } + + public virtual AsyncPageCollection FailPageableCollectionAsync(string message) + { + Interlocked.Increment(ref _asyncHit); + return new MockAsyncPageCollection(() => FailEnumerateAsync(message), new MockPipelineResponse()); + } + + public virtual PageCollection FailPageableCollection(string message) + { + Interlocked.Increment(ref _syncHit); + return new MockPageCollection(() => FailEnumerate(message), new MockPipelineResponse()); + } + + private async IAsyncEnumerable EnumerateAsync(int num, int increment, [EnumeratorCancellation] CancellationToken token = default) + { + int running = 0; + for (int i = 0; i < num; i++, running += increment) + { + await Task.Delay(100); + yield return running; + } + } + + private IEnumerable Enumerate(int num, int increment) + { + int running = 0; + for (int i = 0; i < num; i++, running += increment) + { + yield return running; + } + } + + private async IAsyncEnumerable FailEnumerateAsync(string message, [EnumeratorCancellation] CancellationToken token = default) + { + bool c = true; + await Task.Delay(100).ConfigureAwait(false); + if (c) + { + throw new ArgumentException(message); + } + + yield break; + } + + private IEnumerable FailEnumerate(string message) + { + throw new ArgumentException(message); + } +} diff --git a/sdk/openai/tools/TestFramework/tests/Helpers/MockClientContext.cs b/sdk/openai/tools/TestFramework/tests/Helpers/MockClientContext.cs new file mode 100644 index 000000000000..e36ed1e1f458 --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/Helpers/MockClientContext.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace OpenAI.TestFramework.Tests.Helpers; + +public class MockClientContext +{ + public string Id { get; } = Guid.NewGuid().ToString(); +} diff --git a/sdk/openai/tools/TestFramework/tests/MockStringServiceTests.cs b/sdk/openai/tools/TestFramework/tests/MockStringServiceTests.cs new file mode 100644 index 000000000000..d5d3edff45f0 --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/MockStringServiceTests.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Reflection; +using NUnit.Framework; +using OpenAI.TestFramework.Mocks; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.Proxy.Service; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Tests; + +public class MockStringServiceTests : RecordedClientTestBase +{ + private const string c_basePath = "data"; + + public MockStringServiceTests(bool isAsync) + : base(isAsync, null) + { + RecordingOptions.SanitizersToRemove.Add("AZSDK3430"); // $..id + } + + public DirectoryInfo RepositoryRoot { get; } = FindRepoRoot(); + + [Test] + public async Task AddAndGet() + { + const string id = "first.one"; + const string expected = "The first value goes here"; + + using MockRestService service = new(c_basePath); + var options = ConfigureClientOptions(new ClientPipelineOptions()); + using var client = WrapClient(new MockRestServiceClient(service.HttpEndpoint, options)); + + ClientResult add = await client.AddAsync(id, expected, Token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + + string? retrieved = await client.GetAsync("first.one", Token); + Assert.That(retrieved, Is.EqualTo(expected)); + } + + [Test] + public async Task AddAndDelete() + { + const string id = "first.one"; + const string expected = "The first value goes here"; + + using MockRestService service = new(c_basePath); + var options = ConfigureClientOptions(new ClientPipelineOptions()); + using var client = WrapClient(new MockRestServiceClient(service.HttpEndpoint, options)); + + ClientResult add = await client.AddAsync(id, expected, Token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + + bool deleted = await client.RemoveAsync(id, Token); + Assert.That(deleted, Is.True); + + string? retrieved = await client.GetAsync("first.one", Token); + Assert.That(retrieved, Is.Null); + } + + #region overrides + + protected override ProxyServiceOptions CreateProxyServiceOptions() + => new() + { + DotnetExecutable = AssemblyHelper.GetDotnetExecutable()?.FullName!, + TestProxyDll = AssemblyHelper.GetAssemblyMetadata("TestProxyPath")!, + DevCertFile = Path.Combine( + RepositoryRoot.FullName, + "eng", + "common", + "testproxy", + "dotnet-devcert.pfx"), + DevCertPassword = "password", + StorageLocationDir = RepositoryRoot.FullName, + }; + + protected override RecordingStartInformation CreateRecordingSessionStartInfo() + => new() + { + RecordingFile = GetRecordingFile(), + AssetsFile = GetAssetsFile() + }; + + #endregion + + #region helper methods + + private static DirectoryInfo FindRepoRoot() + { + /** + * This code assumes that we are running in the standard Azure .Net SDK repository layout. With this in mind, + * we generally assume that we are running our test code from + * /artifacts/bin/// + * So to find the root we keep navigating up until we find a folder with a .git subfolder + * + * Another alternative would be to call: git rev-parse --show-toplevel + */ + + DirectoryInfo? current = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory; + while (current != null && !current.EnumerateDirectories(".git").Any()) + { + current = current.Parent; + } + + return current + ?? throw new InvalidOperationException("Could not determine the root folder for this repository"); + } + + private string GetRecordingFile() + { + DirectoryInfo sourceDir = AssemblyHelper.GetAssemblySourceDir() + ?? throw new InvalidOperationException("Could not determine the source path for this assembly"); + string relativeDir = PathHelpers.GetRelativePath(RepositoryRoot.FullName, sourceDir.FullName); + return Path.Combine( + relativeDir, + "SessionRecords", + GetType().Name, + GetRecordedTestFileName()); + } + + private string? GetAssetsFile() + { + DirectoryInfo? sourceDir = AssemblyHelper.GetAssemblySourceDir() + ?? throw new InvalidOperationException("Could not determine the source path for this assembly"); + + // walk up the tree until we hit either the repository root, or found a folder with an "assets.json" file + for (; sourceDir != null && sourceDir?.FullName != RepositoryRoot.FullName; sourceDir = sourceDir.Parent) + { + string assetsFile = Path.Combine(sourceDir!.FullName, "assets.json"); + if (File.Exists(assetsFile)) + { + return assetsFile; + } + } + + return null; + } + + #endregion +} diff --git a/sdk/openai/tools/TestFramework/tests/OpenAI.TestFramework.Tests.csproj b/sdk/openai/tools/TestFramework/tests/OpenAI.TestFramework.Tests.csproj new file mode 100644 index 000000000000..e6934e2923ce --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/OpenAI.TestFramework.Tests.csproj @@ -0,0 +1,21 @@ + + + + $(RequiredTargetFrameworks);net8.0 + enable + enable + latest + + + + + + + + + + + + + + diff --git a/sdk/openai/tools/TestFramework/tests/ProxyServiceTests.cs b/sdk/openai/tools/TestFramework/tests/ProxyServiceTests.cs new file mode 100644 index 000000000000..496afbc6dc50 --- /dev/null +++ b/sdk/openai/tools/TestFramework/tests/ProxyServiceTests.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ClientModel; +using System.ClientModel.Primitives; +using NUnit.Framework; +using OpenAI.TestFramework.Mocks; +using OpenAI.TestFramework.Recording; +using OpenAI.TestFramework.Recording.Matchers; +using OpenAI.TestFramework.Recording.Proxy; +using OpenAI.TestFramework.Recording.Proxy.Service; +using OpenAI.TestFramework.Recording.RecordingProxy; +using OpenAI.TestFramework.Recording.Sanitizers; +using OpenAI.TestFramework.Recording.Transforms; +using OpenAI.TestFramework.Utils; + +namespace OpenAI.TestFramework.Tests +{ + [NonParallelizable] + public class ProxyServiceTests(bool isAsync) : ClientTestBase(isAsync) + { + #region Properties and setup/teardown methods + + public DirectoryInfo? RecordingDir { get; private set; } + + public FileInfo? RecordingFile { get; private set; } + + [SetUp] + public void CreateRecordingFile() + { + RecordingDir = new DirectoryInfo(Path.Combine(Path.GetTempPath(), "RecordingTests", Guid.NewGuid().ToString())); + if (!RecordingDir.Exists) + { + RecordingDir.Create(); + } + + RecordingFile = new FileInfo(Path.Combine(RecordingDir.FullName, Path.GetRandomFileName() + ".json")); + } + + [TearDown] + public void DeleteRecordingFile() + { + if (RecordingFile != null) + { + RecordingFile.Delete(); + } + + if (RecordingDir != null) + { + RecordingDir.Delete(true); + } + } + + #endregion + + [Test] + public async Task StartProxy() + { + using ProxyService proxy = await CreateProxyServiceAsync(); + + Assert.That(proxy.HttpEndpoint, Is.Not.Null); + Assert.That(proxy.HttpEndpoint.Port, Is.GreaterThan(0).And.LessThanOrEqualTo(ushort.MaxValue)); + Assert.That(proxy.HttpsEndpoint, Is.Not.Null); + Assert.That(proxy.HttpsEndpoint.Port, Is.GreaterThan(0).And.LessThanOrEqualTo(ushort.MaxValue)); + + ProxyClientResult available = await proxy.Client.ListAvailableAsync(Token); + Assert.That(available, Is.Not.Null); + Assert.That(available.GetRawResponse(), Is.Not.Null); + Assert.That(available.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(available.Value, Is.Not.Null); + Assert.That(available.Value, Does.Contain("BodilessMatcher")); + } + + [Test] + public async Task AddSanitizers() + { + using ProxyService proxy = await CreateProxyServiceAsync(); + + List sanitizers = + [ + new BodyKeySanitizer("body.key"), + new BodyRegexSanitizer("(.*)") + { + GroupForReplace = "1", + Condition = new Recording.Condition() + { + ResponseHeader = new() + { + Key = "Content-Type", + ValueRegex = "json$" + }, + UriRegex = "https://[^/]+/sub" + } + }, + new HeaderRegexSanitizer("Authentication") + { + Value = "replacement", + GroupForReplace = "1", + Regex = "^Bearer " + }, + new UriRegexSanitizer("https://[^/]+/sub") + { + GroupForReplace = "1", + Value = "replacement" + } + ]; + + ProxyClientResult> result = await proxy.Client.AddSanitizersAsync(sanitizers, token: Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.GetRawResponse(), Is.Not.Null); + Assert.That(result.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(result.Value, Is.Not.Null); + Assert.That(result.Value, Has.Count.EqualTo(sanitizers.Count)); + } + + [Test] + public async Task SetMatcher() + { + using ProxyService proxy = await CreateProxyServiceAsync(); + + BaseMatcher[] matchers = + [ + ExistingMatcher.Headerless, + ExistingMatcher.Bodiless, + new CustomMatcher() + { + CompareBodies = false, + ExcludedHeaders = "Authorization", + IgnoredHeaders = "Content-Length,Content-Type", + IgnoredQueryParameters = "page,version", + IgnoreQueryOrdering = true, + } + ]; + + foreach (var matcher in matchers) + { + ProxyClientResult result = await proxy.Client.SetMatcherAsync(matcher, token: Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.GetRawResponse(), Is.Not.Null); + Assert.That(result.GetRawResponse().Status, Is.EqualTo(200)); + } + } + + [Test] + public async Task SetTransform() + { + using ProxyService proxy = await CreateProxyServiceAsync(); + + HeaderTransform transform = new("X-Client-RequestId") + { + Value = "replacement", + Condition = new() + { + UriRegex = "http.*://[^/]+/(.*)" + } + }; + + ProxyClientResult result = await proxy.Client.AddTransformAsync(transform, token: Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.GetRawResponse(), Is.Not.Null); + Assert.That(result.GetRawResponse().Status, Is.EqualTo(200)); + } + + [Test] + public async Task StartStopRecording() + { + const string key1 = "key1"; + string value1 = Guid.NewGuid().ToString(); + const string key2 = "the.others"; + string value2 = "value"; + + using ProxyService proxy = await CreateProxyServiceAsync(); + + RecordingStartInformation startInfo = new() + { + RecordingFile = RecordingFile!.FullName, + }; + + ProxyClientResult result = await proxy.Client.StartRecordingAsync(startInfo, token: Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.GetRawResponse(), Is.Not.Null); + Assert.That(result.GetRawResponse().Status, Is.EqualTo(200)); + + string recordingId = result.RecordingId!; + Assert.That(recordingId, Is.Not.Null); + + Dictionary additional = new() + { + [key1] = value1, + [key2] = value2, + }; + + result = await proxy.Client.StopRecordingAsync(recordingId, additional, false, Token); + + // At this point we should have a recording file + string recordedJson = File.ReadAllText(RecordingFile.FullName); + Assert.That(recordedJson, Does.Contain(key1) + .And.Contain(value1) + .And.Contain(key2) + .And.Contain(value2)); + } + + [Test] + public async Task RecordAndPlayback() + { + using ProxyService recordingProxyService = await CreateProxyServiceAsync(); + RecordingStartInformation startInfo = new() { RecordingFile = RecordingFile!.FullName }; + + using MockRestService mockRestService = new(); + TestRecordingOptions recordingOptions = new() + { + SanitizersToRemove = + { + "AZSDK3430", // $..id + } + }; + + string id1; + string id2; + + // Start recording, and capture some requests + { + ProxyClientResult result = await recordingProxyService.Client.StartRecordingAsync(startInfo, Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.RecordingId, !Is.Null.Or.Empty); + string recordingId = result.RecordingId!; + + await using TestRecording recording = new(recordingId, RecordedTestMode.Record, recordingProxyService); + await recording.ApplyOptions(recordingOptions, Token); + + id1 = recording.Random.NewGuid().ToString(); + id2 = recording.Random.NewGuid().ToString(); + + await SendRequestsAsync(recording, mockRestService.HttpEndpoint, id1, id2, Token); + } + + // validate the service has what we expect + var serviceIds = mockRestService.GetAll() + .Select(e => e.id) + .ToArray(); + Assert.That(serviceIds, Is.EquivalentTo(new[] { id1, id2 })); + + mockRestService.Reset(); + + // Playback the recording + { + ProxyClientResult> result = await recordingProxyService.Client.StartPlaybackAsync(startInfo, Token); + Assert.That(result, Is.Not.Null); + Assert.That(result.RecordingId, !Is.Null.Or.Empty); + string recordingId = result.RecordingId!; + + await using TestRecording playback = new(recordingId, RecordedTestMode.Playback, recordingProxyService, result.Value); + await playback.ApplyOptions(recordingOptions, Token); + + string id = playback.Random.NewGuid().ToString(); + Assert.That(id, Is.EqualTo(id1)); + id = playback.Random.NewGuid().ToString(); + Assert.That(id, Is.EqualTo(id2)); + + await SendRequestsAsync(playback, mockRestService.HttpEndpoint, id1, id2, Token); + } + + // since we are playing back, the service should not have been called + Assert.That(mockRestService.GetAll().Count(), Is.EqualTo(0)); + + static async Task SendRequestsAsync(TestRecording recording, Uri restEndpoint, string id1, string id2, CancellationToken token) + { + const string value1 = "The value for the first item"; + const string value2 = "The secondary value goes here"; + const string id3 = "random"; + const string value3 = "Sure why not"; + + ClientPipelineOptions options = new(); + options.RetryPolicy = new TestClientRetryPolicy(0, TimeSpan.FromMilliseconds(100)); + options.Transport = new ProxyTransport(recording.GetProxyTransportOptions()); + + using MockRestServiceClient client = new(restEndpoint, options); + + ClientResult add = await client.AddAsync(id1, value1, token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + + add = await client.AddAsync(id2, value2, token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + + add = await client.AddAsync(id3, value3, token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + + ClientResult get = await client.GetAsync(id2, token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(get.Value, Is.EqualTo(value2)); + + get = await client.GetAsync(id3, token); + Assert.That(add, Is.Not.Null); + Assert.That(add.GetRawResponse().Status, Is.EqualTo(200)); + Assert.That(get.Value, Is.EqualTo(value3)); + + ClientResult remove = await client.RemoveAsync(id3, token); + Assert.That(remove.Value, Is.True); + + remove = await client.RemoveAsync("does.not.exist", token); + Assert.That(remove.Value, Is.False); + + get = await client.GetAsync(id3, token); + Assert.That(get, Is.Not.Null); + Assert.That(get.GetRawResponse().Status, Is.EqualTo(404)); + Assert.That(get.Value, Is.Null); + } + } + + #region helper methods + + private async Task CreateProxyServiceAsync() + { + ProxyService? proxy = null; + try + { + proxy = await ProxyService.CreateNewAsync( + new ProxyServiceOptions() + { + DotnetExecutable = AssemblyHelper.GetDotnetExecutable()?.FullName!, + TestProxyDll = AssemblyHelper.GetAssemblyMetadata("TestProxyPath")!, + StorageLocationDir = RecordingDir!.FullName + }, + Token); + + Assert.That(proxy, Is.Not.Null); + Assert.DoesNotThrow(proxy.ThrowOnErrors); + Assert.That(proxy.Client, Is.Not.Null); + + var wrappedClient = WrapClient(proxy.Client); + var setter = typeof(ProxyService).GetMethod("SetClient", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance) + ?? throw new InvalidOperationException("Could not find the ProxyService.SetClient method"); + setter.Invoke(proxy, [wrappedClient]); + + var ret = proxy; + proxy = null; + return ret; + } + finally + { + proxy?.Dispose(); + } + } + + #endregion + } +} diff --git a/sdk/personalizer/Azure.AI.Personalizer/src/Azure.AI.Personalizer.csproj b/sdk/personalizer/Azure.AI.Personalizer/src/Azure.AI.Personalizer.csproj index 7340bc57ca40..9ec946133f5e 100644 --- a/sdk/personalizer/Azure.AI.Personalizer/src/Azure.AI.Personalizer.csproj +++ b/sdk/personalizer/Azure.AI.Personalizer/src/Azure.AI.Personalizer.csproj @@ -22,6 +22,8 @@ + + diff --git a/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlNetProcessor.cs b/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlNetProcessor.cs index 3c946b9f9bbe..6961378d954c 100644 --- a/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlNetProcessor.cs +++ b/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlNetProcessor.cs @@ -8,6 +8,7 @@ using System.Globalization; using System.Linq; using System.Text.Json; +using System.Text.Json.Serialization; using Rl.Net; namespace Azure.AI.Personalizer @@ -95,7 +96,7 @@ public Response Rank(PersonalizerRankMultiSlotO { new JsonBinaryDataConverter(), }, - IgnoreNullValues = true + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }; var contextJson = JsonSerializer.Serialize(decisionContext, jsonSerializerOptions); ActionFlags flags = options.DeferActivation == true ? ActionFlags.Deferred : ActionFlags.Default; diff --git a/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlObjectConverter.cs b/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlObjectConverter.cs index 7d88a0c68ba1..7e8a182e24fe 100644 --- a/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlObjectConverter.cs +++ b/sdk/personalizer/Azure.AI.Personalizer/src/Models/RlObjectConverter.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using Azure.Core; +using System.Text.Json.Serialization; namespace Azure.AI.Personalizer { @@ -24,7 +25,7 @@ public static string ConvertToContextJson(IList contextFeatures, Lis { new JsonBinaryDataConverter(), }, - IgnoreNullValues = true + DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull }; return JsonSerializer.Serialize(decisionContext, jsonSerializerOptions); } diff --git a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md index 3e844a7a0191..a765afc8554f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md +++ b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.13.0-beta.1 (Unreleased) +## 1.14.0-beta.1 (Unreleased) ### Features Added @@ -8,6 +8,13 @@ ### Bugs Fixed +### Other Changes + +## 1.13.0 (2024-09-03) + +### Features Added +- Added `JsonModelWriteCore` to serialization file so that derived models could call it without doing the serialization of base properties themselves. + ### Other Changes - Added to the sample code to authenticate with the azure in China in the README.md file. diff --git a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs index 07f2be1da6e8..5014bef15852 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs @@ -162,6 +162,7 @@ internal ManagementGroupData() { } public Azure.ResourceManager.ManagementGroups.Models.ManagementGroupInfo Details { get { throw null; } } public string DisplayName { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.ManagementGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.ManagementGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -222,6 +223,7 @@ internal ManagementGroupSubscriptionData() { } public Azure.Core.ResourceIdentifier ParentId { get { throw null; } } public string State { get { throw null; } } public string Tenant { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.ManagementGroupSubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.ManagementGroupSubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -257,6 +259,7 @@ public CreateManagementGroupDetails() { } public string UpdatedBy { get { throw null; } } public System.DateTimeOffset? UpdatedOn { get { throw null; } } public int? Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.CreateManagementGroupDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.CreateManagementGroupDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -268,6 +271,7 @@ public partial class DescendantData : Azure.ResourceManager.Models.ResourceData, internal DescendantData() { } public string DisplayName { get { throw null; } } public Azure.Core.ResourceIdentifier ParentId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.DescendantData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.DescendantData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -287,6 +291,7 @@ internal EntityData() { } public System.Collections.Generic.IReadOnlyList ParentNameChain { get { throw null; } } public Azure.ResourceManager.ManagementGroups.Models.EntityPermission? Permissions { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.EntityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.EntityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -349,6 +354,7 @@ internal ManagementGroupChildInfo() { } public string DisplayName { get { throw null; } } public string Id { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupChildInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupChildInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -363,6 +369,7 @@ internal ManagementGroupChildOptions() { } public string DisplayName { get { throw null; } } public string Id { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupChildOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupChildOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -410,6 +417,7 @@ public ManagementGroupCreateOrUpdateContent() { } public string Name { get { throw null; } set { } } public Azure.Core.ResourceType? ResourceType { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -445,6 +453,7 @@ internal ManagementGroupInfo() { } public string UpdatedBy { get { throw null; } } public System.DateTimeOffset? UpdatedOn { get { throw null; } } public int? Version { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -456,6 +465,7 @@ public partial class ManagementGroupNameAvailabilityContent : System.ClientModel public ManagementGroupNameAvailabilityContent() { } public string Name { get { throw null; } set { } } public Azure.Core.ResourceType? ResourceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -468,6 +478,7 @@ internal ManagementGroupNameAvailabilityResult() { } public string Message { get { throw null; } } public bool? NameAvailable { get { throw null; } } public Azure.ResourceManager.ManagementGroups.Models.ManagementGroupNameUnavailableReason? Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -485,6 +496,7 @@ public ManagementGroupParentCreateOptions() { } public string DisplayName { get { throw null; } } public string Id { get { throw null; } set { } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupParentCreateOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupParentCreateOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -496,6 +508,7 @@ public partial class ManagementGroupPatch : System.ClientModel.Primitives.IJsonM public ManagementGroupPatch() { } public string DisplayName { get { throw null; } set { } } public string ParentGroupId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -507,6 +520,7 @@ public partial class ManagementGroupPathElement : System.ClientModel.Primitives. internal ManagementGroupPathElement() { } public string DisplayName { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupPathElement System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ManagementGroupPathElement System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -519,6 +533,7 @@ internal ParentManagementGroupInfo() { } public string DisplayName { get { throw null; } } public string Id { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ParentManagementGroupInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ManagementGroups.Models.ParentManagementGroupInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -604,6 +619,7 @@ public partial class EncryptionProperties : System.ClientModel.Primitives.IJsonM public EncryptionProperties() { } public Azure.ResourceManager.Models.KeyVaultProperties KeyVaultProperties { get { throw null; } set { } } public Azure.ResourceManager.Models.EncryptionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.EncryptionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.EncryptionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -637,6 +653,7 @@ public partial class KeyVaultProperties : System.ClientModel.Primitives.IJsonMod public KeyVaultProperties() { } public string Identity { get { throw null; } set { } } public string KeyIdentifier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.KeyVaultProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.KeyVaultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -689,6 +706,7 @@ public OperationStatusResult(string status) { } public float? PercentComplete { get { throw null; } } public System.DateTimeOffset? StartOn { get { throw null; } } public string Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.OperationStatusResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.OperationStatusResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -703,6 +721,7 @@ protected ResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core public string Name { get { throw null; } } public Azure.Core.ResourceType ResourceType { get { throw null; } } public Azure.ResourceManager.Models.SystemData SystemData { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } } public static partial class ResourceManagerModelFactory { @@ -771,6 +790,7 @@ public SystemAssignedServiceIdentity(Azure.ResourceManager.Models.SystemAssigned public System.Guid? PrincipalId { get { throw null; } } public Azure.ResourceManager.Models.SystemAssignedServiceIdentityType SystemAssignedServiceIdentityType { get { throw null; } set { } } public System.Guid? TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.SystemAssignedServiceIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.SystemAssignedServiceIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -806,6 +826,7 @@ public SystemData() { } public string LastModifiedBy { get { throw null; } } public Azure.ResourceManager.Models.CreatedByType? LastModifiedByType { get { throw null; } } public System.DateTimeOffset? LastModifiedOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.SystemData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.SystemData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -819,12 +840,14 @@ protected TrackedResourceData(Azure.Core.AzureLocation location) { } protected TrackedResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location) { } public Azure.Core.AzureLocation Location { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } } public partial class UserAssignedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public UserAssignedIdentity() { } public System.Guid? ClientId { get { throw null; } } public System.Guid? PrincipalId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.UserAssignedIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Models.UserAssignedIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -869,6 +892,7 @@ internal DataPolicyManifestData() { } public string PolicyMode { get { throw null; } } public System.Collections.Generic.IReadOnlyList ResourceTypeAliases { get { throw null; } } public System.Collections.Generic.IReadOnlyList Standard { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.DataPolicyManifestData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.DataPolicyManifestData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -909,6 +933,7 @@ public partial class FeatureData : Azure.ResourceManager.Models.ResourceData, Sy { internal FeatureData() { } public string FeatureState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.FeatureData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.FeatureData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -974,6 +999,7 @@ public GenericResourceData(Azure.Core.AzureLocation location) : base (default(Az public System.BinaryData Properties { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } public Azure.ResourceManager.Resources.Models.ResourcesSku Sku { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.GenericResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.GenericResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1075,6 +1101,7 @@ public ManagementLockData(Azure.ResourceManager.Resources.Models.ManagementLockL public Azure.ResourceManager.Resources.Models.ManagementLockLevel Level { get { throw null; } set { } } public string Notes { get { throw null; } set { } } public System.Collections.Generic.IList Owners { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ManagementLockData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ManagementLockData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1136,6 +1163,7 @@ public PolicyAssignmentData() { } public string PolicyDefinitionId { get { throw null; } set { } } public System.Collections.Generic.IList ResourceSelectors { get { throw null; } } public string Scope { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicyAssignmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicyAssignmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1173,6 +1201,7 @@ public PolicyDefinitionData() { } public System.Collections.Generic.IDictionary Parameters { get { throw null; } } public System.BinaryData PolicyRule { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.PolicyType? PolicyType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicyDefinitionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicyDefinitionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1189,6 +1218,7 @@ public PolicySetDefinitionData() { } public System.Collections.Generic.IList PolicyDefinitionGroups { get { throw null; } } public System.Collections.Generic.IList PolicyDefinitions { get { throw null; } } public Azure.ResourceManager.Resources.Models.PolicyType? PolicyType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicySetDefinitionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.PolicySetDefinitionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1217,6 +1247,7 @@ public partial class ResourceGroupData : Azure.ResourceManager.Models.TrackedRes public ResourceGroupData(Azure.Core.AzureLocation location) { } public string ManagedBy { get { throw null; } set { } } public string ResourceGroupProvisioningState { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ResourceGroupData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ResourceGroupData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1286,6 +1317,7 @@ public ResourceProviderData() { } public string RegistrationPolicy { get { throw null; } } public string RegistrationState { get { throw null; } } public System.Collections.Generic.IReadOnlyList ResourceTypes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ResourceProviderData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.ResourceProviderData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1345,6 +1377,7 @@ internal SubscriptionData() { } public Azure.ResourceManager.Resources.Models.SubscriptionPolicies SubscriptionPolicies { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } public System.Guid? TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.SubscriptionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.SubscriptionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1498,6 +1531,7 @@ public partial class TagResourceData : Azure.ResourceManager.Models.ResourceData { public TagResourceData(Azure.ResourceManager.Resources.Models.Tag properties) { } public System.Collections.Generic.IDictionary TagValues { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.TagResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.TagResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1528,6 +1562,7 @@ internal TenantData() { } public Azure.ResourceManager.Resources.Models.TenantCategory? TenantCategory { get { throw null; } } public System.Guid? TenantId { get { throw null; } } public string TenantType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.TenantData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.TenantData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1642,6 +1677,7 @@ public partial class ApiProfile : System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ApiProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1655,6 +1691,7 @@ public ArmPolicyParameter() { } public System.BinaryData DefaultValue { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.ParameterDefinitionsValueMetadata Metadata { get { throw null; } set { } } public Azure.ResourceManager.Resources.Models.ArmPolicyParameterType? ParameterType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmPolicyParameter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmPolicyParameter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1688,6 +1725,7 @@ public partial class ArmPolicyParameterValue : System.ClientModel.Primitives.IJs { public ArmPolicyParameterValue() { } public System.BinaryData Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmPolicyParameterValue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ArmPolicyParameterValue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1714,6 +1752,7 @@ public partial class AvailabilityZoneMappings : System.ClientModel.Primitives.IJ internal AvailabilityZoneMappings() { } public string LogicalZone { get { throw null; } } public string PhysicalZone { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.AvailabilityZoneMappings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.AvailabilityZoneMappings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1728,6 +1767,7 @@ internal AzureRoleDefinition() { } public string Name { get { throw null; } } public System.Collections.Generic.IReadOnlyList Permissions { get { throw null; } } public System.Collections.Generic.IReadOnlyList Scopes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.AzureRoleDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.AzureRoleDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1741,6 +1781,7 @@ internal DataManifestCustomResourceFunctionDefinition() { } public System.Collections.Generic.IReadOnlyList DefaultProperties { get { throw null; } } public Azure.Core.ResourceType? FullyQualifiedResourceType { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.DataManifestCustomResourceFunctionDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.DataManifestCustomResourceFunctionDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1752,6 +1793,7 @@ public partial class DataPolicyManifestEffect : System.ClientModel.Primitives.IJ internal DataPolicyManifestEffect() { } public System.BinaryData DetailsSchema { get { throw null; } } public string Name { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.DataPolicyManifestEffect System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.DataPolicyManifestEffect System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1783,6 +1825,7 @@ public partial class ExportTemplate : System.ClientModel.Primitives.IJsonModel Resources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ExportTemplate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ExportTemplate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1794,6 +1837,7 @@ public partial class ExtendedLocation : System.ClientModel.Primitives.IJsonModel public ExtendedLocation() { } public Azure.ResourceManager.Resources.Models.ExtendedLocationType? ExtendedLocationType { get { throw null; } set { } } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ExtendedLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ExtendedLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1828,6 +1872,7 @@ internal LocationExpanded() { } public string Name { get { throw null; } } public string RegionalDisplayName { get { throw null; } } public string SubscriptionId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } public static implicit operator Azure.Core.AzureLocation (Azure.ResourceManager.Resources.Models.LocationExpanded location) { throw null; } Azure.ResourceManager.Resources.Models.LocationExpanded System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1847,6 +1892,7 @@ internal LocationMetadata() { } public string PhysicalLocation { get { throw null; } } public Azure.ResourceManager.Resources.Models.RegionCategory? RegionCategory { get { throw null; } } public Azure.ResourceManager.Resources.Models.RegionType? RegionType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.LocationMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.LocationMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1862,6 +1908,7 @@ public partial class ManagedByTenant : System.ClientModel.Primitives.IJsonModel< { internal ManagedByTenant() { } public System.Guid? TenantId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ManagedByTenant System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ManagedByTenant System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1891,6 +1938,7 @@ public partial class ManagementLockOwner : System.ClientModel.Primitives.IJsonMo { public ManagementLockOwner() { } public string ApplicationId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ManagementLockOwner System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ManagementLockOwner System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1902,6 +1950,7 @@ public partial class NonComplianceMessage : System.ClientModel.Primitives.IJsonM public NonComplianceMessage(string message) { } public string Message { get { throw null; } set { } } public string PolicyDefinitionReferenceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.NonComplianceMessage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.NonComplianceMessage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1914,6 +1963,7 @@ internal PairedRegion() { } public string Id { get { throw null; } } public string Name { get { throw null; } } public string SubscriptionId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PairedRegion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PairedRegion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1928,6 +1978,7 @@ public ParameterDefinitionsValueMetadata() { } public string Description { get { throw null; } set { } } public string DisplayName { get { throw null; } set { } } public string StrongType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ParameterDefinitionsValueMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ParameterDefinitionsValueMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1941,6 +1992,7 @@ internal Permission() { } public System.Collections.Generic.IReadOnlyList AllowedDataActions { get { throw null; } } public System.Collections.Generic.IReadOnlyList DeniedActions { get { throw null; } } public System.Collections.Generic.IReadOnlyList DeniedDataActions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.Permission System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.Permission System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1954,6 +2006,7 @@ public PolicyAssignmentPatch() { } public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public System.Collections.Generic.IList Overrides { get { throw null; } } public System.Collections.Generic.IList ResourceSelectors { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyAssignmentPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyAssignmentPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1968,6 +2021,7 @@ public PolicyDefinitionGroup(string name) { } public string Description { get { throw null; } set { } } public string DisplayName { get { throw null; } set { } } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyDefinitionGroup System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyDefinitionGroup System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1981,6 +2035,7 @@ public PolicyDefinitionReference(string policyDefinitionId) { } public System.Collections.Generic.IDictionary Parameters { get { throw null; } } public string PolicyDefinitionId { get { throw null; } set { } } public string PolicyDefinitionReferenceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyDefinitionReference System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyDefinitionReference System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1993,6 +2048,7 @@ public PolicyOverride() { } public Azure.ResourceManager.Resources.Models.PolicyOverrideKind? Kind { get { throw null; } set { } } public System.Collections.Generic.IList Selectors { get { throw null; } } public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyOverride System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PolicyOverride System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2043,6 +2099,7 @@ internal PredefinedTag() { } public string Id { get { throw null; } } public string TagName { get { throw null; } } public System.Collections.Generic.IReadOnlyList Values { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTag System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTag System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2054,6 +2111,7 @@ public partial class PredefinedTagCount : System.ClientModel.Primitives.IJsonMod internal PredefinedTagCount() { } public string PredefinedTagCountType { get { throw null; } } public int? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTagCount System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTagCount System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2066,6 +2124,7 @@ internal PredefinedTagValue() { } public Azure.ResourceManager.Resources.Models.PredefinedTagCount Count { get { throw null; } } public string Id { get { throw null; } } public string TagValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTagValue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.PredefinedTagValue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2098,6 +2157,7 @@ internal ProviderExtendedLocation() { } public System.Collections.Generic.IReadOnlyList ExtendedLocations { get { throw null; } } public Azure.Core.AzureLocation? Location { get { throw null; } } public string ProviderExtendedLocationType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderExtendedLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderExtendedLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2111,6 +2171,7 @@ internal ProviderPermission() { } public Azure.ResourceManager.Resources.Models.AzureRoleDefinition ManagedByRoleDefinition { get { throw null; } } public Azure.ResourceManager.Resources.Models.ProviderAuthorizationConsentState? ProviderAuthorizationConsentState { get { throw null; } } public Azure.ResourceManager.Resources.Models.AzureRoleDefinition RoleDefinition { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderPermission System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderPermission System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2121,6 +2182,7 @@ public partial class ProviderRegistrationContent : System.ClientModel.Primitives { public ProviderRegistrationContent() { } public bool? ConsentToAuthorization { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderRegistrationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderRegistrationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2140,6 +2202,7 @@ internal ProviderResourceType() { } public System.Collections.Generic.IReadOnlyDictionary Properties { get { throw null; } } public string ResourceType { get { throw null; } } public System.Collections.Generic.IReadOnlyList ZoneMappings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderResourceType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ProviderResourceType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2188,6 +2251,7 @@ public partial class ResourceGroupExportResult : System.ClientModel.Primitives.I internal ResourceGroupExportResult() { } public Azure.ResponseError Error { get { throw null; } } public System.BinaryData Template { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceGroupExportResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceGroupExportResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2201,6 +2265,7 @@ public ResourceGroupPatch() { } public string Name { get { throw null; } set { } } public string ResourceGroupProvisioningState { get { throw null; } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceGroupPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceGroupPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2212,6 +2277,7 @@ public partial class ResourceNameValidationContent : System.ClientModel.Primitiv public ResourceNameValidationContent(string name, Azure.Core.ResourceType resourceType) { } public string Name { get { throw null; } } public Azure.Core.ResourceType ResourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceNameValidationContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceNameValidationContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2224,6 +2290,7 @@ internal ResourceNameValidationResult() { } public string Name { get { throw null; } } public Azure.Core.ResourceType? ResourceType { get { throw null; } } public Azure.ResourceManager.Resources.Models.ResourceNameValidationStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceNameValidationResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceNameValidationResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2253,6 +2320,7 @@ public partial class ResourceSelector : System.ClientModel.Primitives.IJsonModel public ResourceSelector() { } public string Name { get { throw null; } set { } } public System.Collections.Generic.IList Selectors { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceSelector System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceSelector System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2265,6 +2333,7 @@ public ResourceSelectorExpression() { } public System.Collections.Generic.IList In { get { throw null; } } public Azure.ResourceManager.Resources.Models.ResourceSelectorKind? Kind { get { throw null; } set { } } public System.Collections.Generic.IList NotIn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceSelectorExpression System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceSelectorExpression System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2298,6 +2367,7 @@ public ResourcesMoveContent() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public string TargetResourceGroup { get { throw null; } set { } } public Azure.Core.ResourceIdentifier TargetResourceGroupId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourcesMoveContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourcesMoveContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2313,6 +2383,7 @@ public ResourcesSku() { } public string Name { get { throw null; } set { } } public string Size { get { throw null; } set { } } public string Tier { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourcesSku System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourcesSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2328,6 +2399,7 @@ internal ResourceTypeAlias() { } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPattern DefaultPattern { get { throw null; } } public string Name { get { throw null; } } public System.Collections.Generic.IReadOnlyList Paths { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAlias System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAlias System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2339,6 +2411,7 @@ public partial class ResourceTypeAliases : System.ClientModel.Primitives.IJsonMo internal ResourceTypeAliases() { } public System.Collections.Generic.IReadOnlyList Aliases { get { throw null; } } public string ResourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliases System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliases System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2352,6 +2425,7 @@ internal ResourceTypeAliasPath() { } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPathMetadata Metadata { get { throw null; } } public string Path { get { throw null; } } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPattern Pattern { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPath System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPath System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2381,6 +2455,7 @@ public partial class ResourceTypeAliasPathMetadata : System.ClientModel.Primitiv internal ResourceTypeAliasPathMetadata() { } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPathAttributes? Attributes { get { throw null; } } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPathTokenType? TokenType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPathMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPathMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2417,6 +2492,7 @@ internal ResourceTypeAliasPattern() { } public Azure.ResourceManager.Resources.Models.ResourceTypeAliasPatternType? PatternType { get { throw null; } } public string Phrase { get { throw null; } } public string Variable { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPattern System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ResourceTypeAliasPattern System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2457,6 +2533,7 @@ internal SubscriptionPolicies() { } public string LocationPlacementId { get { throw null; } } public string QuotaId { get { throw null; } } public Azure.ResourceManager.Resources.Models.SpendingLimit? SpendingLimit { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.SubscriptionPolicies System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.SubscriptionPolicies System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2475,6 +2552,7 @@ public partial class Tag : System.ClientModel.Primitives.IJsonModel TagValues { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.Tag System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.Tag System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2505,6 +2583,7 @@ public partial class TagResourcePatch : System.ClientModel.Primitives.IJsonModel public TagResourcePatch() { } public Azure.ResourceManager.Resources.Models.TagPatchMode? PatchMode { get { throw null; } set { } } public System.Collections.Generic.IDictionary TagValues { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TagResourcePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TagResourcePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2522,6 +2601,7 @@ public partial class TenantResourceProvider : System.ClientModel.Primitives.IJso internal TenantResourceProvider() { } public string Namespace { get { throw null; } } public System.Collections.Generic.IReadOnlyList ResourceTypes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TenantResourceProvider System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TenantResourceProvider System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2532,6 +2612,7 @@ public partial class TrackedResourceExtendedData : Azure.ResourceManager.Models. { public TrackedResourceExtendedData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Resources.Models.ExtendedLocation ExtendedLocation { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TrackedResourceExtendedData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.TrackedResourceExtendedData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2554,6 +2635,7 @@ public partial class ZoneMapping : System.ClientModel.Primitives.IJsonModel Zones { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ZoneMapping System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Resources.Models.ZoneMapping System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/resourcemanager/Azure.ResourceManager/assets.json b/sdk/resourcemanager/Azure.ResourceManager/assets.json index 2d8a648b6a67..66dcda9ed0e7 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/assets.json +++ b/sdk/resourcemanager/Azure.ResourceManager/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/resourcemanager/Azure.ResourceManager", - "Tag": "net/resourcemanager/Azure.ResourceManager_9f5b8a2748" + "Tag": "net/resourcemanager/Azure.ResourceManager_9a9a9534b3" } diff --git a/sdk/resourcemanager/Azure.ResourceManager/docs/Sample3_CreatingAVirtualNetwork.md b/sdk/resourcemanager/Azure.ResourceManager/docs/Sample3_CreatingAVirtualNetwork.md index dfba1f39393c..939573e57e15 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/docs/Sample3_CreatingAVirtualNetwork.md +++ b/sdk/resourcemanager/Azure.ResourceManager/docs/Sample3_CreatingAVirtualNetwork.md @@ -5,14 +5,13 @@ In this example, we'll create a virtual network. Since the SDK follows the resou ## Import the namespaces These are the namespaces needed for this project: -```C# +```C# Snippet:Creating_A_Virtual_Network_Namespaces using System; using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; using Azure.ResourceManager.Network; +using Azure.ResourceManager.Resources; ``` ## Create a Resource Group @@ -31,72 +30,77 @@ ResourceGroupResource resourceGroup = operation.Value; ## Create a Virtual Network Now that we have a resource group, we'll create our virtual network. To do this, we will create a `VirtualNetworkData` object for the parameters that we want our Virtual Network to have, then we will get the Virtual Network collection and from there we call `CreateOrUpdateAsync()`. -```C# +```C# Snippet:Creating_A_Virtual_Network_CreateVirtualNetwork string vnetName = "myVnetName"; -VirtualNetworkData vnetData = new VirtualNetworkData() +VirtualNetworkData virtualNetworkData = new VirtualNetworkData() { // You can specify many options for the Virtual Network in here Location = "WestUS2", - AddressSpace = new AddressSpace() - { - AddressPrefixes = { "10.0.0.0/16", } - } + AddressPrefixes = { "10.0.0.0/16", } }; -VirtualNetwork vnet = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(vnetName, vnetData); +ArmOperation armOperation = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(WaitUntil.Completed, vnetName, virtualNetworkData); +VirtualNetworkResource virtualNetworkResource = armOperation.Value; ``` ## Create a Subnet Now that we have a virtual network, we must create at least one subnet in order to add any virtual machines. Following the hierarchy in Azure, subnets belong to a virtual network, so that's where we'll get our `SubnetCollection` instance. Before that, a `SubnetData` object must be created to specify the parameters for the Subnet. -```C# -string subnetName = vnetName + "_Subnet1"; +```C# Snippet:Creating_A_Virtual_Network_CreateSubnet +string subnetName = $"{vnetName}_Subnet1"; SubnetData subnetData = new SubnetData() { Name = subnetName, AddressPrefix = "10.0.1.0/24" }; -Subnet subnet = await vnet.GetSubnets().CreateOrUpdateAsync(subnetName, subnetData); +ArmOperation armOperation = await virtualNetworkResource.GetSubnets().CreateOrUpdateAsync(WaitUntil.Completed, subnetName, subnetData); +SubnetResource subnetResource = armOperation.Value; ``` ## Another way to create a Virtual Network with a Subnet It is possible to define an create a virtual network with its subnets in a single step. This is achieved by defining the subnets in the `VirtualNetworkData` object that is given as a parameter. -```C# +```C# Snippet:Creating_A_Virtual_Network_CreateSubnetByAnotherWay string vnetName = "myVnetName"; -string subnet1Name = vnetName + "_Subnet1"; +string subnet1Name = $"{vnetName}_Subnet1"; -var vnetData = new VirtualNetworkData() +VirtualNetworkData virtualNetworkData = new VirtualNetworkData() { Location = "WestUS2", - AddressSpace = new AddressSpace() + AddressPrefixes = { "10.0.0.0/16" }, + Subnets = { - AddressPrefixes = { "10.0.0.0/16", } - }, - Subnets = { new SubnetData() { Name = subnet1Name, AddressPrefix = "10.0.0.0/24", } } + new SubnetData + { + Name = subnet1Name, + AddressPrefix = "10.0.0.0/24" + } + } }; -VirtualNetwork vnet = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(vnetName, vnetData); +ArmOperation armOperation = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(WaitUntil.Completed, vnetName, virtualNetworkData); +VirtualNetworkResource virtualNetworkResource = armOperation.Value; ``` ### Modifying the Subnets of an existing Virtual Network Using the SubnetCollection it is possible to add a subnet into the virtual network we created above. -```C# -string subnet2Name = vnetName + "_Subnet2"; +```C# Snippet:Creating_A_Virtual_Network_ModifyingSubnetsInVirtualNetwork +string subnet2Name = $"{vnetName}_Subnet2"; SubnetData subnetData = new SubnetData() { Name = subnet2Name, AddressPrefix = "10.0.1.0/24" }; -Subnet subnet = await vnet.GetSubnets().CreateOrUpdateAsync(subnet2Name, subnetData); +ArmOperation armOperation = await virtualNetworkResource.GetSubnets().CreateOrUpdateAsync(WaitUntil.Completed, subnet2Name, subnetData); +SubnetResource subnetResource = armOperation.Value; ``` You can verify that your virtual network now has 2 subnets by doing the following: -```C# -VirtualNetwork myVNet = await resourceGroup.GetVirtualNetworks().GetAsync(vnetName); -Console.WriteLine(myVNet.Data.Subnets.Count); +```C# Snippet:Creating_A_Virtual_Network_GetAllSubnetsCount +VirtualNetworkResource virtualNetworkResource = await resourceGroup.GetVirtualNetworks().GetAsync(vnetName); +Console.WriteLine(virtualNetworkResource.Data.Subnets.Count); ``` ## Next steps diff --git a/sdk/resourcemanager/Azure.ResourceManager/samples/DocSamples/Sample3_CreatingAVirtualNetwork.cs b/sdk/resourcemanager/Azure.ResourceManager/samples/DocSamples/Sample3_CreatingAVirtualNetwork.cs index c32040699f7e..367744a53840 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/samples/DocSamples/Sample3_CreatingAVirtualNetwork.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/samples/DocSamples/Sample3_CreatingAVirtualNetwork.cs @@ -1,11 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +#region Snippet:Creating_A_Virtual_Network_Namespaces + +using System; using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Network; using Azure.ResourceManager.Resources; -using Azure.ResourceManager.Resources.Models; + +#endregion Snippet:Creating_A_Virtual_Network_Namespaces + using NUnit.Framework; namespace Azure.ResourceManager.Tests.Samples @@ -17,6 +23,7 @@ public class Sample3_CreatingAVirtualNetwork public async Task CreateResourceGroupAsync() { #region Snippet:Creating_A_Virtual_Network_CreateResourceGroup + ArmClient client = new ArmClient(new DefaultAzureCredential()); SubscriptionResource subscription = await client.GetDefaultSubscriptionAsync(); ResourceGroupCollection resourceGroups = subscription.GetResourceGroups(); @@ -25,7 +32,145 @@ public async Task CreateResourceGroupAsync() ResourceGroupData resourceGroupData = new ResourceGroupData(AzureLocation.WestUS2); ArmOperation operation = await resourceGroups.CreateOrUpdateAsync(WaitUntil.Completed, resourceGroupName, resourceGroupData); ResourceGroupResource resourceGroup = operation.Value; + #endregion Snippet:Creating_A_Virtual_Network_CreateResourceGroup } + + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task CreateVirtualNetworkAsync() + { + ArmClient client = new ArmClient(new DefaultAzureCredential()); + ResourceGroupCollection resourceGroups = (await client.GetDefaultSubscriptionAsync()).GetResourceGroups(); + + string resouceGroupName = "myResourceGroup"; + ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(resouceGroupName); + + #region Snippet:Creating_A_Virtual_Network_CreateVirtualNetwork + + string vnetName = "myVnetName"; + VirtualNetworkData virtualNetworkData = new VirtualNetworkData() + { + // You can specify many options for the Virtual Network in here + Location = "WestUS2", + AddressPrefixes = { "10.0.0.0/16", } + }; + + ArmOperation armOperation = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(WaitUntil.Completed, vnetName, virtualNetworkData); + VirtualNetworkResource virtualNetworkResource = armOperation.Value; + + #endregion Snippet:Creating_A_Virtual_Network_CreateVirtualNetwork + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task CreateSubnetAsync() + { + ArmClient client = new ArmClient(new DefaultAzureCredential()); + ResourceGroupCollection resourceGroups = (await client.GetDefaultSubscriptionAsync()).GetResourceGroups(); + + string resouceGroupName = "myResourceGroup"; + ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(resouceGroupName); + + string vnetName = "myVnetName"; + VirtualNetworkResource virtualNetworkResource = await resourceGroup.GetVirtualNetworks().GetAsync(vnetName); + + #region Snippet:Creating_A_Virtual_Network_CreateSubnet + + string subnetName = $"{vnetName}_Subnet1"; + SubnetData subnetData = new SubnetData() + { + Name = subnetName, + AddressPrefix = "10.0.1.0/24" + }; + + ArmOperation armOperation = await virtualNetworkResource.GetSubnets().CreateOrUpdateAsync(WaitUntil.Completed, subnetName, subnetData); + SubnetResource subnetResource = armOperation.Value; + + #endregion Snippet:Creating_A_Virtual_Network_CreateSubnet + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task CreateSubnetByAnotherWayAsync() + { + ArmClient client = new ArmClient(new DefaultAzureCredential()); + ResourceGroupCollection resourceGroups = (await client.GetDefaultSubscriptionAsync()).GetResourceGroups(); + + string resouceGroupName = "myResourceGroup"; + ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(resouceGroupName); + + #region Snippet:Creating_A_Virtual_Network_CreateSubnetByAnotherWay + + string vnetName = "myVnetName"; + string subnet1Name = $"{vnetName}_Subnet1"; + + VirtualNetworkData virtualNetworkData = new VirtualNetworkData() + { + Location = "WestUS2", + AddressPrefixes = { "10.0.0.0/16" }, + Subnets = + { + new SubnetData + { + Name = subnet1Name, + AddressPrefix = "10.0.0.0/24" + } + } + }; + + ArmOperation armOperation = await resourceGroup.GetVirtualNetworks().CreateOrUpdateAsync(WaitUntil.Completed, vnetName, virtualNetworkData); + VirtualNetworkResource virtualNetworkResource = armOperation.Value; + + #endregion Snippet:Creating_A_Virtual_Network_CreateSubnetByAnotherWay + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task ModifyingSubnetsInVirtualNetworkAsync() + { + ArmClient client = new ArmClient(new DefaultAzureCredential()); + ResourceGroupCollection resourceGroups = (await client.GetDefaultSubscriptionAsync()).GetResourceGroups(); + + string resouceGroupName = "myResourceGroup"; + ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(resouceGroupName); + + string vnetName = "myVnetName"; + VirtualNetworkResource virtualNetworkResource = await resourceGroup.GetVirtualNetworks().GetAsync(vnetName); + + #region Snippet:Creating_A_Virtual_Network_ModifyingSubnetsInVirtualNetwork + + string subnet2Name = $"{vnetName}_Subnet2"; + SubnetData subnetData = new SubnetData() + { + Name = subnet2Name, + AddressPrefix = "10.0.1.0/24" + }; + + ArmOperation armOperation = await virtualNetworkResource.GetSubnets().CreateOrUpdateAsync(WaitUntil.Completed, subnet2Name, subnetData); + SubnetResource subnetResource = armOperation.Value; + + #endregion Snippet:Creating_A_Virtual_Network_ModifyingSubnetsInVirtualNetwork + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public async Task GetAllSubnetsCountAsync() + { + ArmClient client = new ArmClient(new DefaultAzureCredential()); + ResourceGroupCollection resourceGroups = (await client.GetDefaultSubscriptionAsync()).GetResourceGroups(); + + string resouceGroupName = "myResourceGroup"; + ResourceGroupResource resourceGroup = await resourceGroups.GetAsync(resouceGroupName); + + string vnetName = "myVnetName"; + + #region Snippet:Creating_A_Virtual_Network_GetAllSubnetsCount + + VirtualNetworkResource virtualNetworkResource = await resourceGroup.GetVirtualNetworks().GetAsync(vnetName); + Console.WriteLine(virtualNetworkResource.Data.Subnets.Count); + + #endregion Snippet:Creating_A_Virtual_Network_GetAllSubnetsCount + } } } diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj b/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj index 9caf25501765..9b8c618d8293 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj @@ -1,9 +1,9 @@ - 1.13.0-beta.1 + 1.14.0-beta.1 - 1.12.0 + 1.13.0 Azure.ResourceManager Microsoft Azure Resource Manager client SDK for Azure resources. azure;management;resource diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmPlan.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmPlan.Serialization.cs index dc584dcc860c..217569f811f2 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmPlan.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmPlan.Serialization.cs @@ -21,6 +21,15 @@ public partial class ArmPlan : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + private void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o throw new FormatException($"The model {nameof(ArmPlan)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("publisher"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions o writer.WritePropertyName("version"u8); writer.WriteStringValue(Version); } - writer.WriteEndObject(); } ArmPlan IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmSku.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmSku.Serialization.cs index f4afe703f634..a35b5bbfc5ed 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmSku.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ArmSku.Serialization.cs @@ -21,6 +21,15 @@ public partial class ArmSku : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + private void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions op throw new FormatException($"The model {nameof(ArmSku)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); if (Optional.IsDefined(Tier)) @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions op writer.WritePropertyName("capacity"u8); writer.WriteNumberValue(Capacity.Value); } - writer.WriteEndObject(); } ArmSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/EncryptionProperties.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/EncryptionProperties.Serialization.cs index a46d2ea2f45e..3c32233283be 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/EncryptionProperties.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/EncryptionProperties.Serialization.cs @@ -21,6 +21,15 @@ public partial class EncryptionProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(EncryptionProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -39,7 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("keyVaultProperties"u8); writer.WriteObjectValue(KeyVaultProperties, options); } - writer.WriteEndObject(); } EncryptionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/KeyVaultProperties.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/KeyVaultProperties.Serialization.cs index f1067c626868..e52fc8d5eaab 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/KeyVaultProperties.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/KeyVaultProperties.Serialization.cs @@ -21,6 +21,15 @@ public partial class KeyVaultProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(KeyIdentifier)) { writer.WritePropertyName("keyIdentifier"u8); @@ -39,7 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("identity"u8); writer.WriteStringValue(Identity); } - writer.WriteEndObject(); } KeyVaultProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/OperationStatusResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/OperationStatusResult.Serialization.cs index 60921fdb4260..5d2e48074192 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/OperationStatusResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/OperationStatusResult.Serialization.cs @@ -22,6 +22,15 @@ public partial class OperationStatusResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,7 +38,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(OperationStatusResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -75,7 +83,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WritePropertyName("error"u8); JsonSerializer.Serialize(writer, Error); } - writer.WriteEndObject(); } OperationStatusResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.Serialization.cs new file mode 100644 index 000000000000..1b659410bc2e --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/ResourceData.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Models +{ + public partial class ResourceData + { + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + writer.WriteObjectValue(SystemData, options); + } + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemAssignedServiceIdentity.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemAssignedServiceIdentity.Serialization.cs index f0c42063ad7b..6701d8c5c931 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemAssignedServiceIdentity.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemAssignedServiceIdentity.Serialization.cs @@ -21,6 +21,15 @@ public partial class SystemAssignedServiceIdentity : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(SystemAssignedServiceIdentity)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(PrincipalId)) { writer.WritePropertyName("principalId"u8); @@ -41,7 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WritePropertyName("type"u8); writer.WriteStringValue(SystemAssignedServiceIdentityType.ToString()); - writer.WriteEndObject(); } SystemAssignedServiceIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemData.Serialization.cs index fae51ca8d1b5..35cc14393ece 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/SystemData.Serialization.cs @@ -21,6 +21,15 @@ public partial class SystemData : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(SystemData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(CreatedBy)) { writer.WritePropertyName("createdBy"u8); @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption writer.WritePropertyName("lastModifiedAt"u8); writer.WriteStringValue(LastModifiedOn.Value, "O"); } - writer.WriteEndObject(); } SystemData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.Serialization.cs new file mode 100644 index 000000000000..a6af3ca008b5 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/TrackedResourceData.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.Models +{ + public partial class TrackedResourceData + { + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/UserAssignedIdentity.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/UserAssignedIdentity.Serialization.cs index 6b853c1179fd..a824a159f2fa 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/UserAssignedIdentity.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/Models/UserAssignedIdentity.Serialization.cs @@ -21,6 +21,15 @@ public partial class UserAssignedIdentity : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(UserAssignedIdentity)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(PrincipalId)) { writer.WritePropertyName("principalId"u8); @@ -39,7 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("clientId"u8); writer.WriteStringValue(ClientId.Value); } - writer.WriteEndObject(); } UserAssignedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupData.Serialization.cs index 5129769060e3..b821e7137ac1 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupData.Serialization.cs @@ -22,6 +22,15 @@ public partial class ManagementGroupData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ManagementGroupData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(TenantId)) @@ -85,22 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri } } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ManagementGroupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupSubscriptionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupSubscriptionData.Serialization.cs index 1e7ebde1d067..e040a8b158e0 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupSubscriptionData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupSubscriptionData.Serialization.cs @@ -21,6 +21,15 @@ public partial class ManagementGroupSubscriptionData : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,27 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(ManagementGroupSubscriptionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Tenant)) @@ -79,22 +68,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteStringValue(State); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ManagementGroupSubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/CreateManagementGroupDetails.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/CreateManagementGroupDetails.Serialization.cs index b6e34c1da5b9..89f53c7d85fa 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/CreateManagementGroupDetails.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/CreateManagementGroupDetails.Serialization.cs @@ -18,6 +18,15 @@ public partial class CreateManagementGroupDetails : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(CreateManagementGroupDetails)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } CreateManagementGroupDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantData.Serialization.cs index 4c20ad50f41b..bb5557a1800f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantData.Serialization.cs @@ -20,6 +20,15 @@ public partial class DescendantData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,27 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(DescendantData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(DisplayName)) @@ -75,22 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp } } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DescendantData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantListResult.Serialization.cs index 50ddfc9368f6..92056dd7f876 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class DescendantListResult : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(DescendantListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } DescendantListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantParentGroupInfo.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantParentGroupInfo.Serialization.cs index 5492efa99877..353586aa8177 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantParentGroupInfo.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/DescendantParentGroupInfo.Serialization.cs @@ -19,6 +19,15 @@ internal partial class DescendantParentGroupInfo : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(DescendantParentGroupInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } DescendantParentGroupInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityData.Serialization.cs index 807aac22bddf..a61f39b87dae 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityData.Serialization.cs @@ -22,6 +22,15 @@ public partial class EntityData : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(EntityData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(TenantId)) @@ -176,22 +165,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption } } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } EntityData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityListResult.Serialization.cs index d80cac8b38cd..7c15a6e99b67 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/EntityListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class EntityListResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(EntityListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -63,7 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } EntityListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ListSubscriptionUnderManagementGroup.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ListSubscriptionUnderManagementGroup.Serialization.cs index 2106e495e1b6..0fbd0a1f54de 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ListSubscriptionUnderManagementGroup.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ListSubscriptionUnderManagementGroup.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ListSubscriptionUnderManagementGroup : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(ListSubscriptionUnderManagementGroup)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } ListSubscriptionUnderManagementGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildInfo.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildInfo.Serialization.cs index 70f9f04a00bf..9d7fc918de90 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildInfo.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildInfo.Serialization.cs @@ -20,6 +20,15 @@ public partial class ManagementGroupChildInfo : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ManagementGroupChildInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ChildType)) { writer.WritePropertyName("type"u8); @@ -73,7 +81,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ManagementGroupChildInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildOptions.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildOptions.Serialization.cs index 17439f340c2f..f75a5a0e332c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildOptions.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupChildOptions.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManagementGroupChildOptions : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ManagementGroupChildOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ChildType)) { writer.WritePropertyName("type"u8); @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ManagementGroupChildOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupCreateOrUpdateContent.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupCreateOrUpdateContent.Serialization.cs index c857140ad780..37b1d4e0765e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupCreateOrUpdateContent.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupCreateOrUpdateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManagementGroupCreateOrUpdateContent : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(ManagementGroupCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -98,7 +106,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } ManagementGroupCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupInfo.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupInfo.Serialization.cs index f71888cf550f..089e90d98f8b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupInfo.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupInfo.Serialization.cs @@ -20,6 +20,15 @@ public partial class ManagementGroupInfo : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ManagementGroupInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Version)) { writer.WritePropertyName("version"u8); @@ -114,7 +122,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } ManagementGroupInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs index 03d1eed76264..1b1dab3c918e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ManagementGroupListResult : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ManagementGroupListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ManagementGroupListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityContent.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityContent.Serialization.cs index 253bdf210089..baca7787b53b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityContent.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManagementGroupNameAvailabilityContent : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(ManagementGroupNameAvailabilityContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter wri #endif } } - writer.WriteEndObject(); } ManagementGroupNameAvailabilityContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityResult.Serialization.cs index bff8c9c215cc..3f7d2b9ec571 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupNameAvailabilityResult.Serialization.cs @@ -19,6 +19,15 @@ public partial class ManagementGroupNameAvailabilityResult : IUtf8JsonSerializab void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(ManagementGroupNameAvailabilityResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(NameAvailable)) { writer.WritePropertyName("nameAvailable"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writ #endif } } - writer.WriteEndObject(); } ManagementGroupNameAvailabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupParentCreateOptions.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupParentCreateOptions.Serialization.cs index 3edcf60c92f1..654c53eaa817 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupParentCreateOptions.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupParentCreateOptions.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManagementGroupParentCreateOptions : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ManagementGroupParentCreateOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } ManagementGroupParentCreateOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPatch.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPatch.Serialization.cs index 1d51cde61cdf..85407dd2ecd5 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPatch.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class ManagementGroupPatch : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ManagementGroupPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(DisplayName)) { if (DisplayName != null) @@ -65,7 +73,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ManagementGroupPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPathElement.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPathElement.Serialization.cs index 5fadd8d286e7..ae6d04246990 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPathElement.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupPathElement.Serialization.cs @@ -19,6 +19,15 @@ public partial class ManagementGroupPathElement : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ManagementGroupPathElement)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ManagementGroupPathElement IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ParentManagementGroupInfo.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ParentManagementGroupInfo.Serialization.cs index aa270fbd667b..c3010695ea90 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ParentManagementGroupInfo.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ParentManagementGroupInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ParentManagementGroupInfo : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ParentManagementGroupInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ParentManagementGroupInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/DataPolicyManifestData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/DataPolicyManifestData.Serialization.cs index 266792ba98e8..aa7e1ba7216a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/DataPolicyManifestData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/DataPolicyManifestData.Serialization.cs @@ -22,6 +22,15 @@ public partial class DataPolicyManifestData : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(DataPolicyManifestData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsCollectionDefined(Namespaces)) @@ -126,22 +115,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader } writer.WriteEndObject(); writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DataPolicyManifestData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/FeatureData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/FeatureData.Serialization.cs index e0039199f0fe..c87759c4767c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/FeatureData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/FeatureData.Serialization.cs @@ -21,6 +21,15 @@ public partial class FeatureData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,48 +37,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio throw new FormatException($"The model {nameof(FeatureData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } FeatureData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/GenericResourceData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/GenericResourceData.Serialization.cs index 3014ba60e6b9..ef5379cc971d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/GenericResourceData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/GenericResourceData.Serialization.cs @@ -22,6 +22,15 @@ public partial class GenericResourceData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,7 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(GenericResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Plan)) { writer.WritePropertyName("plan"u8); @@ -82,60 +91,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState); } - if (Optional.IsDefined(ExtendedLocation)) - { - writer.WritePropertyName("extendedLocation"u8); - JsonSerializer.Serialize(writer, ExtendedLocation); - } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } GenericResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ManagementLockData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ManagementLockData.Serialization.cs index 3c43bb5fafd9..eb06348691e2 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ManagementLockData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ManagementLockData.Serialization.cs @@ -22,6 +22,15 @@ public partial class ManagementLockData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ManagementLockData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("level"u8); @@ -70,22 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteEndArray(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ManagementLockData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ApiProfile.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ApiProfile.Serialization.cs index bbdbaaa57e61..c600827fc43a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ApiProfile.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ApiProfile.Serialization.cs @@ -19,6 +19,15 @@ public partial class ApiProfile : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(ApiProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProfileVersion)) { writer.WritePropertyName("profileVersion"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption #endif } } - writer.WriteEndObject(); } ApiProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameter.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameter.Serialization.cs index 42242a9fe1c2..2bc1b07b2dee 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameter.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameter.Serialization.cs @@ -20,6 +20,15 @@ public partial class ArmPolicyParameter : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ArmPolicyParameter)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ParameterType)) { writer.WritePropertyName("type"u8); @@ -87,7 +95,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } ArmPolicyParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameterValue.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameterValue.Serialization.cs index 990c06226a67..33ff180a2e49 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameterValue.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ArmPolicyParameterValue.Serialization.cs @@ -19,6 +19,15 @@ public partial class ArmPolicyParameterValue : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ArmPolicyParameterValue)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Value)) { writer.WritePropertyName("value"u8); @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ArmPolicyParameterValue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AvailabilityZoneMappings.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AvailabilityZoneMappings.Serialization.cs index 09809fa8e607..9548c514dd28 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AvailabilityZoneMappings.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AvailabilityZoneMappings.Serialization.cs @@ -19,6 +19,15 @@ public partial class AvailabilityZoneMappings : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(AvailabilityZoneMappings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(LogicalZone)) { writer.WritePropertyName("logicalZone"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } AvailabilityZoneMappings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AzureRoleDefinition.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AzureRoleDefinition.Serialization.cs index cc877d7a5642..6599e8a99be3 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AzureRoleDefinition.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/AzureRoleDefinition.Serialization.cs @@ -20,6 +20,15 @@ public partial class AzureRoleDefinition : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(AzureRoleDefinition)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -78,7 +86,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } AzureRoleDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataManifestCustomResourceFunctionDefinition.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataManifestCustomResourceFunctionDefinition.Serialization.cs index 378c6855e015..12a1c62f63f8 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataManifestCustomResourceFunctionDefinition.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataManifestCustomResourceFunctionDefinition.Serialization.cs @@ -20,6 +20,15 @@ public partial class DataManifestCustomResourceFunctionDefinition : IUtf8JsonSer void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWrit throw new FormatException($"The model {nameof(DataManifestCustomResourceFunctionDefinition)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWrit #endif } } - writer.WriteEndObject(); } DataManifestCustomResourceFunctionDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestEffect.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestEffect.Serialization.cs index dbfd3b5df3db..22d002a8c799 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestEffect.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestEffect.Serialization.cs @@ -19,6 +19,15 @@ public partial class DataPolicyManifestEffect : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(DataPolicyManifestEffect)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } DataPolicyManifestEffect IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestListResult.Serialization.cs index 85b2b17f218e..b214c45c7532 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/DataPolicyManifestListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class DataPolicyManifestListResult : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(DataPolicyManifestListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } DataPolicyManifestListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExportTemplate.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExportTemplate.Serialization.cs index e91c5e0983de..69d14b4d81b8 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExportTemplate.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExportTemplate.Serialization.cs @@ -18,6 +18,15 @@ public partial class ExportTemplate : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(ExportTemplate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Resources)) { writer.WritePropertyName("resources"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } ExportTemplate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExtendedLocation.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExtendedLocation.Serialization.cs index 14075d978d7f..572afd4d6d69 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExtendedLocation.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ExtendedLocation.Serialization.cs @@ -21,6 +21,15 @@ public partial class ExtendedLocation : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(ExtendedLocation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ExtendedLocationType)) { writer.WritePropertyName("type"u8); @@ -39,7 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - writer.WriteEndObject(); } ExtendedLocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureOperationsListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureOperationsListResult.Serialization.cs index f49d662b4027..ec5df203f0bf 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureOperationsListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureOperationsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class FeatureOperationsListResult : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(FeatureOperationsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } FeatureOperationsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureProperties.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureProperties.Serialization.cs index fad3a49911cf..01814c34bbe0 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureProperties.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/FeatureProperties.Serialization.cs @@ -19,6 +19,15 @@ internal partial class FeatureProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(FeatureProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(State)) { writer.WritePropertyName("state"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } FeatureProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationExpanded.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationExpanded.Serialization.cs index 423e05df8296..d257299b3e63 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationExpanded.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationExpanded.Serialization.cs @@ -20,6 +20,15 @@ public partial class LocationExpanded : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(LocationExpanded)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -88,7 +96,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } LocationExpanded IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationListResult.Serialization.cs index 1be0960de809..8ac53b8a5030 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class LocationListResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(LocationListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } LocationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationMetadata.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationMetadata.Serialization.cs index aaf304ef5f97..439a6cf2aef0 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationMetadata.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/LocationMetadata.Serialization.cs @@ -20,6 +20,15 @@ public partial class LocationMetadata : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(LocationMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(RegionType)) { writer.WritePropertyName("regionType"u8); @@ -93,7 +101,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } LocationMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagedByTenant.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagedByTenant.Serialization.cs index 2493ad9c7abf..f837a94dceb2 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagedByTenant.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagedByTenant.Serialization.cs @@ -19,6 +19,15 @@ public partial class ManagedByTenant : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(ManagedByTenant)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } ManagedByTenant IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockListResult.Serialization.cs index 6c3ede533dce..5e9a7022143c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ManagementLockListResult : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ManagementLockListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ManagementLockListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockOwner.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockOwner.Serialization.cs index 2da4ddcb740f..0f36e6805765 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockOwner.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ManagementLockOwner.Serialization.cs @@ -19,6 +19,15 @@ public partial class ManagementLockOwner : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ManagementLockOwner)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ApplicationId)) { writer.WritePropertyName("applicationId"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } ManagementLockOwner IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/NonComplianceMessage.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/NonComplianceMessage.Serialization.cs index 471857158db0..6c911878a73b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/NonComplianceMessage.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/NonComplianceMessage.Serialization.cs @@ -19,6 +19,15 @@ public partial class NonComplianceMessage : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(NonComplianceMessage)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("message"u8); writer.WriteStringValue(Message); if (Optional.IsDefined(PolicyDefinitionReferenceId)) @@ -49,7 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } NonComplianceMessage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PairedRegion.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PairedRegion.Serialization.cs index 54fdae29cac4..60229b864f69 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PairedRegion.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PairedRegion.Serialization.cs @@ -19,6 +19,15 @@ public partial class PairedRegion : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti throw new FormatException($"The model {nameof(PairedRegion)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti #endif } } - writer.WriteEndObject(); } PairedRegion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ParameterDefinitionsValueMetadata.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ParameterDefinitionsValueMetadata.Serialization.cs index 1d5766740675..d984d9aa717d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ParameterDefinitionsValueMetadata.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ParameterDefinitionsValueMetadata.Serialization.cs @@ -19,6 +19,15 @@ public partial class ParameterDefinitionsValueMetadata : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ParameterDefinitionsValueMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(DisplayName)) { writer.WritePropertyName("displayName"u8); @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, } #endif } - writer.WriteEndObject(); } ParameterDefinitionsValueMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Permission.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Permission.Serialization.cs index ff0c633a4e5e..7afb0b328f52 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Permission.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Permission.Serialization.cs @@ -20,6 +20,15 @@ public partial class Permission : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(Permission)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(AllowedActions)) { writer.WritePropertyName("actions"u8); @@ -83,7 +91,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption #endif } } - writer.WriteEndObject(); } Permission IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentListResult.Serialization.cs index 026ffd906055..6a5c7acd560d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PolicyAssignmentListResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(PolicyAssignmentListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } PolicyAssignmentListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentPatch.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentPatch.Serialization.cs index c83f43a5d00a..5efdac1bffa5 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentPatch.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyAssignmentPatch.Serialization.cs @@ -19,6 +19,15 @@ public partial class PolicyAssignmentPatch : IUtf8JsonSerializable, IJsonModel

((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(PolicyAssignmentPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); @@ -75,7 +83,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } PolicyAssignmentPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionGroup.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionGroup.Serialization.cs index f145fa561b38..4b3b6c8e1d51 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionGroup.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionGroup.Serialization.cs @@ -19,6 +19,15 @@ public partial class PolicyDefinitionGroup : IUtf8JsonSerializable, IJsonModel

((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(PolicyDefinitionGroup)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); if (Optional.IsDefined(DisplayName)) @@ -64,7 +72,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } PolicyDefinitionGroup IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionListResult.Serialization.cs index 269dff46a32f..9d7db8d81980 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PolicyDefinitionListResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(PolicyDefinitionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } PolicyDefinitionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionReference.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionReference.Serialization.cs index 372b5609de24..4f4def3f3d7d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionReference.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyDefinitionReference.Serialization.cs @@ -20,6 +20,15 @@ public partial class PolicyDefinitionReference : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(PolicyDefinitionReference)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("policyDefinitionId"u8); writer.WriteStringValue(PolicyDefinitionId); if (Optional.IsCollectionDefined(Parameters)) @@ -71,7 +79,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } PolicyDefinitionReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyOverride.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyOverride.Serialization.cs index 5d464bffec9f..6eef80f3372b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyOverride.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicyOverride.Serialization.cs @@ -20,6 +20,15 @@ public partial class PolicyOverride : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(PolicyOverride)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Kind)) { writer.WritePropertyName("kind"u8); @@ -63,7 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } PolicyOverride IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicySetDefinitionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicySetDefinitionListResult.Serialization.cs index 4093c6a5d9a0..13a11dccf141 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicySetDefinitionListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PolicySetDefinitionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PolicySetDefinitionListResult : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(PolicySetDefinitionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } PolicySetDefinitionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTag.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTag.Serialization.cs index 22368e5eeea2..6205ab088dea 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTag.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTag.Serialization.cs @@ -20,6 +20,15 @@ public partial class PredefinedTag : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt throw new FormatException($"The model {nameof(PredefinedTag)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt #endif } } - writer.WriteEndObject(); } PredefinedTag IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagCount.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagCount.Serialization.cs index 71b47001713f..98e7ccc1ed4b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagCount.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagCount.Serialization.cs @@ -19,6 +19,15 @@ public partial class PredefinedTagCount : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(PredefinedTagCount)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(PredefinedTagCountType)) { writer.WritePropertyName("type"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } PredefinedTagCount IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagValue.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagValue.Serialization.cs index 9e82f3ad0c4a..516e9a1ef0c8 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagValue.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagValue.Serialization.cs @@ -19,6 +19,15 @@ public partial class PredefinedTagValue : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(PredefinedTagValue)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } PredefinedTagValue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagsListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagsListResult.Serialization.cs index 2a5682cf99a9..59964ee8efcb 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagsListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/PredefinedTagsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PredefinedTagsListResult : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(PredefinedTagsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } PredefinedTagsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderConsentDefinition.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderConsentDefinition.Serialization.cs index 6e5f9de82dcc..de2ed81bac6e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderConsentDefinition.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderConsentDefinition.Serialization.cs @@ -18,6 +18,15 @@ internal partial class ProviderConsentDefinition : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ProviderConsentDefinition)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ConsentToAuthorization)) { writer.WritePropertyName("consentToAuthorization"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ProviderConsentDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderExtendedLocation.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderExtendedLocation.Serialization.cs index 570887448d62..d66f3e57f06e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderExtendedLocation.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderExtendedLocation.Serialization.cs @@ -20,6 +20,15 @@ public partial class ProviderExtendedLocation : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ProviderExtendedLocation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); @@ -63,7 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ProviderExtendedLocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermission.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermission.Serialization.cs index 5c537c9d9a53..7212bb4b7dfb 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermission.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermission.Serialization.cs @@ -19,6 +19,15 @@ public partial class ProviderPermission : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ProviderPermission)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ApplicationId)) { writer.WritePropertyName("applicationId"u8); @@ -62,7 +70,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } ProviderPermission IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermissionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermissionListResult.Serialization.cs index d8fb647e5d9f..0a0d6be0dc29 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermissionListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderPermissionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ProviderPermissionListResult : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ProviderPermissionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ProviderPermissionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderRegistrationContent.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderRegistrationContent.Serialization.cs index a77bae917cb7..63848539a300 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderRegistrationContent.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderRegistrationContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ProviderRegistrationContent : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ProviderRegistrationContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ThirdPartyProviderConsent)) { writer.WritePropertyName("thirdPartyProviderConsent"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ProviderRegistrationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceType.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceType.Serialization.cs index 6f21cb1c7aeb..587103f1d443 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceType.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceType.Serialization.cs @@ -20,6 +20,15 @@ public partial class ProviderResourceType : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ProviderResourceType)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ResourceType)) { writer.WritePropertyName("resourceType"u8); @@ -129,7 +137,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ProviderResourceType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceTypeListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceTypeListResult.Serialization.cs index 64eeb60a4b17..91da7e422765 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceTypeListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ProviderResourceTypeListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ProviderResourceTypeListResult : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ProviderResourceTypeListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ProviderResourceTypeListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupExportResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupExportResult.Serialization.cs index 2a3ddd692bd4..5ff8191bd24f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupExportResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupExportResult.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourceGroupExportResult : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ResourceGroupExportResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Template)) { writer.WritePropertyName("template"u8); @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ResourceGroupExportResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupListResult.Serialization.cs index e47f543391f0..1e5edf92f013 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ResourceGroupListResult : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ResourceGroupListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ResourceGroupListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupPatch.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupPatch.Serialization.cs index bb7f65ae6202..a8e19e6a3d00 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupPatch.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupPatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceGroupPatch : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ResourceGroupPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -67,7 +75,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } ResourceGroupPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupProperties.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupProperties.Serialization.cs index 526b2c062468..9cccfe5f38e2 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupProperties.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceGroupProperties.Serialization.cs @@ -19,6 +19,15 @@ internal partial class ResourceGroupProperties : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(ResourceGroupProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } ResourceGroupProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceListResult.Serialization.cs index 813066388772..d68ec7411af6 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ResourceListResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } ResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationContent.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationContent.Serialization.cs index e44d153d46bd..58476d312527 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationContent.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourceNameValidationContent : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(ResourceNameValidationContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); writer.WritePropertyName("type"u8); @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } ResourceNameValidationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationResult.Serialization.cs index 9e0ad373f001..809ae5172ea5 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceNameValidationResult.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourceNameValidationResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ResourceNameValidationResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ResourceNameValidationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceProviderListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceProviderListResult.Serialization.cs index 051a237125d8..8fae636ae0b6 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceProviderListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceProviderListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ResourceProviderListResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ResourceProviderListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ResourceProviderListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelector.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelector.Serialization.cs index 33fe62011e9e..e6fe974926c9 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelector.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelector.Serialization.cs @@ -20,6 +20,15 @@ public partial class ResourceSelector : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(ResourceSelector)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } ResourceSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelectorExpression.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelectorExpression.Serialization.cs index 8a1f357d8fa2..22fbba122b49 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelectorExpression.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceSelectorExpression.Serialization.cs @@ -20,6 +20,15 @@ public partial class ResourceSelectorExpression : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ResourceSelectorExpression)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Kind)) { writer.WritePropertyName("kind"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } ResourceSelectorExpression IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAlias.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAlias.Serialization.cs index 568b8e4b201a..571372dcdac6 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAlias.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAlias.Serialization.cs @@ -20,6 +20,15 @@ public partial class ResourceTypeAlias : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(ResourceTypeAlias)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -78,7 +86,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } ResourceTypeAlias IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPath.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPath.Serialization.cs index cd879b670489..aff7e430f43e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPath.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPath.Serialization.cs @@ -20,6 +20,15 @@ public partial class ResourceTypeAliasPath : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(ResourceTypeAliasPath)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Path)) { writer.WritePropertyName("path"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } ResourceTypeAliasPath IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPathMetadata.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPathMetadata.Serialization.cs index 6ffdc6bd20bb..701f22e59645 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPathMetadata.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPathMetadata.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourceTypeAliasPathMetadata : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(ResourceTypeAliasPathMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(TokenType)) { writer.WritePropertyName("type"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } ResourceTypeAliasPathMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPattern.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPattern.Serialization.cs index c329c891d237..ba9f9b86ab88 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPattern.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliasPattern.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourceTypeAliasPattern : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ResourceTypeAliasPattern)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Phrase)) { writer.WritePropertyName("phrase"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ResourceTypeAliasPattern IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliases.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliases.Serialization.cs index ff3b568b5a03..68449ede2304 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliases.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourceTypeAliases.Serialization.cs @@ -20,6 +20,15 @@ public partial class ResourceTypeAliases : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ResourceTypeAliases)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ResourceType)) { writer.WritePropertyName("resourceType"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } ResourceTypeAliases IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesMoveContent.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesMoveContent.Serialization.cs index 4ee53eed7f34..af0cb969981d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesMoveContent.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesMoveContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class ResourcesMoveContent : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ResourcesMoveContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Resources)) { writer.WritePropertyName("resources"u8); @@ -56,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ResourcesMoveContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesSku.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesSku.Serialization.cs index b9f10cfa1d67..660e8e54ca1d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesSku.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ResourcesSku.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourcesSku : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti throw new FormatException($"The model {nameof(ResourcesSku)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -72,7 +80,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti #endif } } - writer.WriteEndObject(); } ResourcesSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionListResult.Serialization.cs index e90c336119e8..d3c9eab490d6 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class SubscriptionListResult : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(SubscriptionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -55,7 +63,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } SubscriptionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionPolicies.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionPolicies.Serialization.cs index d197adfc4480..4c76f9420d16 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionPolicies.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/SubscriptionPolicies.Serialization.cs @@ -19,6 +19,15 @@ public partial class SubscriptionPolicies : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(SubscriptionPolicies)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(LocationPlacementId)) { writer.WritePropertyName("locationPlacementId"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } SubscriptionPolicies IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Tag.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Tag.Serialization.cs index fa37f1950ae0..a59c794f9c4a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Tag.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/Tag.Serialization.cs @@ -20,6 +20,15 @@ public partial class Tag : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions optio throw new FormatException($"The model {nameof(Tag)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(TagValues)) { writer.WritePropertyName("tags"u8); @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions optio #endif } } - writer.WriteEndObject(); } Tag IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TagResourcePatch.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TagResourcePatch.Serialization.cs index 231978c1cf8a..6b38b23fe44f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TagResourcePatch.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TagResourcePatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class TagResourcePatch : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(TagResourcePatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(PatchMode)) { writer.WritePropertyName("operation"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } TagResourcePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantListResult.Serialization.cs index 4fb72a8f9201..b9c54190beef 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class TenantListResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(TenantListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -55,7 +63,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } TenantListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProvider.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProvider.Serialization.cs index ff2e393a3e13..f83eac99ea15 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProvider.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProvider.Serialization.cs @@ -20,6 +20,15 @@ public partial class TenantResourceProvider : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(TenantResourceProvider)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Namespace)) { writer.WritePropertyName("namespace"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } TenantResourceProvider IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProviderListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProviderListResult.Serialization.cs index 0562f86cd566..c025e50416f3 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProviderListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TenantResourceProviderListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class TenantResourceProviderListResult : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(TenantResourceProviderListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } TenantResourceProviderListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TrackedResourceExtendedData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TrackedResourceExtendedData.Serialization.cs index de3348ac496f..d5bb046198b5 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TrackedResourceExtendedData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/TrackedResourceExtendedData.Serialization.cs @@ -21,6 +21,15 @@ public partial class TrackedResourceExtendedData : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,61 +37,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(TrackedResourceExtendedData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(ExtendedLocation)) { writer.WritePropertyName("extendedLocation"u8); JsonSerializer.Serialize(writer, ExtendedLocation); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } TrackedResourceExtendedData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ZoneMapping.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ZoneMapping.Serialization.cs index 1433a299b116..c45254f78852 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ZoneMapping.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/ZoneMapping.Serialization.cs @@ -20,6 +20,15 @@ public partial class ZoneMapping : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio throw new FormatException($"The model {nameof(ZoneMapping)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio #endif } } - writer.WriteEndObject(); } ZoneMapping IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyAssignmentData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyAssignmentData.Serialization.cs index df267a4d4977..7e9808995fe8 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyAssignmentData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyAssignmentData.Serialization.cs @@ -22,6 +22,15 @@ public partial class PolicyAssignmentData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,7 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(PolicyAssignmentData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); @@ -40,26 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("identity"u8); JsonSerializer.Serialize(writer, ManagedIdentity); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(DisplayName)) @@ -151,22 +140,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndArray(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PolicyAssignmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyDefinitionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyDefinitionData.Serialization.cs index 3836c542f8cc..e4935a90368b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyDefinitionData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicyDefinitionData.Serialization.cs @@ -22,6 +22,15 @@ public partial class PolicyDefinitionData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(PolicyDefinitionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(PolicyType)) @@ -108,22 +97,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WriteEndObject(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PolicyDefinitionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicySetDefinitionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicySetDefinitionData.Serialization.cs index d7ce790cb2d4..13f1c68035bf 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicySetDefinitionData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/PolicySetDefinitionData.Serialization.cs @@ -22,6 +22,15 @@ public partial class PolicySetDefinitionData : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(PolicySetDefinitionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(PolicyType)) @@ -111,22 +100,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteEndArray(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PolicySetDefinitionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceGroupData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceGroupData.Serialization.cs index 5470a8e35738..30db19d72c00 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceGroupData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceGroupData.Serialization.cs @@ -22,6 +22,15 @@ public partial class ResourceGroupData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,7 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(ResourceGroupData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); @@ -40,55 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WritePropertyName("managedBy"u8); writer.WriteStringValue(ManagedBy); } - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ResourceGroupData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderData.Serialization.cs index efa3d7ecc575..09a197ac5b38 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceProviderData.Serialization.cs @@ -21,6 +21,15 @@ public partial class ResourceProviderData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(ResourceProviderData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -79,7 +87,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } ResourceProviderData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionData.Serialization.cs index 8e0b296a7177..7f1b670bbf7c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionData.Serialization.cs @@ -21,6 +21,15 @@ public partial class SubscriptionData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(SubscriptionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -100,7 +108,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } SubscriptionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TagResourceData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TagResourceData.Serialization.cs index c05bd1e2d23f..5d759587ddc1 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TagResourceData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TagResourceData.Serialization.cs @@ -21,6 +21,15 @@ public partial class TagResourceData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,45 +37,9 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(TagResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } TagResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantData.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantData.Serialization.cs index 9268e49f2df5..b264d2aaf9ea 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantData.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantData.Serialization.cs @@ -21,6 +21,15 @@ public partial class TenantData : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(TenantData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -99,7 +107,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption #endif } } - writer.WriteEndObject(); } TenantData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md b/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md index 3735f0952b5c..890262e0e366 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md +++ b/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md @@ -13,6 +13,7 @@ head-as-boolean: false modelerfour: lenient-model-deduplication: true use-model-reader-writer: true +use-write-core: true deserialize-null-collection-as-null-value: true enable-bicep-serialization: true diff --git a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType1.json b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType1.json index 247352e809cb..4eb18e12d02e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType1.json +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType1.json @@ -1,4 +1,6 @@ -{ +{ + "tags": {}, + "location": "eastus", "plan": { "name": "NameForPlan", "publisher": "PublisherForPlan", @@ -15,7 +17,5 @@ "family": "FamilyForSku", "model": "ModelForSku", "capacity": 15464547 - }, - "tags": {}, - "location": "eastus" + } } diff --git a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType2.json b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType2.json index bf11cf30ce47..472418a3dbda 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType2.json +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/Unit/TestAssets/GenericResourceData/SerializationTestType2.json @@ -1,4 +1,9 @@ -{ +{ + "tags": { + "key1": "value1", + "key2": "value2" + }, + "location": "eastus", "plan": { "name": "NameForPlan", "publisher": "PublisherForPlan", @@ -15,10 +20,5 @@ "family": "FamilyForSku", "model": "ModelForSku", "capacity": 15464547 - }, - "tags": { - "key1": "value1", - "key2": "value2" - }, - "location": "eastus" + } } diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index e9e2255bc9f7..d0b6b524e874 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -41,6 +41,7 @@ trigger: - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices - sdk/communication/Azure.ResourceManager.Communication - sdk/compute/Azure.ResourceManager.Compute + - sdk/computefleet/Azure.ResourceManager.ComputeFleet - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger - sdk/confluent/Azure.ResourceManager.Confluent - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere @@ -241,6 +242,7 @@ pr: - sdk/cognitiveservices/Azure.ResourceManager.CognitiveServices - sdk/communication/Azure.ResourceManager.Communication - sdk/compute/Azure.ResourceManager.Compute + - sdk/computefleet/Azure.ResourceManager.ComputeFleet - sdk/confidentialledger/Azure.ResourceManager.ConfidentialLedger - sdk/confluent/Azure.ResourceManager.Confluent - sdk/connectedvmwarevsphere/Azure.ResourceManager.ConnectedVMwarevSphere diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/QueueRuntimeProperties.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/QueueRuntimeProperties.cs index 23924c3e71b8..39a7b06588da 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/QueueRuntimeProperties.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/QueueRuntimeProperties.cs @@ -66,7 +66,8 @@ internal QueueRuntimeProperties(string name) public DateTimeOffset UpdatedAt { get; internal set; } ///

- /// The when the entity was last accessed. + /// The of the last time a message was sent or + /// the last time there was a receive request to this queue. /// public DateTimeOffset AccessedAt { get; internal set; } } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/SubscriptionRuntimeProperties.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/SubscriptionRuntimeProperties.cs index 800e310fbf4f..7f34826428ae 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/SubscriptionRuntimeProperties.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/SubscriptionRuntimeProperties.cs @@ -52,7 +52,7 @@ internal SubscriptionRuntimeProperties(string topicName, string subscriptionName public long TransferDeadLetterMessageCount { get; internal set; } /// - /// The when the entity was last accessed. + /// The of the last time there was a receive request to this subscription. /// public DateTimeOffset AccessedAt { get; internal set; } diff --git a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicRuntimeProperties.cs b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicRuntimeProperties.cs index b09dd8cf1d2e..d24dc7d723f7 100644 --- a/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicRuntimeProperties.cs +++ b/sdk/servicebus/Azure.Messaging.ServiceBus/src/Administration/TopicRuntimeProperties.cs @@ -21,7 +21,7 @@ internal TopicRuntimeProperties(string name) public string Name { get; internal set; } /// - /// The when the entity was last accessed. + /// The at which a message was last sent to the topic. /// public DateTimeOffset AccessedAt { get; internal set; } diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index c1416524f022..93d74d194a85 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -3247,12 +3247,8 @@ internal async Task OpenReadInternal( /// /// Specifies the of the source blob. The value may /// be a of up to 2 KB in length that specifies a - /// blob. A source blob in the same storage account can be - /// authenticated via Shared Key. However, if the source is a blob in - /// another account, the source blob must either be public or must be - /// authenticated via a shared access signature. If the source blob - /// is public, no authentication is required to perform the copy - /// operation. + /// blob. + /// Source Blob Authentication /// /// The source object may be a file in the Azure File service. If the /// source object is a file that is to be copied to a blob, then the @@ -3314,12 +3310,8 @@ public virtual CopyFromUriOperation StartCopyFromUri( /// /// Specifies the of the source blob. The value may /// be a of up to 2 KB in length that specifies a - /// blob. A source blob in the same storage account can be - /// authenticated via Shared Key. However, if the source is a blob in - /// another account, the source blob must either be public or must be - /// authenticated via a shared access signature. If the source blob - /// is public, no authentication is required to perform the copy - /// operation. + /// blob. + /// Source Blob Authentication /// /// The source object may be a file in the Azure File service. If the /// source object is a file that is to be copied to a blob, then the @@ -3402,12 +3394,8 @@ public virtual CopyFromUriOperation StartCopyFromUri( /// /// Specifies the of the source blob. The value may /// be a of up to 2 KB in length that specifies a - /// blob. A source blob in the same storage account can be - /// authenticated via Shared Key. However, if the source is a blob in - /// another account, the source blob must either be public or must be - /// authenticated via a shared access signature. If the source blob - /// is public, no authentication is required to perform the copy - /// operation. + /// blob. + /// Source Blob Authentication /// /// The source object may be a file in the Azure File service. If the /// source object is a file that is to be copied to a blob, then the @@ -3469,12 +3457,8 @@ public virtual async Task StartCopyFromUriAsync( /// /// Specifies the of the source blob. The value may /// be a of up to 2 KB in length that specifies a - /// blob. A source blob in the same storage account can be - /// authenticated via Shared Key. However, if the source is a blob in - /// another account, the source blob must either be public or must be - /// authenticated via a shared access signature. If the source blob - /// is public, no authentication is required to perform the copy - /// operation. + /// blob. + /// Source Blob Authentication /// /// The source object may be a file in the Azure File service. If the /// source object is a file that is to be copied to a blob, then the @@ -3557,12 +3541,8 @@ public virtual async Task StartCopyFromUriAsync( /// /// Specifies the of the source blob. The value may /// be a of up to 2 KB in length that specifies a - /// blob. A source blob in the same storage account can be - /// authenticated via Shared Key. However, if the source is a blob in - /// another account, the source blob must either be public or must be - /// authenticated via a shared access signature. If the source blob - /// is public, no authentication is required to perform the copy - /// operation. + /// blob. + /// Source Blob Authentication /// /// The source object may be a file in the Azure File service. If the /// source object is a file that is to be copied to a blob, then the @@ -3921,11 +3901,10 @@ private async Task AbortCopyFromUriInternal( /// /// /// Required. Specifies the URL of the source blob. The value may be a URL of up to 2 KB in length - /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. The - /// source blob must either be public or must be authorized via a shared access signature. If the - /// source blob is public, no authorization is required to perform the operation. If the size of the - /// source blob is greater than 256 MiB, the request will fail with 409 (Conflict). The blob type of - /// the source blob has to be block blob. + /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. + /// + /// Source Blob Authentication If the size of the source blob is greater than 256 MiB, the request will fail + /// with 409 (Conflict). The blob type of the source blob has to be block blob. /// /// /// Optional parameters. @@ -3975,11 +3954,10 @@ public virtual Response SyncCopyFromUri( /// /// /// Required. Specifies the URL of the source blob. The value may be a URL of up to 2 KB in length - /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. The - /// source blob must either be public or must be authorized via a shared access signature. If the - /// source blob is public, no authorization is required to perform the operation. If the size of the - /// source blob is greater than 256 MiB, the request will fail with 409 (Conflict). The blob type of - /// the source blob has to be block blob. + /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. + /// + /// Source Blob Authentication If the size of the source blob is greater than 256 MiB, the request will fail + /// with 409 (Conflict). The blob type of the source blob has to be block blob. /// /// /// Optional parameters. @@ -4029,11 +4007,10 @@ public virtual async Task> SyncCopyFromUriAsync( /// /// /// Required. Specifies the URL of the source blob. The value may be a URL of up to 2 KB in length - /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. The - /// source blob must either be public or must be authorized via a shared access signature. If the - /// source blob is public, no authorization is required to perform the operation. If the size of the - /// source blob is greater than 256 MiB, the request will fail with 409 (Conflict). The blob type of - /// the source blob has to be block blob. + /// that specifies a blob. The value should be URL-encoded as it would appear in a request URI. + /// + /// Source Blob Authentication If the size of the source blob is greater than 256 MiB, the request will fail + /// with 409 (Conflict). The blob type of the source blob has to be block blob. /// /// /// Optional custom metadata to set for this blob. diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs index cd6bc3788fc2..b873b9bc7129 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs @@ -2840,9 +2840,9 @@ internal async Task OpenWriteInternal( /// Required. Specifies the URL of the source blob. The source blob may be of any type, /// including a block blob, append blob, or page blob. The value may be a URL of up to 2 /// KiB in length that specifies a blob. The value should be URL-encoded as it would appear - /// in a request URI. The source blob must either be public or must be authorized via a - /// shared access signature. If the source blob is public, no authorization is required - /// to perform the operation. + /// in a request URI. + /// + /// Source Blob Authentication /// /// /// Whether the upload should overwrite the existing blob. The @@ -2884,9 +2884,9 @@ public virtual Response SyncUploadFromUri( /// Required. Specifies the URL of the source blob. The source blob may be of any type, /// including a block blob, append blob, or page blob. The value may be a URL of up to 2 /// KiB in length that specifies a blob. The value should be URL-encoded as it would appear - /// in a request URI. The source blob must either be public or must be authorized via a - /// shared access signature. If the source blob is public, no authorization is required - /// to perform the operation. + /// in a request URI. + /// + /// Source Blob Authentication /// /// /// Whether the upload should overwrite the existing blob. The @@ -2928,9 +2928,9 @@ public virtual async Task> SyncUploadFromUriAsync( /// Required. Specifies the URL of the source blob. The source blob may be of any type, /// including a block blob, append blob, or page blob. The value may be a URL of up to 2 /// KiB in length that specifies a blob. The value should be URL-encoded as it would appear - /// in a request URI. The source blob must either be public or must be authorized via a - /// shared access signature. If the source blob is public, no authorization is required - /// to perform the operation. + /// in a request URI. + /// + /// Source Blob Authentication /// /// /// Optional parameters. @@ -2970,9 +2970,9 @@ public virtual Response SyncUploadFromUri( /// Required. Specifies the URL of the source blob. The source blob may be of any type, /// including a block blob, append blob, or page blob. The value may be a URL of up to 2 /// KiB in length that specifies a blob. The value should be URL-encoded as it would appear - /// in a request URI. The source blob must either be public or must be authorized via a - /// shared access signature. If the source blob is public, no authorization is required - /// to perform the operation. + /// in a request URI. + /// + /// Source Blob Authentication /// /// /// Optional parameters. @@ -3012,9 +3012,9 @@ public virtual async Task> SyncUploadFromUriAsync( /// Required. Specifies the URL of the source blob. The source blob may be of any type, /// including a block blob, append blob, or page blob. The value may be a URL of up to 2 /// KiB in length that specifies a blob. The value should be URL-encoded as it would appear - /// in a request URI. The source blob must either be public or must be authorized via a - /// shared access signature. If the source blob is public, no authorization is required - /// to perform the operation. + /// in a request URI. + /// + /// Source Blob Authentication /// /// /// Optional parameters. diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md index 4deb335aad25..33e0c4a02c4f 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/README.md @@ -116,7 +116,7 @@ Upload a directory. ```C# Snippet:SimpleDirectoryUpload_Shares DataTransfer folderTransfer = await transferManager.StartTransferAsync( - sourceResource: files.FromFile(sourceLocalDirectory), + sourceResource: files.FromDirectory(sourceLocalDirectory), destinationResource: shares.FromDirectory(destinationFolderUri)); await folderTransfer.WaitForCompletionAsync(); ``` diff --git a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs index 77ffff12a88c..b9427ce812b2 100644 --- a/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs +++ b/sdk/storage/Azure.Storage.DataMovement.Files.Shares/samples/Sample01b_HelloWorldAsync.cs @@ -124,7 +124,7 @@ public async Task Upload() #region Snippet:SimpleDirectoryUpload_Shares DataTransfer folderTransfer = await transferManager.StartTransferAsync( - sourceResource: files.FromFile(sourceLocalDirectory), + sourceResource: files.FromDirectory(sourceLocalDirectory), destinationResource: shares.FromDirectory(destinationFolderUri)); await folderTransfer.WaitForCompletionAsync(); #endregion diff --git a/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs b/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs index 886ec4ff88e5..9ec0316402fa 100644 --- a/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs +++ b/sdk/storage/Azure.Storage.DataMovement/src/TransferManager.cs @@ -20,35 +20,31 @@ namespace Azure.Storage.DataMovement /// public class TransferManager : IAsyncDisposable { - // Indicates whether the current thread is processing Jobs. - private static Task _currentTaskIsProcessingJob; - - // Indicates whether the current thread is processing Jobs Parts. - private static Task _currentTaskIsProcessingJobPart; - - // Indicates whether the current thread is processing Jobs Chunks. - private static Task _currentTaskIsProcessingJobChunk; + // Async channel reader tasks. These loop for the lifetime of the object. + private readonly Task _currentTaskIsProcessingJob; + private readonly Task _currentTaskIsProcessingJobPart; + private readonly Task _currentTaskIsProcessingJobChunk; /// /// Channel of Jobs waiting to divided into job parts/files. /// /// Limit 1 task to convert jobs to job parts. /// - private Channel _jobsToProcessChannel { get; set; } + private readonly Channel _jobsToProcessChannel; /// /// Channel of Job parts / files to be divided into chunks / requests /// /// Limit 64 tasks to convert job parts to chunks. /// - private Channel _partsToProcessChannel { get; set; } + private readonly Channel _partsToProcessChannel; /// /// Channel of Job chunks / requests to send to the service. /// /// Limit 4-300/Max amount of tasks allowed to process chunks. /// - private Channel> _chunksToProcessChannel { get; set; } + private readonly Channel> _chunksToProcessChannel; /// /// This value can fluctuate depending on if we've reached max capacity @@ -67,7 +63,6 @@ public class TransferManager : IAsyncDisposable /// If unspecified will default to LocalTransferCheckpointer at {currentpath}/.azstoragedml /// internal TransferCheckpointer _checkpointer; - private TransferCheckpointStoreOptions _checkpointerOptions; internal readonly List _resumeProviders; @@ -85,11 +80,7 @@ public class TransferManager : IAsyncDisposable private CancellationTokenSource _channelCancellationTokenSource; private CancellationToken _cancellationToken => _channelCancellationTokenSource.Token; - /// - /// Array pools for reading from streams to upload - /// - internal ArrayPool UploadArrayPool => _arrayPool; - private ArrayPool _arrayPool; + private readonly ArrayPool _arrayPool; internal ClientDiagnostics ClientDiagnostics { get; } @@ -127,8 +118,8 @@ public TransferManager(TransferManagerOptions options = default) _currentTaskIsProcessingJobPart = Task.Run(() => NotifyOfPendingJobPartProcessing()); _currentTaskIsProcessingJobChunk = Task.Run(() => NotifyOfPendingJobChunkProcessing()); _maxJobChunkTasks = options?.MaximumConcurrency ?? DataMovementConstants.MaxJobChunkTasks; - _checkpointerOptions = options?.CheckpointerOptions != default ? new TransferCheckpointStoreOptions(options.CheckpointerOptions) : default; - _checkpointer = _checkpointerOptions != default ? _checkpointerOptions.GetCheckpointer() : CreateDefaultCheckpointer(); + TransferCheckpointStoreOptions checkpointerOptions = options?.CheckpointerOptions != default ? new TransferCheckpointStoreOptions(options.CheckpointerOptions) : default; + _checkpointer = checkpointerOptions != default ? checkpointerOptions.GetCheckpointer() : CreateDefaultCheckpointer(); _resumeProviders = options?.ResumeProviders != null ? new(options.ResumeProviders) : new(); _dataTransfers = new Dictionary(); _arrayPool = ArrayPool.Shared; diff --git a/sdk/tables/Azure.Data.Tables/CHANGELOG.md b/sdk/tables/Azure.Data.Tables/CHANGELOG.md index 7501c001fab4..1484234d0d3d 100644 --- a/sdk/tables/Azure.Data.Tables/CHANGELOG.md +++ b/sdk/tables/Azure.Data.Tables/CHANGELOG.md @@ -3,7 +3,7 @@ ## 12.9.1 (Unreleased) ### Bugs Fixed -- Fixed an issue that prevented use of stored access policy based SaS Uris by adding a constructor to `TableSasBuilder` that accepts a stored access policy identifier without needing to specify the policy's permissions. +- Fixed an issue that prevented use of stored access policy based SaS Uris by adding a parameterless constructor to `TableSasBuilder`. The resulting builder can then be modified to include the stored access policy identifier or any other details. ## 12.9.0 (2024-07-22) diff --git a/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs b/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs index 2dca760a2c9f..3af47f771edc 100644 --- a/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs +++ b/sdk/tables/Azure.Data.Tables/api/Azure.Data.Tables.netstandard2.0.cs @@ -418,8 +418,8 @@ public enum TableAccountSasResourceTypes } public partial class TableSasBuilder { + public TableSasBuilder() { } public TableSasBuilder(string tableName, Azure.Data.Tables.Sas.TableSasPermissions permissions, System.DateTimeOffset expiresOn) { } - public TableSasBuilder(string tableName, string identifier) { } public TableSasBuilder(string tableName, string rawPermissions, System.DateTimeOffset expiresOn) { } public TableSasBuilder(System.Uri sasUri) { } public System.DateTimeOffset ExpiresOn { get { throw null; } set { } } diff --git a/sdk/tables/Azure.Data.Tables/src/Sas/TableSasBuilder.cs b/sdk/tables/Azure.Data.Tables/src/Sas/TableSasBuilder.cs index 8fa8b04f3a26..993577e915b2 100644 --- a/sdk/tables/Azure.Data.Tables/src/Sas/TableSasBuilder.cs +++ b/sdk/tables/Azure.Data.Tables/src/Sas/TableSasBuilder.cs @@ -47,20 +47,13 @@ public TableSasBuilder(string tableName, string rawPermissions, DateTimeOffset e } /// - /// Initializes an instance of a . + /// Initializes an instance of a with no details set. At minimum, additional properties must be set to create a valid SaS. + /// These include setting the , permissions, and an expiry. Permissions and expiry can also be specified in a shared access policy, which can be + /// selected by specifying the name of the policy on the property. + /// /// - /// The name of the table being made accessible with the shared access signature. - /// The identifier of the stored access policy that defines the permissions and, optionally, expiry of the shared access signature. - /// Note: Either the stored access policy specified by the or the created shared access signature must define an expiry. - /// If neither define an expiry or both do, authentication will fail. - public TableSasBuilder(string tableName, string identifier) - { - Argument.AssertNotNullOrEmpty(tableName, nameof(tableName)); - Argument.AssertNotNullOrEmpty(identifier, nameof(identifier)); - - TableName = tableName; - Identifier = identifier; - } + public TableSasBuilder() + { } /// /// Initializes a new instance of based on an existing Uri containing a shared access signature. @@ -133,6 +126,8 @@ public TableSasBuilder(Uri sasUri) /// /// An optional unique value up to 64 characters in length that /// correlates to an access policy specified for the container. + /// Note: Either the stored access policy specified by the or the created shared access signature must define an expiry. + /// If neither define an expiry or both do, authentication will fail. /// public string Identifier { get; set; } diff --git a/sdk/tables/Azure.Data.Tables/tests/TableSasBuilderTests.cs b/sdk/tables/Azure.Data.Tables/tests/TableSasBuilderTests.cs index 087bc66187f8..3ba75075bce1 100644 --- a/sdk/tables/Azure.Data.Tables/tests/TableSasBuilderTests.cs +++ b/sdk/tables/Azure.Data.Tables/tests/TableSasBuilderTests.cs @@ -17,7 +17,6 @@ public void ValidatesArgs() Assert.Throws(() => new TableSasBuilder(string.Empty, TableSasPermissions.Add, DateTimeOffset.Now)); Assert.Throws(() => new TableSasBuilder("table", null, DateTimeOffset.Now)); Assert.Throws(() => new TableSasBuilder("table", string.Empty, DateTimeOffset.Now)); - Assert.Throws(() => new TableSasBuilder("table", null)); Assert.Throws(() => new TableSasBuilder(null)); } @@ -70,5 +69,21 @@ public void SetPermissions(string tableName, string permissionsString, TableSasP Assert.AreEqual(permissionsString.ToLowerInvariant(), tableSasBuilder.Permissions); Assert.AreEqual(tableName, tableSasBuilder.TableName); } + + [Test] + public void UseParameterlessCtor() + { + var now = DateTimeOffset.Now; + var tableSasBuilder = new TableSasBuilder + { + TableName = "table", + ExpiresOn = now.AddHours(1) + }; + tableSasBuilder.SetPermissions(TableSasPermissions.Read); + + Assert.AreEqual("table", tableSasBuilder.TableName); + Assert.AreEqual("r", tableSasBuilder.Permissions); + Assert.AreEqual(now.AddHours(1), tableSasBuilder.ExpiresOn); + } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/CHANGELOG.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/CHANGELOG.md index eaa7e99767d9..8b2d003a0a1b 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/CHANGELOG.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/CHANGELOG.md @@ -1,14 +1,8 @@ # Release History -## 1.8.0-beta.1 (Unreleased) - +## 1.8.0 (2024-09-04) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added MQTT client events support. ## 1.7.0 (2023-08-28) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md index 35ed744e0653..e3eeb84f8d5e 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/README.md @@ -94,18 +94,15 @@ public static class WebPubSubOutputBindingFunction ### Functions that uses Web PubSub trigger ```C# Snippet:WebPubSubTriggerFunction -public static class WebPubSubTriggerFunction +[FunctionName("WebPubSubTriggerFunction")] +public static void Run( + ILogger logger, + [WebPubSubTrigger("hub", WebPubSubEventType.User, "message")] UserEventRequest request, + string data, + WebPubSubDataType dataType) { - [FunctionName("WebPubSubTriggerFunction")] - public static void Run( - ILogger logger, - [WebPubSubTrigger("hub", WebPubSubEventType.User, "message")] UserEventRequest request, - string data, - WebPubSubDataType dataType) - { - logger.LogInformation("Request from: {user}, data: {data}, dataType: {dataType}", - request.ConnectionContext.UserId, data, dataType); - } + logger.LogInformation("Request from: {user}, data: {data}, dataType: {dataType}", + request.ConnectionContext.UserId, data, dataType); } ``` @@ -123,6 +120,31 @@ public static class WebPubSubTriggerReturnValueFunction } ``` +### Functions that handles MQTT Client "connect" event +```C# Snippet:MqttConnectEventTriggerFunction +[FunctionName("mqttConnect")] +public static WebPubSubEventResponse Run( + [WebPubSubTrigger("hub", WebPubSubEventType.System, "connect", ClientProtocols = WebPubSubTriggerAcceptedClientProtocols.Mqtt)] MqttConnectEventRequest request, + ILogger log) +{ + if (request.ConnectionContext.ConnectionId != "attacker") + { + return request.CreateMqttResponse(request.ConnectionContext.UserId, Array.Empty(), new string[] { "webpubsub.joinLeaveGroup.group1", "webpubsub.sendToGroup.group2" }); + } + else + { + if (request.Mqtt.ProtocolVersion == MqttProtocolVersion.V311) + { + return request.CreateMqttV311ErrorResponse(MqttV311ConnectReturnCode.NotAuthorized); + } + else + { + return request.CreateMqttV50ErrorResponse(MqttV500ConnectReasonCode.NotAuthorized); + } + } +} +``` + ## Troubleshooting Please refer to [Monitor Azure Functions](https://docs.microsoft.com/azure/azure-functions/functions-monitoring) for troubleshooting guidance. diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub.netstandard2.0.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub.netstandard2.0.cs index b06b81fc9620..705d0aefa7ab 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub.netstandard2.0.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub.netstandard2.0.cs @@ -153,6 +153,7 @@ public WebPubSubConnection(System.Uri uri) { } public partial class WebPubSubConnectionAttribute : System.Attribute { public WebPubSubConnectionAttribute() { } + public Azure.Messaging.WebPubSub.WebPubSubClientProtocol ClientProtocol { get { throw null; } set { } } [Microsoft.Azure.WebJobs.Description.ConnectionStringAttribute] public string Connection { get { throw null; } set { } } [Microsoft.Azure.WebJobs.Description.AutoResolveAttribute] @@ -190,6 +191,12 @@ public WebPubSubFunctionsOptions() { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] string Microsoft.Azure.WebJobs.Hosting.IOptionsFormatter.Format() { throw null; } } + public enum WebPubSubTriggerAcceptedClientProtocols + { + All = 0, + WebPubSub = 1, + Mqtt = 2, + } [Microsoft.Azure.WebJobs.Description.BindingAttribute(TriggerHandlesReturnValue=true)] [System.AttributeUsageAttribute(System.AttributeTargets.Parameter)] public partial class WebPubSubTriggerAttribute : System.Attribute @@ -198,6 +205,7 @@ public WebPubSubTriggerAttribute(Microsoft.Azure.WebPubSub.Common.WebPubSubEvent public WebPubSubTriggerAttribute(Microsoft.Azure.WebPubSub.Common.WebPubSubEventType eventType, string eventName, params string[] connections) { } public WebPubSubTriggerAttribute(string hub, Microsoft.Azure.WebPubSub.Common.WebPubSubEventType eventType, string eventName) { } public WebPubSubTriggerAttribute(string hub, Microsoft.Azure.WebPubSub.Common.WebPubSubEventType eventType, string eventName, params string[] connections) { } + public Microsoft.Azure.WebJobs.Extensions.WebPubSub.WebPubSubTriggerAcceptedClientProtocols ClientProtocols { get { throw null; } set { } } public string[] Connections { get { throw null; } } [System.ComponentModel.DataAnnotations.RequiredAttribute] public string EventName { get { throw null; } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples/WebPubSubTriggerFunction.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples/WebPubSubTriggerFunction.cs index 52166bc1929f..ab6cff763335 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples/WebPubSubTriggerFunction.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples/WebPubSubTriggerFunction.cs @@ -1,15 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using Microsoft.Azure.WebJobs.Extensions.WebPubSub; using Microsoft.Azure.WebPubSub.Common; using Microsoft.Extensions.Logging; namespace Microsoft.Azure.WebJobs.Samples { - #region Snippet:WebPubSubTriggerFunction public static class WebPubSubTriggerFunction { + #region Snippet:WebPubSubTriggerFunction [FunctionName("WebPubSubTriggerFunction")] public static void Run( ILogger logger, @@ -20,6 +21,39 @@ public static void Run( logger.LogInformation("Request from: {user}, data: {data}, dataType: {dataType}", request.ConnectionContext.UserId, data, dataType); } + #endregion + + #region Snippet:MqttConnectEventTriggerFunction + [FunctionName("mqttConnect")] + public static WebPubSubEventResponse Run( + [WebPubSubTrigger("hub", WebPubSubEventType.System, "connect", ClientProtocols = WebPubSubTriggerAcceptedClientProtocols.Mqtt)] MqttConnectEventRequest request, + ILogger log) + { + if (request.ConnectionContext.ConnectionId != "attacker") + { + return request.CreateMqttResponse(request.ConnectionContext.UserId, Array.Empty(), new string[] { "webpubsub.joinLeaveGroup.group1", "webpubsub.sendToGroup.group2" }); + } + else + { + if (request.Mqtt.ProtocolVersion == MqttProtocolVersion.V311) + { + return request.CreateMqttV311ErrorResponse(MqttV311ConnectReturnCode.NotAuthorized); + } + else + { + return request.CreateMqttV50ErrorResponse(MqttV500ConnectReasonCode.NotAuthorized); + } + } + } + #endregion + + #region: Snippet:MqttDisconnectedEventTriggerFunction + [FunctionName("mqttDisconnected")] + public static void Run( + [WebPubSubTrigger("hub", WebPubSubEventType.System, "disconnected", ClientProtocols = WebPubSubTriggerAcceptedClientProtocols.Mqtt)] MqttDisconnectedEventRequest request, + ILogger log) + { + } + #endregion } - #endregion } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Config/WebPubSubConfigProvider.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Config/WebPubSubConfigProvider.cs index 10aab30ac764..6d2e6a8b34b0 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Config/WebPubSubConfigProvider.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Config/WebPubSubConfigProvider.cs @@ -137,7 +137,7 @@ private WebPubSubConnection GetClientConnection(WebPubSubConnectionAttribute att { var hub = Utilities.FirstOrDefault(attribute.Hub, _options.Hub); var service = new WebPubSubService(attribute.Connection, hub); - return service.GetClientConnection(attribute.UserId); + return service.GetClientConnection(attribute.UserId, clientProtocol: attribute.ClientProtocol); } private void ValidateConnectionString(string attributeConnectionString, string attributeConnectionStringName) @@ -160,6 +160,7 @@ internal static void RegisterJsonConverter() new ConnectionStatesNewtonsoftConverter(), new WebPubSubDataTypeJsonConverter(), new WebPubSubEventTypeJsonConverter(), + new WebPubSubTriggerAcceptedClientProtocolsJsonConverter(), }, }; } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Constants.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Constants.cs index a4880625d867..ea164ab99822 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Constants.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Constants.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub { internal static class Constants { - public static readonly char[] HeaderSeparator = { ',', ' '}; + public static readonly char[] HeaderSeparator = { ',', ' ' }; public const string AllowedAllOrigins = "*"; // WebPubSubOptions can be set by customers. @@ -13,6 +13,8 @@ internal static class Constants public const string HubNameStringName = "WebPubSubHub"; public const string WebPubSubValidationStringName = "WebPubSubValidation"; + public const string MqttWebSocketSubprotocolValue = "mqtt"; + public static class ContentTypes { public const string JsonContentType = "application/json"; @@ -45,6 +47,12 @@ public static class CloudEvents public const string UserId = Prefix + "userId"; public const string State = Prefix + "connectionState"; public const string AwpsVersion = Prefix + "awpsversion"; + public const string Subprotocol = Prefix + "subprotocol"; + + #region MQTT + public const string MqttPhysicalConnectionId = Prefix + "physicalConnectionId"; + public const string MqttSessionId = Prefix + "sessionId"; + #endregion public const string TypeSystemPrefix = "azure.webpubsub.sys."; public const string TypeUserPrefix = "azure.webpubsub.user."; diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/JsonConverters/MqttConnectEventErrorResponseJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/JsonConverters/MqttConnectEventErrorResponseJsonConverter.cs new file mode 100644 index 000000000000..010458801644 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/JsonConverters/MqttConnectEventErrorResponseJsonConverter.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Microsoft.Azure.WebPubSub.Common; +using Newtonsoft.Json; + +namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub; + +/// +/// This converter is used to avoid serializing the properties of the base class . +/// +internal class MqttConnectEventErrorResponseJsonConverter : JsonConverter +{ + public static MqttConnectEventErrorResponseJsonConverter Instance = new(); + + public override MqttConnectEventErrorResponse ReadJson(JsonReader reader, Type objectType, MqttConnectEventErrorResponse existingValue, bool hasExistingValue, JsonSerializer serializer) + { + throw new NotImplementedException(); + } + + public override void WriteJson(JsonWriter writer, MqttConnectEventErrorResponse value, JsonSerializer serializer) + { + writer.WriteStartObject(); + writer.WritePropertyName("mqtt"); + serializer.Serialize(writer, value.Mqtt); + writer.WriteEndObject(); + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Microsoft.Azure.WebJobs.Extensions.WebPubSub.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Microsoft.Azure.WebJobs.Extensions.WebPubSub.csproj index 410a5e325d5b..785dc7ccfcbd 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Microsoft.Azure.WebJobs.Extensions.WebPubSub.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Microsoft.Azure.WebJobs.Extensions.WebPubSub.csproj @@ -5,7 +5,7 @@ Microsoft.Azure.WebJobs.Extensions.WebPubSub Azure, WebPubSub Azure Functions extension for the WebPubSub service - 1.8.0-beta.1 + 1.8.0 1.7.0 $(NoWarn);CS8632;CA1056;CA2227 @@ -15,6 +15,10 @@ + + + + @@ -24,11 +28,11 @@ + - --> + - + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubRequestExtensions.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubRequestExtensions.cs index bb4e50a5c0ef..9dc359185a8b 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubRequestExtensions.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubRequestExtensions.cs @@ -65,8 +65,16 @@ public static async Task ReadWebPubSubRequestAsync(this H case RequestType.Connect: { var content = await new StreamReader(request.Body).ReadToEndAsync().ConfigureAwait(false); - var eventRequest = JsonSerializer.Deserialize(content); - return new ConnectEventRequest(context, eventRequest.Claims, eventRequest.Query, eventRequest.Subprotocols, eventRequest.ClientCertificates, eventRequest.Headers); + if (context is MqttConnectionContext mqttContext) + { + var requestBody = JsonSerializer.Deserialize(content); + return new MqttConnectEventRequest(mqttContext, requestBody.Claims, requestBody.Query, requestBody.ClientCertificates, requestBody.Headers, requestBody.Mqtt); + } + else + { + var requestBody = JsonSerializer.Deserialize(content); + return new ConnectEventRequest(context, requestBody.Claims, requestBody.Query, requestBody.Subprotocols, requestBody.ClientCertificates, requestBody.Headers); + } } case RequestType.User: { @@ -86,8 +94,16 @@ public static async Task ReadWebPubSubRequestAsync(this H case RequestType.Disconnected: { var content = await new StreamReader(request.Body).ReadToEndAsync().ConfigureAwait(false); - var eventRequest = JsonSerializer.Deserialize(content); - return new DisconnectedEventRequest(context, eventRequest.Reason); + if (context is MqttConnectionContext mqttContext) + { + var requestBody = JsonSerializer.Deserialize(content); + return new MqttDisconnectedEventRequest(mqttContext, requestBody.Reason, requestBody.Mqtt); + } + else + { + var requestBody = JsonSerializer.Deserialize(content); + return new DisconnectedEventRequest(context, requestBody.Reason); + } } default: return null; @@ -220,6 +236,16 @@ private static bool TryParseCloudEvents(this HttpRequest request, out WebPubSubC states = request.Headers.GetFirstHeaderValueOrDefault(Constants.Headers.CloudEvents.State).DecodeConnectionStates(); } + if (Constants.MqttWebSocketSubprotocolValue.Equals(request.Headers.GetFirstHeaderValueOrDefault(Constants.Headers.CloudEvents.Subprotocol))) + { + var physicalConnectionId = request.Headers[Constants.Headers.CloudEvents.MqttPhysicalConnectionId]; + if (physicalConnectionId.Count != 0) + { + var sessionId = request.Headers.GetFirstHeaderValueOrDefault(Constants.Headers.CloudEvents.MqttSessionId); + connectionContext = new MqttConnectionContext(eventType, eventName, hub, connectionId, physicalConnectionId.First(), sessionId, userId, signature, origin, states, headers); + return true; + } + } connectionContext = new WebPubSubConnectionContext(eventType, eventName, hub, connectionId, userId, signature, origin, states, headers); return true; } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubService.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubService.cs index 60c4e80f0f41..01b9070f7bec 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubService.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Services/WebPubSubService.cs @@ -22,9 +22,9 @@ public WebPubSubService(WebPubSubServiceClient client) public WebPubSubServiceClient Client => _client; - internal WebPubSubConnection GetClientConnection(string userId = null, string[] roles = null) + internal WebPubSubConnection GetClientConnection(string userId = null, string[] roles = null, WebPubSubClientProtocol clientProtocol = WebPubSubClientProtocol.Default) { - var url = _client.GetClientAccessUri(userId: userId, roles: roles); + var url = _client.GetClientAccessUri(userId: userId, roles: roles, clientProtocol: clientProtocol); return new WebPubSubConnection(url); } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAcceptedClientProtocols.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAcceptedClientProtocols.cs new file mode 100644 index 000000000000..e4b5f1fe116b --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAcceptedClientProtocols.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub; + +/// +/// Specifies which client protocol can trigger the Web PubSub trigger functions. +/// +public enum WebPubSubTriggerAcceptedClientProtocols +{ + /// + /// Accepts all client protocols. Default value. + /// + All, + /// + /// Accepts only WebPubSub client protocol. + /// + WebPubSub, + /// + /// Accepts only MQTT client protocol. + /// + Mqtt, +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAttribute.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAttribute.cs index cc9c342466ac..dad48484ef1e 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAttribute.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerAttribute.cs @@ -3,8 +3,8 @@ using System; using System.ComponentModel.DataAnnotations; -using Microsoft.Azure.WebPubSub.Common; using Microsoft.Azure.WebJobs.Description; +using Microsoft.Azure.WebPubSub.Common; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub { @@ -60,7 +60,7 @@ public WebPubSubTriggerAttribute(WebPubSubEventType eventType, string eventName, /// Target event name of the request. /// Target event type of the request. public WebPubSubTriggerAttribute(WebPubSubEventType eventType, string eventName) - : this ("", eventType, eventName) + : this("", eventType, eventName) { } @@ -86,5 +86,13 @@ public WebPubSubTriggerAttribute(WebPubSubEventType eventType, string eventName) /// Allowed service upstream ConnectionString for Signature checks. /// public string[] Connections { get; } + + /// + /// Specifies which client protocol can trigger the Web PubSub trigger functions. By default, it accepts all client protocols. + /// + public WebPubSubTriggerAcceptedClientProtocols ClientProtocols + { + get; set; + } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBinding.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBinding.cs index 45eac1e19c4f..a4efcefcfdf1 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBinding.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBinding.cs @@ -68,7 +68,7 @@ public Task CreateListenerAsync(ListenerFactoryContext context) { throw new ArgumentException("Hub name should be configured in either attribute or appsettings."); } - var attributeName = $"{hub}.{_attribute.EventType}.{_attribute.EventName}"; + var attributeName = Utilities.GetFunctionKey(hub, _attribute.EventType, _attribute.EventName, _attribute.ClientProtocols); var listernerKey = attributeName; var validationOptions = _attribute.Connections != null ? diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBindingProvider.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBindingProvider.cs index 78b22810ecd8..b2e97bc8e855 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBindingProvider.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerBindingProvider.cs @@ -30,7 +30,6 @@ public Task TryCreateAsync(TriggerBindingProviderContext contex { throw new ArgumentNullException(nameof(context)); } - var parameterInfo = context.Parameter; var attribute = parameterInfo.GetCustomAttribute(false); if (attribute == null) @@ -62,7 +61,10 @@ internal WebPubSubTriggerAttribute GetResolvedAttribute(WebPubSubTriggerAttribut hub, attribute.EventType, eventName, - attribute.Connections); + attribute.Connections) + { + ClientProtocols = attribute.ClientProtocols + }; } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerDispatcher.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerDispatcher.cs index cdaa93bb044a..b6c3e621f31f 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerDispatcher.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerDispatcher.cs @@ -53,9 +53,7 @@ public async Task ExecuteAsync(HttpRequestMessage req, var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var function = GetFunctionName(context); - - if (_listeners.TryGetValue(function, out var executor)) + if (TryResolveListener(context, out var executor)) { if (!context.IsValidSignature(executor.ValidationOptions)) { @@ -70,10 +68,10 @@ public async Task ExecuteAsync(HttpRequestMessage req, BinaryData data = null; WebPubSubDataType dataType = WebPubSubDataType.Text; - IDictionary claims = null; - IDictionary query = null; - IList subprotocols = null; - IList certificates = null; + IReadOnlyDictionary claims = null; + IReadOnlyDictionary query = null; + IReadOnlyList subprotocols = null; + IReadOnlyList certificates = null; string reason = null; WebPubSubEventRequest eventRequest = null; @@ -83,15 +81,37 @@ public async Task ExecuteAsync(HttpRequestMessage req, case RequestType.Connect: { var content = await req.Content.ReadAsStringAsync().ConfigureAwait(false); - var request = JsonSerializer.Deserialize(content); - eventRequest = new ConnectEventRequest(context, request.Claims, request.Query, request.Subprotocols, request.ClientCertificates, request.Headers); + if (context is MqttConnectionContext mqttContext) + { + var request = JsonSerializer.Deserialize(content); + eventRequest = new MqttConnectEventRequest(mqttContext, request.Claims, request.Query, request.ClientCertificates, request.Headers, request.Mqtt); + } + else + { + var request = JsonSerializer.Deserialize(content); + eventRequest = new ConnectEventRequest(context, request.Claims, request.Query, request.Subprotocols, request.ClientCertificates, request.Headers); + } + var connectEventRequest = (ConnectEventRequest)eventRequest; + claims = connectEventRequest.Claims; + query = connectEventRequest.Query; + subprotocols = connectEventRequest.Subprotocols; + certificates = connectEventRequest.ClientCertificates; break; } case RequestType.Disconnected: { var content = await req.Content.ReadAsStringAsync().ConfigureAwait(false); - var request = JsonSerializer.Deserialize(content); - eventRequest = new DisconnectedEventRequest(context, request.Reason); + if (context is MqttConnectionContext mqttContext) + { + var requestBody = JsonSerializer.Deserialize(content); + eventRequest = new MqttDisconnectedEventRequest(mqttContext, requestBody.Reason, requestBody.Mqtt); + } + else + { + var request = JsonSerializer.Deserialize(content); + eventRequest = new DisconnectedEventRequest(context, request.Reason); + } + reason = ((DisconnectedEventRequest)eventRequest).Reason; break; } case RequestType.User: @@ -163,6 +183,12 @@ await executor.Executor.TryExecuteAsync(new TriggeredFunctionData } catch (Exception ex) { + if (context is MqttConnectionContext mqttContext && requestType == RequestType.Connect) + { + var mqttProtocolVersion = ((MqttConnectEventRequest)eventRequest).Mqtt.ProtocolVersion; + var errorResponse = ((MqttConnectEventRequest)eventRequest).CreateErrorResponse(WebPubSubErrorCode.ServerError, ex.Message); + return Utilities.BuildErrorResponse(errorResponse); + } var error = new EventErrorResponse(WebPubSubErrorCode.ServerError, ex.Message); return Utilities.BuildErrorResponse(error); } @@ -201,6 +227,13 @@ private static bool TryParseCloudEvents(HttpRequestMessage request, out WebPubSu { states = connectionStates.SingleOrDefault().DecodeConnectionStates(); } + if (request.Headers.TryGetValues(Constants.Headers.CloudEvents.Subprotocol, out var subprotocols) && subprotocols.Contains(Constants.MqttWebSocketSubprotocolValue) + && request.Headers.TryGetValues(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, out var physicalConnectionId)) + { + var hasSessionId = request.Headers.TryGetValues(Constants.Headers.CloudEvents.MqttSessionId, out var sessionId); + context = new MqttConnectionContext(eventType, eventName, hub, connectionId, physicalConnectionId.First(), hasSessionId ? sessionId.First() : null, userId, signature, origin, states, headers); + return true; + } context = new WebPubSubConnectionContext(eventType, eventName, hub, connectionId, userId, signature, origin, states, headers); return true; @@ -212,9 +245,20 @@ private static bool TryParseCloudEvents(HttpRequestMessage request, out WebPubSu } } - private static string GetFunctionName(WebPubSubConnectionContext context) + private bool TryResolveListener(WebPubSubConnectionContext context, out WebPubSubListener listener) { - return $"{context.Hub}.{context.EventType}.{context.EventName}"; + // Try to match a listener for specified client protocol + var key = Utilities.GetFunctionKey(context.Hub, context.EventType, context.EventName, (context is MqttConnectionContext ? WebPubSubTriggerAcceptedClientProtocols.Mqtt : WebPubSubTriggerAcceptedClientProtocols.WebPubSub)); + if (_listeners.TryGetValue(key, out listener)) + { + return true; + } + key = $"{context.Hub}.{context.EventType}.{context.EventName}.{WebPubSubTriggerAcceptedClientProtocols.All}"; // match all client protocols + if (_listeners.TryGetValue(key, out listener)) + { + return true; + } + return false; } private static HttpResponseMessage RespondToServiceAbuseCheck(IList requestHosts, WebPubSubValidationOptions options) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerEvent.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerEvent.cs index 4bcbf540f770..5a2922f26f63 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerEvent.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Trigger/WebPubSubTriggerEvent.cs @@ -19,13 +19,13 @@ internal class WebPubSubTriggerEvent public WebPubSubDataType DataType { get; set; } - public IList Subprotocols { get; set; } + public IReadOnlyList Subprotocols { get; set; } - public IDictionary Claims { get; set; } + public IReadOnlyDictionary Claims { get; set; } - public IDictionary Query { get; set; } + public IReadOnlyDictionary Query { get; set; } - public IList ClientCertificates { get; set; } + public IReadOnlyList ClientCertificates { get; set; } public string Reason { get; set; } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Utilities.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Utilities.cs index b6ef8bf5fdf4..b6376c4ab3f1 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Utilities.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/Utilities.cs @@ -77,7 +77,11 @@ public static HttpResponseMessage BuildConnectEventResponse(string response, Dic public static HttpResponseMessage BuildErrorResponse(EventErrorResponse error) { - return BuildErrorResponse(error.ErrorMessage, error.Code); + return error switch + { + MqttConnectEventErrorResponse mqttConnectError => BuildErrorResponse(JsonConvert.SerializeObject(mqttConnectError, MqttConnectEventErrorResponseJsonConverter.Instance), mqttConnectError.Code), + _ => BuildErrorResponse(error.ErrorMessage, error.Code) + }; } public static HttpResponseMessage BuildErrorResponse(string errorMessage, WebPubSubErrorCode code = WebPubSubErrorCode.ServerError) @@ -130,9 +134,20 @@ public static HttpResponseMessage BuildValidResponse( JObject response = jResponse is JObject jObj ? jObj : throw new ArgumentException("Response should be a JObject."); // check error as top priority. - if (response.TryGetValue("code", out var code) - && code.ToObject() != WebPubSubStatusCode.Success) + if ( + // General error response + response.TryGetValue("code", out var code) + && code.ToObject() != WebPubSubStatusCode.Success || + + // MQTT connect error response + response.TryGetValue("mqtt", out var mqtt) + && mqtt is JObject mqttObject && mqttObject.TryGetValue("code", out _)) { + if (context is MqttConnectionContext mqttContext) + { + var mqttErrorConnectResponse = response.ToObject(); + return BuildErrorResponse(JsonConvert.SerializeObject(mqttErrorConnectResponse, MqttConnectEventErrorResponseJsonConverter.Instance), mqttErrorConnectResponse.Code); + } var error = response.ToObject(); return BuildErrorResponse(error); } @@ -141,7 +156,11 @@ public static HttpResponseMessage BuildValidResponse( { var states = GetStatesFromJson(response); var mergedStates = context.UpdateStates(states); - var formattedResponse = JsonConvert.SerializeObject(response.ToObject()); + var formattedResponse = context switch + { + MqttConnectionContext => JsonConvert.SerializeObject(response.ToObject()), + _ => JsonConvert.SerializeObject(response.ToObject()) + }; return BuildConnectEventResponse(formattedResponse, mergedStates); } if (requestType == RequestType.User) @@ -227,6 +246,8 @@ public static bool IsValidationRequest(this HttpRequestMessage req, out List $"{hub}.{type}.{eventName}.{clientProtocol}"; + private static Dictionary GetStatesFromJson(JObject response) { if (response.TryGetValue("states", out var val)) @@ -241,5 +262,10 @@ private static Dictionary GetStatesFromJson(JObject response // We don't support clear states for JS return new Dictionary(); } + + private static MqttConnectEventErrorResponse ToMqttConnectErrorResponse(JObject jObject) + { + return jObject.ToObject(); + } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubConnectionAttribute.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubConnectionAttribute.cs index 18d3b9a76c75..5dc6b970c12e 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubConnectionAttribute.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubConnectionAttribute.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. using System; - +using Azure.Messaging.WebPubSub; using Microsoft.Azure.WebJobs.Description; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub @@ -31,5 +31,10 @@ public class WebPubSubConnectionAttribute : Attribute /// [AutoResolve] public string UserId { get; set; } + + /// + /// The client protocol. + /// + public WebPubSubClientProtocol ClientProtocol { get; set; } = WebPubSubClientProtocol.Default; } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubTriggerAcceptedClientProtocolJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubTriggerAcceptedClientProtocolJsonConverter.cs new file mode 100644 index 000000000000..a2697c0f8c55 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src/WebPubSubTriggerAcceptedClientProtocolJsonConverter.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub; + +internal class WebPubSubTriggerAcceptedClientProtocolsJsonConverter : JsonConverter +{ + private static readonly JsonSerializer JsonSerializer = JsonSerializer.Create(new JsonSerializerSettings + { + Converters = new[] + { + new StringEnumConverter() + } + }); + + public override WebPubSubTriggerAcceptedClientProtocols ReadJson(JsonReader reader, Type objectType, WebPubSubTriggerAcceptedClientProtocols existingValue, bool hasExistingValue, JsonSerializer serializer) => JsonSerializer.Deserialize(reader); + + public override void WriteJson(JsonWriter writer, WebPubSubTriggerAcceptedClientProtocols value, JsonSerializer serializer) => JsonSerializer.Serialize(writer, value); +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Common/TestHelpers.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Common/TestHelpers.cs index 5624571b10f1..71334341dde5 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Common/TestHelpers.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Common/TestHelpers.cs @@ -7,6 +7,7 @@ using System.Net.Http; using System.Net.Http.Headers; using System.Text; +using Azure.Messaging.WebPubSub; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; using Microsoft.Azure.WebJobs.Host.Config; @@ -90,7 +91,9 @@ public static HttpRequestMessage CreateHttpRequestMessage( string httpMethod = "Post", string[] origin = null, string userId = "testuser", - byte[] payload = null) + byte[] payload = null, + string[] subProtocols = null, + WebPubSubClientProtocol clientProtocol = WebPubSubClientProtocol.Default) { var context = new HttpRequestMessage() { @@ -110,6 +113,20 @@ public static HttpRequestMessage CreateHttpRequestMessage( context.Headers.Add(Constants.Headers.CloudEvents.UserId, userId); } + if (subProtocols != null) + { + context.Headers.Add(Constants.Headers.CloudEvents.Subprotocol, subProtocols); + } + + if (clientProtocol == WebPubSubClientProtocol.Mqtt) + { + context.Headers.Add(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, "physicalConnectionId"); + if (type != WebPubSubEventType.System || eventName != "connect") + { + context.Headers.Add(Constants.Headers.CloudEvents.MqttSessionId, "sessionId"); + } + } + if (payload != null) { context.Content = new StreamContent(new MemoryStream(payload)); diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/JobHostEndToEndTests.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/JobHostEndToEndTests.cs index 69826489522b..d972729699a1 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/JobHostEndToEndTests.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/JobHostEndToEndTests.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using Azure.Messaging.WebPubSub; using Microsoft.AspNetCore.Http; using Microsoft.Azure.WebJobs.Host; using Microsoft.Azure.WebJobs.Host.Indexers; @@ -53,6 +54,8 @@ public async Task TestWebPubSubInputBinding() var host = TestHelpers.NewHost(typeof(WebPubSubFuncs), configuration: FuncConfiguration); await host.GetJobHost().CallAsync("WebPubSubFuncs.TestWebPubSubInputConnection"); + + await host.GetJobHost().CallAsync("WebPubSubFuncs.TestMqttInputConnection"); } [TestCase] @@ -109,6 +112,12 @@ public static void TestWebPubSubInputConnection( // Valid case use default url for verification. Assert.AreEqual("wss://abc/client/hubs/chat", connection.BaseUri.AbsoluteUri); } + public static void TestMqttInputConnection( + [WebPubSubConnection(Hub = "chat", UserId = "aaa", ClientProtocol = WebPubSubClientProtocol.Mqtt)] WebPubSubConnection connection) + { + // Valid case use default url for verification. + Assert.AreEqual("wss://abc/clients/mqtt/hubs/chat", connection.BaseUri.AbsoluteUri); + } public static async Task TestWebPubSubOutput( [WebPubSub(Hub = "chat")] IAsyncCollector operation) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests.csproj index 40096cdab766..95e6ae9ee0fa 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests.csproj @@ -19,6 +19,7 @@ + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/WebPubSubTriggerDispatcherTests.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/WebPubSubTriggerDispatcherTests.cs index f4c7386a8ace..a7757b85c978 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/WebPubSubTriggerDispatcherTests.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/tests/WebPubSubTriggerDispatcherTests.cs @@ -1,14 +1,19 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. +using System; +using System.Collections.Generic; +using System.Linq; using System.Net; using System.Text; using System.Threading; using System.Threading.Tasks; +using Azure.Messaging.WebPubSub; using Microsoft.Azure.WebJobs.Host.Executors; using Microsoft.Azure.WebPubSub.Common; using Microsoft.Extensions.Logging.Abstractions; using Moq; +using Newtonsoft.Json; using NUnit.Framework; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSub.Tests @@ -123,9 +128,187 @@ public async Task TestProcessRequest_MessageMediaTypes(string mediaType, HttpSta Assert.AreEqual(expectedCode, response.StatusCode); } - private static WebPubSubTriggerDispatcher SetupDispatcher(string hub = TestHub, WebPubSubEventType type = TestType, string eventName = TestEvent, string connectionString = null) + private static IEnumerable TestHandleMqttConnectRequest_InProcessModelTestData = new object[][] { - var funcName = $"{hub}.{type}.{eventName}".ToLower(); + new object[]{ new MqttConnectEventResponse("userId",new string[] {"group1", "group2"}, new string[] {"webpubsub.joinLeaveGroup"}) { Mqtt = new() { UserProperties = new MqttUserProperty[] { new("a", "b") } } },5, HttpStatusCode.OK, "{\"mqtt\":{\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"code\":0,\"userId\":\"userId\",\"groups\":[\"group1\",\"group2\"],\"subprotocol\":\"mqtt\",\"roles\":[\"webpubsub.joinLeaveGroup\"]}"}, + new object[]{new MqttConnectEventErrorResponse(MqttV311ConnectReturnCode.NotAuthorized, "not authorized"),4, HttpStatusCode.Unauthorized, "{\"mqtt\":{\"code\":5,\"reason\":\"not authorized\",\"userProperties\":null}}", }, + new object[]{ CreateMqttConnectErrorResponse(MqttV500ConnectReasonCode.NotAuthorized, "not authorized", new MqttUserProperty[] {new MqttUserProperty("a", "b")}),5, HttpStatusCode.Unauthorized, "{\"mqtt\":{\"code\":135,\"reason\":\"not authorized\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]}}", } + }; + + private static MqttConnectEventErrorResponse CreateMqttConnectErrorResponse(MqttV500ConnectReasonCode reasonCode, string reason, MqttUserProperty[] userProperties) + { + var res = new MqttConnectEventErrorResponse(reasonCode, reason); + res.Mqtt.UserProperties = userProperties; + return res; + } + + [TestCaseSource(nameof(TestHandleMqttConnectRequest_InProcessModelTestData))] + public async Task TestHandleMqttConnectRequest_InProcessModel(WebPubSubEventResponse responseObj, int protocolVersion, HttpStatusCode expectedStatusCode, string expectedResponseBody) + { + var payload = "{\"mqtt\":{\"protocolVersion\":" + protocolVersion.ToString() + ",\"username\":\"username\",\"password\":\"password\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"claims\":{\"iat\":[\"1723005952\"],\"exp\":[\"1726605954\"],\"aud\":[\"ws://localhost:8080/clients/mqtt/hubs/simplechat\"],\"http://schemas.microsoft.com/ws/2008/06/identity/claims/role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier\":[\"user1\"],\"role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"nameid\":[\"user1\"]},\"query\":{\"access_token\":[\"REDATED\"]},\"headers\":{\"Connection\":[\"Upgrade\"],\"Host\":[\"localhost:8080\"],\"Upgrade\":[\"websocket\"],\"Sec-WebSocket-Version\":[\"13\"],\"Sec-WebSocket-Key\":[\"REDATED\"],\"Sec-WebSocket-Extensions\":[\"permessage-deflate; client_max_window_bits\"],\"Sec-WebSocket-Protocol\":[\"mqtt\"]},\"subprotocols\":[\"mqtt\"],\"clientCertificates\":[{\"thumbprint\":\"thumbprint\",\"content\":\"certificate content\"}]}"; + var connectHttpRequest = TestHelpers.CreateHttpRequestMessage(TestHub, WebPubSubEventType.System, "connect", "clientId", ValidSignature, origin: new string[] { TestOrigin }, subProtocols: new string[] { "mqtt" }, clientProtocol: WebPubSubClientProtocol.Mqtt, payload: Encoding.UTF8.GetBytes(payload)); + connectHttpRequest.Headers.Add(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, "physicalConnectionId"); + + var dispatcher = new WebPubSubTriggerDispatcher(NullLogger.Instance, new() { Hub = TestHub }); + var mockExecutor = new Mock(); + var wpsListener = new WebPubSubListener(mockExecutor.Object, Utilities.GetFunctionKey(TestHub, WebPubSubEventType.System, "connect", WebPubSubTriggerAcceptedClientProtocols.Mqtt), dispatcher, null); + await wpsListener.StartAsync(default); + mockExecutor.Setup(f => f.TryExecuteAsync(It.IsAny(), It.IsAny())) + .Callback((functionData, token) => + { + var triggerEvent = functionData.TriggerValue as WebPubSubTriggerEvent; + var mqttConnectEvent = triggerEvent.Request as MqttConnectEventRequest; + Assert.AreEqual("username", mqttConnectEvent.Mqtt.Username); + Assert.AreEqual("password", mqttConnectEvent.Mqtt.Password); + Assert.AreEqual("certificate content", mqttConnectEvent.ClientCertificates.First().Content); + Assert.AreEqual("thumbprint", mqttConnectEvent.ClientCertificates.First().Thumbprint); + Assert.AreEqual("a", mqttConnectEvent.Mqtt.UserProperties.First().Name); + Assert.AreEqual("b", mqttConnectEvent.Mqtt.UserProperties.First().Value); + Assert.AreEqual(protocolVersion, (int)mqttConnectEvent.Mqtt.ProtocolVersion); + var tcs = triggerEvent.TaskCompletionSource; + tcs.SetResult(responseObj); + }) + .Returns(Task.FromResult(new FunctionResult(true))); + var httpResponse = await dispatcher.ExecuteAsync(connectHttpRequest); + Assert.AreEqual(expectedStatusCode, httpResponse.StatusCode); + var actualBody = await httpResponse.Content.ReadAsStringAsync(); + Console.WriteLine(actualBody); + Assert.AreEqual(expectedResponseBody, actualBody); + } + + private static readonly IEnumerable TestHandleMqttConnectRequest_IsolatedProcessModelTestData = new object[][] + { + new object[]{ "{\"mqtt\":{\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"userId\":\"userId\",\"groups\":[\"group1\",\"group2\"],\"subprotocol\":\"mqtt\",\"roles\":[\"webpubsub.joinLeaveGroup\"]}", 5, HttpStatusCode.OK, "{\"mqtt\":{\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"code\":0,\"userId\":\"userId\",\"groups\":[\"group1\",\"group2\"],\"subprotocol\":\"mqtt\",\"roles\":[\"webpubsub.joinLeaveGroup\"]}"}, + new object[]{ "{\"mqtt\":{\"code\":5,\"reason\":\"not authorized\",\"userProperties\":null}}", 4, HttpStatusCode.Unauthorized, "{\"mqtt\":{\"code\":5,\"reason\":\"not authorized\",\"userProperties\":null}}", }, + new object[]{ "{\"mqtt\":{\"code\":135,\"reason\":\"reason\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"errorMessage\":\"reason\"}", 5, HttpStatusCode.Unauthorized, "{\"mqtt\":{\"code\":135,\"reason\":\"reason\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]}}", } + }; + + [TestCaseSource(nameof(TestHandleMqttConnectRequest_IsolatedProcessModelTestData))] + public async Task TestHandleMqttConnectRequest_IsolatedProcessModel(string responseBodyFromWorker, int actualProtocolVersion, HttpStatusCode expectedStatusCode, string expectedHttpResponseBody) + { + var payload = "{\"mqtt\":{\"protocolVersion\":" + actualProtocolVersion.ToString() + ",\"username\":\"username\",\"password\":\"password\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"claims\":{\"iat\":[\"1723005952\"],\"exp\":[\"1726605954\"],\"aud\":[\"ws://localhost:8080/clients/mqtt/hubs/simplechat\"],\"http://schemas.microsoft.com/ws/2008/06/identity/claims/role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier\":[\"user1\"],\"role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"nameid\":[\"user1\"]},\"query\":{\"access_token\":[\"REDATED\"]},\"headers\":{\"Connection\":[\"Upgrade\"],\"Host\":[\"localhost:8080\"],\"Upgrade\":[\"websocket\"],\"Sec-WebSocket-Version\":[\"13\"],\"Sec-WebSocket-Key\":[\"REDATED\"],\"Sec-WebSocket-Extensions\":[\"permessage-deflate; client_max_window_bits\"],\"Sec-WebSocket-Protocol\":[\"mqtt\"]},\"subprotocols\":[\"mqtt\"],\"clientCertificates\":[{\"thumbprint\":\"thumbprint\",\"content\":\"certificate content\"}]}"; + var connectHttpRequest = TestHelpers.CreateHttpRequestMessage(TestHub, WebPubSubEventType.System, "connect", "clientId", ValidSignature, origin: new string[] { TestOrigin }, subProtocols: new string[] { "mqtt" }, clientProtocol: WebPubSubClientProtocol.Mqtt, payload: Encoding.UTF8.GetBytes(payload)); + connectHttpRequest.Headers.Add(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, "physicalConnectionId"); + + var dispatcher = new WebPubSubTriggerDispatcher(NullLogger.Instance, new() { Hub = TestHub }); + var mockExecutor = new Mock(); + var wpsListener = new WebPubSubListener(mockExecutor.Object, Utilities.GetFunctionKey(TestHub, WebPubSubEventType.System, "connect", WebPubSubTriggerAcceptedClientProtocols.Mqtt), dispatcher, null); + await wpsListener.StartAsync(default); + mockExecutor.Setup(f => f.TryExecuteAsync(It.IsAny(), It.IsAny())) + .Callback((functionData, token) => + { + var triggeredEvent = functionData.TriggerValue as WebPubSubTriggerEvent; + var mqttConnectEvent = triggeredEvent.Request as MqttConnectEventRequest; + // Isolated process model uses Newtonsoft.Json to serialize the trigger value. + var serializerSettings = new JsonSerializerSettings + { + Converters = new List + { + new BinaryDataJsonConverter(), + new ConnectionStatesNewtonsoftConverter(), + new WebPubSubDataTypeJsonConverter(), + new WebPubSubEventTypeJsonConverter(), + }, + }; + Console.WriteLine(JsonConvert.SerializeObject(mqttConnectEvent, serializerSettings)); + Assert.AreEqual("{\"mqtt\":{\"protocolVersion\":" + actualProtocolVersion.ToString() + ",\"username\":\"username\",\"password\":\"password\",\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]},\"claims\":{\"iat\":[\"1723005952\"],\"exp\":[\"1726605954\"],\"aud\":[\"ws://localhost:8080/clients/mqtt/hubs/simplechat\"],\"http://schemas.microsoft.com/ws/2008/06/identity/claims/role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier\":[\"user1\"],\"role\":[\"webpubsub.sendToGroup\",\"webpubsub.joinLeaveGroup\"],\"nameid\":[\"user1\"]},\"query\":{\"access_token\":[\"REDATED\"]},\"headers\":{\"Connection\":[\"Upgrade\"],\"Host\":[\"localhost:8080\"],\"Upgrade\":[\"websocket\"],\"Sec-WebSocket-Version\":[\"13\"],\"Sec-WebSocket-Key\":[\"REDATED\"],\"Sec-WebSocket-Extensions\":[\"permessage-deflate; client_max_window_bits\"],\"Sec-WebSocket-Protocol\":[\"mqtt\"]},\"subprotocols\":[\"mqtt\"],\"clientCertificates\":[{\"Thumbprint\":\"thumbprint\",\"content\":\"certificate content\"}],\"connectionContext\":{\"physicalConnectionId\":\"physicalConnectionId\",\"sessionId\":null,\"eventType\":\"System\",\"eventName\":\"connect\",\"hub\":\"testhub\",\"connectionId\":\"clientId\",\"userId\":\"testuser\",\"signature\":\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\",\"origin\":\"localhost\",\"states\":{},\"headers\":{\"ce-hub\":[\"testhub\"],\"ce-type\":[\"azure.webpubsub.sys.connect\"],\"ce-eventName\":[\"connect\"],\"ce-connectionId\":[\"clientId\"],\"ce-signature\":[\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\"],\"WebHook-Request-Origin\":[\"localhost\"],\"ce-userId\":[\"testuser\"],\"ce-subprotocol\":[\"mqtt\"],\"ce-physicalConnectionId\":[\"physicalConnectionId\",\"physicalConnectionId\"]}}}", JsonConvert.SerializeObject(mqttConnectEvent, serializerSettings)); + var tcs = triggeredEvent.TaskCompletionSource; + tcs.SetResult(JsonConvert.DeserializeObject(responseBodyFromWorker)); + }) + .Returns(Task.FromResult(new FunctionResult(true))); + var httpResponse = await dispatcher.ExecuteAsync(connectHttpRequest); + Assert.AreEqual(expectedStatusCode, httpResponse.StatusCode); + var actualBody = await httpResponse.Content.ReadAsStringAsync(); + Console.WriteLine(actualBody); + Assert.AreEqual(expectedHttpResponseBody, actualBody); + } + + [TestCase] + public async Task TestHandleMqttConnectedEvent() + { + var connectedRequest = TestHelpers.CreateHttpRequestMessage(TestHub, WebPubSubEventType.System, "connected", "clientId", ValidSignature, origin: new string[] { TestOrigin }, subProtocols: new string[] { "mqtt" }, clientProtocol: WebPubSubClientProtocol.Mqtt); + connectedRequest.Headers.Add(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, "physicalConnectionId"); + connectedRequest.Headers.Add(Constants.Headers.CloudEvents.MqttSessionId, "sessionId"); + var dispatcher = new WebPubSubTriggerDispatcher(NullLogger.Instance, new() { Hub = TestHub }); + var mockExecutor = new Mock(); + var wpsListener = new WebPubSubListener(mockExecutor.Object, Utilities.GetFunctionKey(TestHub, WebPubSubEventType.System, "connected", WebPubSubTriggerAcceptedClientProtocols.Mqtt), dispatcher, null); + await wpsListener.StartAsync(default); + mockExecutor.Setup(f => f.TryExecuteAsync(It.IsAny(), It.IsAny())) + .Callback((functionData, token) => + { + var triggerEvent = (functionData.TriggerValue as WebPubSubTriggerEvent); + if (triggerEvent.ConnectionContext is MqttConnectionContext mqttContext) + { + Assert.AreEqual("physicalConnectionId", mqttContext.PhysicalConnectionId); + Assert.AreEqual("sessionId", mqttContext.SessionId); + Assert.AreEqual("clientId", mqttContext.ConnectionId); + } + else + { + Assert.Fail("ConnectionContext is not MqttContext"); + } + + var tcs = triggerEvent.TaskCompletionSource; + tcs.SetResult(null); + WebPubSubConfigProvider.RegisterJsonConverter(); + + // Make sure the serialization of MqttConnectedEventRequest is correct, used in isolated-process models. + var expected = "{\"connectionContext\":{\"physicalConnectionId\":\"physicalConnectionId\",\"sessionId\":\"sessionId\",\"eventType\":\"System\",\"eventName\":\"connected\",\"hub\":\"testhub\",\"connectionId\":\"clientId\",\"userId\":\"testuser\",\"signature\":\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\",\"origin\":\"localhost\",\"states\":{},\"headers\":{\"ce-hub\":[\"testhub\"],\"ce-type\":[\"azure.webpubsub.sys.connected\"],\"ce-eventName\":[\"connected\"],\"ce-connectionId\":[\"clientId\"],\"ce-signature\":[\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\"],\"WebHook-Request-Origin\":[\"localhost\"],\"ce-userId\":[\"testuser\"],\"ce-subprotocol\":[\"mqtt\"],\"ce-physicalConnectionId\":[\"physicalConnectionId\",\"physicalConnectionId\"],\"ce-sessionId\":[\"sessionId\",\"sessionId\"]}}}"; + Assert.AreEqual(expected, JsonConvert.SerializeObject(triggerEvent.Request)); + }) + .Returns(Task.FromResult(new FunctionResult(true))); + var httpResponse = await dispatcher.ExecuteAsync(connectedRequest); + } + + [TestCase] + public async Task TestHandleMqttDisonnectedEvent() + { + var body = " {\"mqtt\":{\"initiatedByClient\":false,\"disconnectPacket\":{\"code\":128,\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]}},\"reason\":\"reason\",\"connectionContext\":null}"; + var disconnectedRequest = TestHelpers.CreateHttpRequestMessage(TestHub, WebPubSubEventType.System, "disconnected", "clientId", ValidSignature, origin: new string[] { TestOrigin }, subProtocols: new string[] { "mqtt" }, clientProtocol: WebPubSubClientProtocol.Mqtt, payload: Encoding.UTF8.GetBytes(body)); + disconnectedRequest.Headers.Add(Constants.Headers.CloudEvents.MqttPhysicalConnectionId, "physicalConnectionId"); + disconnectedRequest.Headers.Add(Constants.Headers.CloudEvents.MqttSessionId, "sessionId"); + var dispatcher = new WebPubSubTriggerDispatcher(NullLogger.Instance, new() { Hub = TestHub }); + var mockExecutor = new Mock(); + var wpsListener = new WebPubSubListener(mockExecutor.Object, Utilities.GetFunctionKey(TestHub, WebPubSubEventType.System, "disconnected", WebPubSubTriggerAcceptedClientProtocols.Mqtt), dispatcher, null); + await wpsListener.StartAsync(default); + mockExecutor.Setup(f => f.TryExecuteAsync(It.IsAny(), It.IsAny())) + .Callback((functionData, token) => + { + var triggerEvent = (functionData.TriggerValue as WebPubSubTriggerEvent); + if (triggerEvent.ConnectionContext is MqttConnectionContext mqttContext) + { + Assert.AreEqual("physicalConnectionId", mqttContext.PhysicalConnectionId); + Assert.AreEqual("sessionId", mqttContext.SessionId); + Assert.AreEqual("clientId", mqttContext.ConnectionId); + } + else + { + Assert.Fail("ConnectionContext is not MqttContext"); + } + + Assert.IsInstanceOf(triggerEvent.Request); + var mqttDisconnectedEvent = triggerEvent.Request as MqttDisconnectedEventRequest; + Assert.AreEqual("reason", mqttDisconnectedEvent.Reason); + Assert.AreEqual(false, mqttDisconnectedEvent.Mqtt.InitiatedByClient); + Assert.AreEqual(128, (int)mqttDisconnectedEvent.Mqtt.DisconnectPacket.Code); + Assert.AreEqual("a", mqttDisconnectedEvent.Mqtt.DisconnectPacket.UserProperties.First().Name); + Assert.AreEqual("b", mqttDisconnectedEvent.Mqtt.DisconnectPacket.UserProperties.First().Value); + + var tcs = triggerEvent.TaskCompletionSource; + tcs.SetResult(null); + + // Make sure the serialization of MqttConnectedEventRequest is correct, used in isolated-process models. + WebPubSubConfigProvider.RegisterJsonConverter(); + var expected = "{\"mqtt\":{\"initiatedByClient\":false,\"disconnectPacket\":{\"code\":128,\"userProperties\":[{\"name\":\"a\",\"value\":\"b\"}]}},\"reason\":\"reason\",\"connectionContext\":{\"physicalConnectionId\":\"physicalConnectionId\",\"sessionId\":\"sessionId\",\"eventType\":\"System\",\"eventName\":\"disconnected\",\"hub\":\"testhub\",\"connectionId\":\"clientId\",\"userId\":\"testuser\",\"signature\":\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\",\"origin\":\"localhost\",\"states\":{},\"headers\":{\"ce-hub\":[\"testhub\"],\"ce-type\":[\"azure.webpubsub.sys.disconnected\"],\"ce-eventName\":[\"disconnected\"],\"ce-connectionId\":[\"clientId\"],\"ce-signature\":[\"sha256=7767effcb3946f3e1de039df4b986ef02c110b1469d02c0a06f41b3b727ab561\"],\"WebHook-Request-Origin\":[\"localhost\"],\"ce-userId\":[\"testuser\"],\"ce-subprotocol\":[\"mqtt\"],\"ce-physicalConnectionId\":[\"physicalConnectionId\",\"physicalConnectionId\"],\"ce-sessionId\":[\"sessionId\",\"sessionId\"]}}}"; + Assert.AreEqual(expected, JsonConvert.SerializeObject(triggerEvent.Request)); + }) + .Returns(Task.FromResult(new FunctionResult(true))); + var httpResponse = await dispatcher.ExecuteAsync(disconnectedRequest); + } + + private static WebPubSubTriggerDispatcher SetupDispatcher(string hub = TestHub, WebPubSubEventType type = TestType, string eventName = TestEvent, string connectionString = null, WebPubSubTriggerAcceptedClientProtocols clientProtocol = WebPubSubTriggerAcceptedClientProtocols.All) + { + var funcName = Utilities.GetFunctionKey(hub, type, eventName, clientProtocol).ToLower(); var wpsOptions = new WebPubSubFunctionsOptions { ConnectionString = connectionString diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md index 777a719a7b0b..1090d464ea8b 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History -## 1.0.0-beta.1 (Unreleased) +## 1.0.0-beta.2 (2024-09-02) + +### Features Added + +- Add `UserId` parameter in `SocketIONegotiate` attribute to assign user id to sockets +- Add `userId` binding parameter in `SocketIOTrigger` attribute to get user id of sockets. + +## 1.0.0-beta.1 (2024-09-01) ### Features Added - The initial beta release of Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md index b4586bb97c50..62282acc2788 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/README.md @@ -2,11 +2,11 @@ This extension provides functionality for receiving Web PubSub for Socket.IO webhook calls in Azure Functions, allowing you to easily write functions that respond to any event published to Web PubSub for Socket.IO in serverless mode. -[Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src) | -[Package](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSub) | -[API reference documentation](https://docs.microsoft.com/dotnet/api/microsoft.azure.webjobs.extensions.webpubsub) | +[Source code](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO) | +[Package](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO) | +[API reference documentation](https://learn.microsoft.com/dotnet/api/microsoft.azure.webjobs.extensions.webpubsubforsocketio) | [Product documentation](https://learn.microsoft.com/azure/azure-web-pubsub/socketio-overview) | -[Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSub/samples) +[Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples) ## Getting started @@ -87,7 +87,7 @@ public static class SocketIOBindingFunction [FunctionName("SocketIOInputBinding")] public static IActionResult SocketInputBinding( [HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req, - [SocketIONegotiation(Hub = "hub")] SocketIONegotiationResult result) + [SocketIONegotiation(Hub = "hub", UserId = "uid")] SocketIONegotiationResult result) { return new OkObjectResult(result); } @@ -201,9 +201,9 @@ additional questions or comments. ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Fsearch%2FMicrosoft.Azure.WebJobs.Extensions.WebPubSub%2FREADME.png) -[source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.WebPubSub/src -[package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSub/ -[docs]: https://docs.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.WebPubSub +[source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/search/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src +[package]: https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/ +[docs]: https://docs.microsoft.com/dotnet/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO [nuget]: https://www.nuget.org/ [contrib]: https://github.com/Azure/azure-sdk-for-net/tree/main/CONTRIBUTING.md diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.netstandard2.0.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.netstandard2.0.cs index a33cfc646bd3..cdde5b446aa3 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.netstandard2.0.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/api/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.netstandard2.0.cs @@ -83,6 +83,8 @@ public SocketIONegotiationAttribute() { } public string Connection { get { throw null; } set { } } [Microsoft.Azure.WebJobs.Description.AutoResolveAttribute] public string Hub { get { throw null; } set { } } + [Microsoft.Azure.WebJobs.Description.AutoResolveAttribute] + public string UserId { get { throw null; } set { } } } [Newtonsoft.Json.JsonObjectAttribute(NamingStrategyType=typeof(Newtonsoft.Json.Serialization.CamelCaseNamingStrategy))] public partial class SocketIONegotiationResult diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/README.md b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/README.md new file mode 100644 index 000000000000..6ea67531816c --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/README.md @@ -0,0 +1,8 @@ +# How to run + +```bash +func extensions sync +npm start +``` + +Visit `http://localhost:7084/api/index` to play with the sample. \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json index 72101b17ae22..38e4b3cfabc4 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package-lock.json @@ -12,6 +12,7 @@ }, "devDependencies": { "@types/node": "^20.x", + "copyfiles": "2.4.1", "rimraf": "^5.0.0", "typescript": "^4.0.0" } @@ -112,6 +113,90 @@ "balanced-match": "^1.0.0" } }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -130,6 +215,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, "node_modules/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", @@ -138,6 +229,74 @@ "node": ">= 0.6" } }, + "node_modules/copyfiles": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", + "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", + "dev": true, + "dependencies": { + "glob": "^7.0.5", + "minimatch": "^3.0.3", + "mkdirp": "^1.0.4", + "noms": "0.0.0", + "through2": "^2.0.1", + "untildify": "^4.0.0", + "yargs": "^16.1.0" + }, + "bin": { + "copyfiles": "copyfiles", + "copyup": "copyfiles" + } + }, + "node_modules/copyfiles/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/copyfiles/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/copyfiles/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -164,6 +323,15 @@ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/foreground-child": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", @@ -180,6 +348,21 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, "node_modules/glob": { "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", @@ -200,6 +383,23 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -209,6 +409,12 @@ "node": ">=8" } }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -265,12 +471,52 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/noms": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", + "integrity": "sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "~1.0.31" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/package-json-from-dist": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", "dev": true }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -296,6 +542,33 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/rimraf": { "version": "5.0.9", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.9.tgz", @@ -314,6 +587,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -347,6 +626,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "dev": true + }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -443,6 +728,46 @@ "node": ">=8" } }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", @@ -473,6 +798,21 @@ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -578,6 +918,98 @@ "engines": { "node": ">=8" } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json index afb763d3b435..b7426489b64b 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/package.json @@ -3,7 +3,8 @@ "version": "1.0.0", "description": "", "scripts": { - "build": "tsc", + "copy-public": "copyfiles -a src/public/* dist", + "build": "tsc && npm run copy-public", "watch": "tsc -w", "clean": "rimraf dist", "prestart": "npm run clean && npm run build", @@ -16,7 +17,8 @@ "devDependencies": { "@types/node": "^20.x", "typescript": "^4.0.0", - "rimraf": "^5.0.0" + "rimraf": "^5.0.0", + "copyfiles": "2.4.1" }, "main": "dist/src/{index.js,functions/*.js}" } \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/disconnected.ts b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/disconnected.ts new file mode 100644 index 000000000000..fdc5a1492e7f --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/disconnected.ts @@ -0,0 +1,15 @@ +import { app, InvocationContext, trigger } from "@azure/functions"; + +export async function disconnected(request: any, context: InvocationContext): Promise { + context.log(`SocketIO trigger for disconnected`); +} + +// Trigger for disconnected +app.generic('disconnected', { + trigger: trigger.generic({ + type: 'socketiotrigger', + hub: 'hub', + eventName: 'disconnected' + }), + handler: disconnected +}); diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/index.ts b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/index.ts new file mode 100644 index 000000000000..e6e8dea141cc --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/index.ts @@ -0,0 +1,31 @@ +import { app, HttpRequest, HttpResponseInit, InvocationContext } from "@azure/functions"; + +const fs = require('fs').promises; +const path = require('path') + +export async function index(request: HttpRequest, context: InvocationContext): Promise { + try { + context.log(`Http function processed request for url "${request.url}"`); + + const filePath = path.join(__dirname,'../public/index.html'); + const html = await fs.readFile(filePath); + return { + body: html, + headers: { + 'Content-Type': 'text/html' + } + }; + } catch (error) { + context.log(error); + return { + status: 500, + jsonBody: error + } + } +}; + +app.http('index', { + methods: ['GET', 'POST'], + authLevel: 'anonymous', + handler: index +}); diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/message.ts b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/message.ts index 1fb60ce29395..0233db4252ab 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/message.ts +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/message.ts @@ -5,72 +5,28 @@ const socketio = output.generic({ hub: 'hub', }) -const connStore = new Map(); - -export async function newMessage(request: any, context: InvocationContext): Promise { +export async function chat(request: any, context: InvocationContext): Promise { context.log(`SocketIO trigger for newMessage`); context.extraOutputs.set(socketio, { actionName: 'sendToNamespace', namespace: '/', eventName: 'new message', parameters: [ - { - username: "abc", - message: request.parameters, - } + context.triggerMetadata.userId, + context.triggerMetadata.message ], exceptRooms: [request.socketId], }); } -export async function addUser(request: any, context: InvocationContext): Promise { - context.log(`SocketIO trigger for adduser`); - - context.extraOutputs.set(socketio, [ - { - actionName: 'sendToSocket', - namespace: '/', - socketId: request.socketId, - eventName: 'login', - parameters: [ - { - numUsers: 2, - } - ] - }, - { - actionName: 'sendToNamespace', - namespace: '/', - eventName: 'user joined', - parameters: [ - { - username: "abc", - message: request.parameters, - } - ], - exceptRooms: [request.socketId], - } - ]); -} - // Trigger for new message -app.generic('newMessage', { +app.generic('chat', { trigger: trigger.generic({ type: 'socketiotrigger', hub: 'hub', - eventName: 'new message' + eventName: 'chat', + parameterNames: ['message'], }), extraOutputs: [socketio], - handler: newMessage + handler: chat }); - -// Trigger for add user -app.generic('addUser', { - trigger: trigger.generic({ - type: 'socketiotrigger', - hub: 'hub', - eventName: 'add user' - }), - extraOutputs: [socketio], - handler: addUser -}); \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/negotiate.ts b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/negotiate.ts index df9888652d97..d20ca8bbc3a4 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/negotiate.ts +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/functions/negotiate.ts @@ -5,6 +5,7 @@ const socketIONegotiate = input.generic({ direction: 'in', name: 'result', hub: 'hub', + userId: '{query.userId}' }); export async function negotiate(request: HttpRequest, context: InvocationContext): Promise { diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/public/index.html b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/public/index.html new file mode 100644 index 000000000000..7e4b05fb4077 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev-JavaScript/src/public/index.html @@ -0,0 +1,242 @@ + + + + + + + + Group Chat + + + + + + + + + + + + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/Function.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/Function.cs index 901abfbbe79d..2cae25923e2b 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/Function.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/Function.cs @@ -1,57 +1,48 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; -using System.IO; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Extensions.Http; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Logging; using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO; -using Microsoft.IdentityModel.Tokens; -using Microsoft.Azure.WebPubSub.Common; using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; -using System.Linq; -using System.Threading; -using System.Collections.Concurrent; +using Microsoft.Extensions.Logging; +using System.IO; +using System.Threading.Tasks; +using ExecutionContext = Microsoft.Azure.WebJobs.ExecutionContext; namespace SampleDev { public static class Function { - private static int _numUsers = 0; - private static ConcurrentDictionary _store = new(); - - [FunctionName("OutboundBinding")] - public static async Task OutboundBinding( - [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req, - [SocketIO(Hub = "hub")] IAsyncCollector operation, - ILogger log) + [FunctionName("index")] + public static IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous)] HttpRequest req, ExecutionContext context, ILogger log) { - log.LogInformation($"C# HTTP trigger function processed a request. {Base64UrlEncoder.Encode("abc")}"); - string userName = Guid.NewGuid().ToString(); - await operation.AddAsync(SocketIOAction.CreateSendToNamespaceAction("new message", new[] { new { username = userName, - message = "Hello" } })); - log.LogInformation("Send to namespace finished."); - return new OkObjectResult("ok"); + var indexFile = Path.Combine(context.FunctionAppDirectory, "public/index.html"); + log.LogInformation($"index.html path: {indexFile}."); + return new ContentResult + { + Content = File.ReadAllText(indexFile), + ContentType = "text/html", + }; } [FunctionName("Negotiate")] - public static async Task SocketIONegotiate( + public static IActionResult SocketIONegotiate( [HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req, - [SocketIONegotiation(Hub = "hub")] SocketIONegotiationResult result) + [SocketIONegotiation(Hub = "hub", UserId = "{query.userId}")] SocketIONegotiationResult result) { return new OkObjectResult(result); } [FunctionName("TriggerBindingForConnect")] - public static async Task TriggerBindingForConnect( + public static SocketIOEventHandlerResponse TriggerBindingForConnect( [SocketIOTrigger("hub", "connect")] SocketIOConnectRequest request, + string userId, ILogger log) { - log.LogInformation("Running trigger for: connect"); + log.LogInformation($"Running trigger for: connect for {userId}"); return new SocketIOConnectResponse(); } @@ -59,71 +50,37 @@ public static async Task TriggerBindingForConnect( public static async Task TriggerBindingForConnected( [SocketIOTrigger("hub", "connected")] SocketIOConnectedRequest request, [SocketIO(Hub = "hub")] IAsyncCollector collector, + string userId, ILogger log) { log.LogInformation("Running trigger for: connected"); - if (_store.TryAdd(request.SocketId, new SocketContext())) - { - Interlocked.Increment(ref _numUsers); - } + await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("new message", new[] { "system", $"{userId} connected" })); } [FunctionName("TriggerBindingForDisconnected")] public static async Task TriggerBindingForDisconnected( [SocketIOTrigger("hub", "disconnected")] SocketIODisconnectedRequest request, [SocketIO(Hub = "hub")] IAsyncCollector collector, + string userId, ILogger log) { log.LogInformation("Running trigger for: disconnected"); - if (_store.TryRemove(request.SocketId, out var context)) - { - await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("user left", new[] { new { username = context.UserName, numUsers = Interlocked.Decrement(ref _numUsers)} }, new[] {request.SocketId})); - } + await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("new message", new[] { "system", $"{userId} disconnected" })); } - [FunctionName("TriggerBindingForNewMessage")] - public static async Task TriggerBindingForNewMessage( - [SocketIOTrigger("hub", "new message")] SocketIOMessageRequest request, + [FunctionName("TriggerBindingForChat")] + public static async Task TriggerBindingForChat( + [SocketIOTrigger("hub", "chat")] SocketIOMessageRequest request, [SocketIO(Hub = "hub")] IAsyncCollector collector, + SocketIOSocketContext connectionContext, + [SocketIOParameter] string message, ILogger log) { log.LogInformation("Running trigger for: new message"); log.LogInformation($"Arguments: {string.Join(';', request.Parameters)}"); - if (_store.TryGetValue(request.SocketId, out var context)) - { - await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("new message", new[] { new { username = context.UserName, message = request.Parameters } }, new[] { request.SocketId })); - } - } - - [FunctionName("TriggerBindingForAddUser")] - public static async Task TriggerBindingForAddUser( - [SocketIOTrigger("hub", "add user")] SocketIOMessageRequest request, - [SocketIO(Hub = "hub")] IAsyncCollector collector, - ILogger log) - { - log.LogInformation("Running trigger for: add user"); - log.LogInformation($"Arguments: {string.Join(';', request.Parameters)}"); - - var userName = request.Parameters[0].ToString(); - if (_store.TryGetValue(request.SocketId, out var context)) - { - if (context.AddedUser) - { - return; - } - context.AddedUser = true; - context.UserName = userName; - - await collector.AddAsync(SocketIOAction.CreateSendToSocketAction(request.SocketId, "login", new[] { new { numUsers = _numUsers } })); - await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("user joined", new[] { new { username = userName, numUsers = _numUsers } }, new[] { request.SocketId })); - } - } - - private class SocketContext - { - public bool AddedUser { get; set; } - public string UserName { get; set; } + var userId = connectionContext.UserId; + await collector.AddAsync(SocketIOAction.CreateSendToNamespaceAction("new message", new[] { userId, message }, new[] { request.SocketId })); } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/SampleDev.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/SampleDev.csproj index 801736ac7514..c5524b071645 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/SampleDev.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/SampleDev.csproj @@ -19,5 +19,11 @@ PreserveNewest Never + + Always + + + + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/public/index.html b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/public/index.html new file mode 100644 index 000000000000..7e4b05fb4077 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/samples/SampleDev/public/index.html @@ -0,0 +1,242 @@ + + + + + + + + Group Chat + + + + + + + + + + + + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Config/WebPubSubForSocketIOConfigProvider.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Config/WebPubSubForSocketIOConfigProvider.cs index 492e732c8554..a1aa02692039 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Config/WebPubSubForSocketIOConfigProvider.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Config/WebPubSubForSocketIOConfigProvider.cs @@ -188,7 +188,7 @@ private IAsyncCollector CreateCollector(SocketIOAttribute attrib private SocketIONegotiationResult GetNegotiationResult(SocketIONegotiationAttribute attribute) { var service = GetService(attribute.Connection, attribute.Hub); - return service.GetNegotiationResult(); + return service.GetNegotiationResult(attribute.UserId); } private void ValidateConnectionString(string attributeConnectionString, string attributeConnectionStringName) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj index 39bb0dc41b2a..c3764b01d4e7 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.csproj @@ -1,11 +1,11 @@ - + $(RequiredTargetFrameworks) Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO Azure, WebPubSub Azure Functions extension for the WebPubSub for Socket.IO - 1.0.0-beta.1 + 1.0.0-beta.2 $(NoWarn);AZC0001;CS8632;CA1056;CA2227 true true diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Services/WebPubSubForSocketIOService.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Services/WebPubSubForSocketIOService.cs index b57b57377afe..333e5828bfc2 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Services/WebPubSubForSocketIOService.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Services/WebPubSubForSocketIOService.cs @@ -41,12 +41,12 @@ public WebPubSubForSocketIOService(WebPubSubServiceClient client) public WebPubSubServiceClient Client => _client; - internal SocketIONegotiationResult GetNegotiationResult() + internal SocketIONegotiationResult GetNegotiationResult(string userId) { if (_useConnectionStrings) { var expireAfter = TimeSpan.FromHours(1); - var token = GenerateTokenFromAzureKeyCredential(DateTimeOffset.UtcNow.Add(expireAfter)); + var token = GenerateTokenFromAzureKeyCredential(userId, DateTimeOffset.UtcNow.Add(expireAfter)); return new SocketIONegotiationResult(new Uri($"{_endpoint}clients/socketio/hubs/{_hub}?access_token={token}")); } else @@ -57,7 +57,7 @@ internal SocketIONegotiationResult GetNegotiationResult() } } - private string GenerateTokenFromAzureKeyCredential(DateTimeOffset expiresAt) + private string GenerateTokenFromAzureKeyCredential(string userId, DateTimeOffset expiresAt) { var keyBytes = Encoding.UTF8.GetBytes(_keyCredential.Key); @@ -76,6 +76,11 @@ private string GenerateTokenFromAzureKeyCredential(DateTimeOffset expiresAt) jwt.AddClaim(JwtBuilder.Iat, now); jwt.AddClaim(JwtBuilder.Aud, audience); + if (!string.IsNullOrEmpty(userId)) + { + jwt.AddClaim(JwtBuilder.Sub, userId); + } + return jwt.BuildString(); } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/SocketIONegotiationAttribute.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/SocketIONegotiationAttribute.cs index c39bc5fed73e..86d1f7a65507 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/SocketIONegotiationAttribute.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/SocketIONegotiationAttribute.cs @@ -1,9 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using System; - using Microsoft.Azure.WebJobs.Description; +using System; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO { @@ -24,5 +23,11 @@ public class SocketIONegotiationAttribute : Attribute /// [AutoResolve] public string Hub { get; set; } + + /// + /// The user id of the connection. It will be available for all sockets sharing the same connection. + /// + [AutoResolve] + public string UserId { get; set; } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/SocketIOSocketContext.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/SocketIOSocketContext.cs index 1b4861104b53..7948877a4005 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/SocketIOSocketContext.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/SocketIOSocketContext.cs @@ -2,9 +2,7 @@ // Licensed under the MIT License. using Microsoft.Azure.WebPubSub.Common; -using System; using System.Collections.Generic; -using System.Text; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO { @@ -23,14 +21,10 @@ public class SocketIOSocketContext : WebPubSubConnectionContext /// public string Namespace { get; } - private new string UserId { get; } - - private new IReadOnlyDictionary States { get; } - /// /// Initializes a new instance of the SocketIOSocketContext class. /// - internal SocketIOSocketContext(WebPubSubEventType eventType, string eventName, string hub, string connectionId, string ns, string socketId, string signature, string origin, IReadOnlyDictionary headers) : base(eventType, eventName, hub, connectionId, null, signature, origin, (IReadOnlyDictionary)null, headers) + internal SocketIOSocketContext(WebPubSubEventType eventType, string eventName, string hub, string connectionId, string userId, string ns, string socketId, string signature, string origin, IReadOnlyDictionary headers) : base(eventType, eventName, hub, connectionId, userId, signature, origin, (IReadOnlyDictionary)null, headers) { SocketId = socketId; Namespace = ns; diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerBinding.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerBinding.cs index edd3f1453d72..312ab5af0e9c 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerBinding.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerBinding.cs @@ -1,9 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; +using Microsoft.Azure.WebJobs.Host.Bindings; +using Microsoft.Azure.WebJobs.Host.Listeners; +using Microsoft.Azure.WebJobs.Host.Protocols; +using Microsoft.Azure.WebJobs.Host.Triggers; +using Microsoft.Azure.WebPubSub.Common; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; -using System.Data.Common; using System.Globalization; using System.IO; using System.Linq; @@ -11,13 +17,6 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; -using Microsoft.Azure.WebJobs.Host.Bindings; -using Microsoft.Azure.WebJobs.Host.Listeners; -using Microsoft.Azure.WebJobs.Host.Protocols; -using Microsoft.Azure.WebJobs.Host.Triggers; -using Microsoft.Azure.WebPubSub.Common; -using Newtonsoft.Json.Linq; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO { @@ -33,6 +32,7 @@ internal class WebPubSubForSocketIOTriggerBinding : ITriggerBinding internal const string ClientCertificatesBindingName = "ClientCertificates"; internal const string SocketIdBindingName = "SocketId"; internal const string NamespaceBindingName = "Namespace"; + internal const string UserIdName = "UserId"; private readonly ParameterInfo _parameterInfo; private readonly SocketIOTriggerAttribute _attribute; @@ -120,6 +120,10 @@ private static void AddBindingData(Dictionary bindingData, Socke bindingData.Add(ConnectionContextBindingName, triggerEvent.ConnectionContext); bindingData.Add(SocketIdBindingName, triggerEvent.Request.SocketId); bindingData.Add(NamespaceBindingName, triggerEvent.Request.Namespace); + if (!string.IsNullOrEmpty(triggerEvent.ConnectionContext.UserId)) + { + bindingData.Add(UserIdName, triggerEvent.ConnectionContext.UserId); + } if (triggerEvent.Request is SocketIOConnectRequest connectEventRequest) { @@ -192,6 +196,7 @@ private static IReadOnlyDictionary CreateBindingContract(SocketIOT SafeAddContract(() => contract.Add(ClientCertificatesBindingName, typeof(WebPubSubClientCertificate[]))); SafeAddContract(() => contract.Add(SocketIdBindingName, typeof(string))); SafeAddContract(() => contract.Add(NamespaceBindingName, typeof(string))); + SafeAddContract(() => contract.Add(UserIdName, typeof(string))); return contract; } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerDispatcher.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerDispatcher.cs index 1ff7eab11b1a..eb33fe631d3a 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerDispatcher.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/src/Trigger/WebPubSubForSocketIOTriggerDispatcher.cs @@ -1,6 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; +using Microsoft.Azure.WebJobs.Host.Executors; +using Microsoft.Azure.WebPubSub.Common; +using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.IO; @@ -10,10 +14,6 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; -using Microsoft.Azure.WebJobs.Host.Executors; -using Microsoft.Azure.WebPubSub.Common; -using Microsoft.Extensions.Logging; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO { @@ -196,12 +196,17 @@ private static (bool Success, string Error) TryParseCloudEvents(HttpRequestMessa { signature = string.Join(",", val); } + string? userId = null; + if (request.Headers.TryGetValues(Constants.Headers.CloudEvents.UserId, out var userIds)) + { + userId = userIds.FirstOrDefault(); + } string @namespace = request.Headers.GetValues(Constants.Headers.CloudEvents.Namespace).Single(); ThrowIfEmptyHeader(@namespace, Constants.Headers.CloudEvents.Namespace); string socketId = request.Headers.GetValues(Constants.Headers.CloudEvents.SocketId).Single(); ThrowIfEmptyHeader(socketId, Constants.Headers.CloudEvents.SocketId); - context = new SocketIOSocketContext(eventType, eventName, hub, connectionId, @namespace, socketId, signature, origin, headers); + context = new SocketIOSocketContext(eventType, eventName, hub, connectionId, userId, @namespace, socketId, signature, origin, headers); return (true, null); } catch (Exception ex) diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/JobHostEndToEndTests.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/JobHostEndToEndTests.cs index 574d58baca3f..b191ff9c7d20 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/JobHostEndToEndTests.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/JobHostEndToEndTests.cs @@ -1,15 +1,15 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; using Microsoft.Azure.WebJobs.Host; -using Microsoft.Azure.WebJobs.Host.Indexers; using Microsoft.Azure.WebPubSub.Common; using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; +using System.Threading.Tasks; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests { @@ -117,12 +117,13 @@ public void TestSocketIOTrigger_InvalidParam() Assert.AreEqual("Exception while executing function: SocketIOFuncs.TestSocketIOTriggerWith3Param", exception.Message); } - [TestCase] - public async Task TestSocketIOInputBinding() + [TestCase("SocketIOFuncs.TestSocketIOInputConnection")] + [TestCase("SocketIOFuncs.TestSocketIOInputConnectionWithUserId")] + public async Task TestSocketIOInputBinding(string function) { var host = TestHelpers.NewHost(typeof(SocketIOFuncs), configuration: KeyBasedConfiguration); - await host.GetJobHost().CallAsync("SocketIOFuncs.TestSocketIOInputConnection"); + await host.GetJobHost().CallAsync(function); } [TestCase] @@ -173,7 +174,7 @@ private static SocketIOTriggerEvent CreateTestMessageTriggerEvent() private static SocketIOSocketContext CreateConnectionContext() { - return new SocketIOSocketContext(WebPubSubEventType.User, "message", "testhub", "000000", "/ns", "sid", "sig", "origin", null); + return new SocketIOSocketContext(WebPubSubEventType.User, "message", "testhub", "000000", "uid", "/ns", "sid", "sig", "origin", null); } private sealed class SocketIOFuncs @@ -184,10 +185,11 @@ public static void TestSocketIOTrigger( { // Valid case use default url for verification. Assert.AreEqual(TestContext, connectionContext); + Assert.AreEqual("uid", connectionContext.UserId); } public static void TestSocketIOTriggerWith2Param( - [SocketIOTrigger("chat", "msgEvent", parameterNames: new[] {"arg1", "arg2"})] SocketIOMessageRequest request, + [SocketIOTrigger("chat", "msgEvent", parameterNames: new[] { "arg1", "arg2" })] SocketIOMessageRequest request, SocketIOSocketContext connectionContext, string arg1, string arg2) @@ -197,6 +199,7 @@ public static void TestSocketIOTriggerWith2Param( Assert.AreEqual("msgEvent", request.EventName); Assert.AreEqual("d1", arg1); Assert.AreEqual("d2", arg2); + Assert.AreEqual("uid", connectionContext.UserId); } public static void TestSocketIOTriggerWith3Param( @@ -211,6 +214,7 @@ public static void TestSocketIOTriggerWith3Param( Assert.AreEqual("msgEvent", request.EventName); Assert.AreEqual("d1", arg1); Assert.AreEqual("d2", arg2); + Assert.AreEqual("uid", connectionContext.UserId); } public static void TestSocketIOTriggerWith2ParamAndParameterAttr( @@ -224,6 +228,7 @@ public static void TestSocketIOTriggerWith2ParamAndParameterAttr( Assert.AreEqual("msgEvent", request.EventName); Assert.AreEqual("d1", arg2); Assert.AreEqual("d2", arg1); + Assert.AreEqual("uid", connectionContext.UserId); } public static void TestSocketIOTriggerInvalid( @@ -238,6 +243,15 @@ public static void TestSocketIOInputConnection( Assert.AreEqual("https://abc/", connection.Endpoint.AbsoluteUri); } + public static void TestSocketIOInputConnectionWithUserId( + [SocketIONegotiation(Hub = "chat", UserId = "uid")] SocketIONegotiationResult connection) + { + // Valid case use default url for verification. + Assert.AreEqual("https://abc/", connection.Endpoint.AbsoluteUri); + var jwt = new JwtSecurityTokenHandler().ReadJwtToken(connection.Token); + Assert.AreEqual("uid", jwt.Subject); + } + public static async Task TestSocketIOOutput( [SocketIO(Hub = "chat")] IAsyncCollector operation) { diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests.csproj b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests.csproj index b0594b499373..8c2e266f6b56 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests.csproj @@ -10,10 +10,6 @@ - - - - @@ -24,6 +20,7 @@ + diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Samples/SocketIOBindingFunction.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Samples/SocketIOBindingFunction.cs index 4f1b019fe55f..f98edc4d84ed 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Samples/SocketIOBindingFunction.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/Samples/SocketIOBindingFunction.cs @@ -4,11 +4,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.WebJobs.Extensions.Http; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests.Samples { @@ -18,7 +13,7 @@ public static class SocketIOBindingFunction [FunctionName("SocketIOInputBinding")] public static IActionResult SocketInputBinding( [HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req, - [SocketIONegotiation(Hub = "hub")] SocketIONegotiationResult result) + [SocketIONegotiation(Hub = "hub", UserId = "uid")] SocketIONegotiationResult result) { return new OkObjectResult(result); } diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOServiceTests.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOServiceTests.cs index 7a0d5452cb99..5f2cbde9c4b3 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOServiceTests.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOServiceTests.cs @@ -1,10 +1,10 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -using Azure.Core; using Azure.Identity; using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Config; using NUnit.Framework; +using System.IdentityModel.Tokens.Jwt; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests { @@ -13,9 +13,10 @@ public class SocketIOServiceTests private const string NormConnectionString = "Endpoint=http://localhost;Port=8080;AccessKey=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGH;Version=1.0;"; private const string SecConnectionString = "Endpoint=https://abc;AccessKey=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGH;Version=1.0;"; - [TestCase(NormConnectionString, "http://localhost:8080/", "/clients/socketio/hubs/testHub")] - [TestCase(SecConnectionString, "https://abc/", "/clients/socketio/hubs/testHub")] - public void TestWebPubSubConnection_Scheme(string connectionString, string expectedEndpoint, string expectedPath) + [TestCase(NormConnectionString, "http://localhost:8080/", "/clients/socketio/hubs/testHub", null)] + [TestCase(NormConnectionString, "http://localhost:8080/", "/clients/socketio/hubs/testHub", "uid")] + [TestCase(SecConnectionString, "https://abc/", "/clients/socketio/hubs/testHub", "uid")] + public void TestWebPubSubConnection_Scheme(string connectionString, string expectedEndpoint, string expectedPath, string userId) { var connectionInfo = new SocketIOConnectionInfo(connectionString); @@ -26,12 +27,23 @@ public void TestWebPubSubConnection_Scheme(string connectionString, string expec var service = new WebPubSubForSocketIOService(connectionInfo.Endpoint, connectionInfo.KeyCredential, "testHub"); - var clientConnection = service.GetNegotiationResult(); + var clientConnection = service.GetNegotiationResult(userId); Assert.NotNull(clientConnection); Assert.AreEqual(expectedEndpoint, clientConnection.Endpoint.AbsoluteUri); Assert.AreEqual(expectedPath, clientConnection.Path); Assert.NotNull(clientConnection.Token); + + var jwt = new JwtSecurityTokenHandler().ReadJwtToken(clientConnection.Token); + + if (string.IsNullOrEmpty(userId)) + { + Assert.IsNull(jwt.Subject); + } + else + { + Assert.AreEqual(userId, jwt.Subject); + } } [TestCase] diff --git a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOTriggerBindingTests.cs b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOTriggerBindingTests.cs index 968c5de03fc7..413f7af3c9e0 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOTriggerBindingTests.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO/tests/SocketIOTriggerBindingTests.cs @@ -1,12 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Threading; -using System.Threading.Tasks; using Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Trigger.Model; using Microsoft.Azure.WebJobs.Host.Triggers; using Microsoft.Azure.WebPubSub.Common; @@ -14,6 +8,12 @@ using Moq; using Newtonsoft.Json.Linq; using NUnit.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; using static Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.WebPubSubForSocketIOTriggerBinding; namespace Microsoft.Azure.WebJobs.Extensions.WebPubSubForSocketIO.Tests @@ -36,7 +36,7 @@ public SocketIOTriggerBindingTests() _provider = new WebPubSubForSocketIOTriggerBindingProvider(mockDispater.Object, resolver, config, null); } - public static void ConnectObj([SocketIOTrigger("testchat","connect")] JObject req) { } + public static void ConnectObj([SocketIOTrigger("testchat", "connect")] JObject req) { } public static void Connect([SocketIOTrigger("testchat", "connect")] SocketIOConnectRequest req, string @namespace, @@ -45,7 +45,7 @@ public static void Connect([SocketIOTrigger("testchat", "connect")] SocketIOConn IDictionary query, IDictionary headers, WebPubSubClientCertificate[] clinetCertificates) - {} + { } public static void ConnectedObj([SocketIOTrigger("testchat", "connected")] JObject req) { } @@ -61,13 +61,13 @@ public static void Disconnect([SocketIOTrigger("testchat", "disconnected")] Sock string @namespace, string socketId, string reason) - {} + { } public static void MessageObj([SocketIOTrigger("testchat", "target")] JObject req) { } public static void Message([SocketIOTrigger("testchat", "target")] SocketIOMessageRequest req, - [SocketIOParameter]string paramKey1, - [SocketIOParameter]int paramKey2) + [SocketIOParameter] string paramKey1, + [SocketIOParameter] int paramKey2) { } [TestCase] @@ -79,7 +79,7 @@ public async Task TriggerConnectEventTest() var triggerEvent = new SocketIOTriggerEvent { - ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "connect", "testchat", "conn1", "ns", "sid", "signature", "origin", null), + ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "connect", "testchat", "conn1", "uid", "ns", "sid", "signature", "origin", null), Request = new SocketIOConnectRequest( "ns", "sid", @@ -118,7 +118,7 @@ public async Task TriggerConnectedEventTest() var triggerEvent = new SocketIOTriggerEvent { - ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "connected", "testchat", "conn1", "ns", "sid", "signature", "origin", null), + ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "connected", "testchat", "conn1", "uid", "ns", "sid", "signature", "origin", null), Request = new SocketIOConnectedRequest("ns", "sid") }; @@ -146,7 +146,7 @@ public async Task TriggerDisconnectEventTest() var triggerEvent = new SocketIOTriggerEvent { - ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "disconnect", "testchat", "conn1", "ns", "sid", "signature", "origin", null), + ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.System, "disconnect", "testchat", "conn1", "uid", "ns", "sid", "signature", "origin", null), Request = new SocketIODisconnectedRequest("ns", "sid", "reason") }; @@ -175,7 +175,7 @@ public async Task TriggerMessageEventTest() var triggerEvent = new SocketIOTriggerEvent { - ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.User, "target", "testchat", "conn1", "ns", "sid", "signature", "origin", null), + ConnectionContext = new SocketIOSocketContext(WebPubSubEventType.User, "target", "testchat", "conn1", "uid", "ns", "sid", "signature", "origin", null), Request = new SocketIOMessageRequest("ns", "sid", "payload", "ev", new object[] { "param1", 2 }) }; @@ -244,7 +244,7 @@ private static ParameterInfo GetParameterOrFirst(Type type, string methodName, s private static SocketIOTriggerEvent NewTestEvent() { - var sioContext = new SocketIOSocketContext(WebPubSubEventType.User, "message", "testhub", "conn1", "ns", "sid", "signature", "origin", null); + var sioContext = new SocketIOSocketContext(WebPubSubEventType.User, "message", "testhub", "conn1", "uid", "ns", "sid", "signature", "origin", null); return new SocketIOTriggerEvent { ConnectionContext = sioContext, @@ -253,7 +253,7 @@ private static SocketIOTriggerEvent NewTestEvent() "socketId", "payload", "ev", - new[] { "arg1", "arg2"}), + new[] { "arg1", "arg2" }), }; } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/CHANGELOG.md b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/CHANGELOG.md index 52e001fdd848..b13c6aab7809 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/CHANGELOG.md +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/CHANGELOG.md @@ -1,14 +1,10 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.3.0 (2024-09-04) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Support MQTT event handlers. +- Add `Content` field in `WebPubSubClientCertificate` to carry over client certificate content. ## 1.2.0 (2022-10-31) diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/api/Microsoft.Azure.WebPubSub.Common.netstandard2.0.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/api/Microsoft.Azure.WebPubSub.Common.netstandard2.0.cs index 9b048dcab47a..0014d59c36c6 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/api/Microsoft.Azure.WebPubSub.Common.netstandard2.0.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/api/Microsoft.Azure.WebPubSub.Common.netstandard2.0.cs @@ -1,11 +1,11 @@ namespace Microsoft.Azure.WebPubSub.Common { - public sealed partial class ConnectedEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest + public partial class ConnectedEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest { public ConnectedEventRequest(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext context) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext)) { } } [System.Runtime.Serialization.DataContractAttribute] - public sealed partial class ConnectEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest + public partial class ConnectEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest { public ConnectEventRequest(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext context, System.Collections.Generic.IReadOnlyDictionary claims, System.Collections.Generic.IReadOnlyDictionary query, System.Collections.Generic.IEnumerable subprotocols, System.Collections.Generic.IEnumerable certificates) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext)) { } public ConnectEventRequest(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext context, System.Collections.Generic.IReadOnlyDictionary claims, System.Collections.Generic.IReadOnlyDictionary query, System.Collections.Generic.IEnumerable subprotocols, System.Collections.Generic.IEnumerable certificates, System.Collections.Generic.IReadOnlyDictionary headers) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext)) { } @@ -24,7 +24,7 @@ public ConnectEventRequest(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionC [System.Runtime.Serialization.DataMemberAttribute(Name="subprotocols")] [System.Text.Json.Serialization.JsonPropertyNameAttribute("subprotocols")] public System.Collections.Generic.IReadOnlyList Subprotocols { get { throw null; } } - public Microsoft.Azure.WebPubSub.Common.EventErrorResponse CreateErrorResponse(Microsoft.Azure.WebPubSub.Common.WebPubSubErrorCode code, string message) { throw null; } + public virtual Microsoft.Azure.WebPubSub.Common.EventErrorResponse CreateErrorResponse(Microsoft.Azure.WebPubSub.Common.WebPubSubErrorCode code, string message) { throw null; } public Microsoft.Azure.WebPubSub.Common.ConnectEventResponse CreateResponse(string userId, System.Collections.Generic.IEnumerable groups, string subprotocol, System.Collections.Generic.IEnumerable roles) { throw null; } } [System.Runtime.Serialization.DataContractAttribute] @@ -55,7 +55,7 @@ public void SetState(string key, System.BinaryData value) { } public void SetState(string key, object value) { } } [System.Runtime.Serialization.DataContractAttribute] - public sealed partial class DisconnectedEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest + public partial class DisconnectedEventRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest { public DisconnectedEventRequest(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext context, string reason) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext)) { } [System.Runtime.Serialization.DataMemberAttribute(Name="reason")] @@ -77,6 +77,210 @@ public EventErrorResponse(Microsoft.Azure.WebPubSub.Common.WebPubSubErrorCode co public string ErrorMessage { get { throw null; } set { } } } [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectEventErrorResponse : Microsoft.Azure.WebPubSub.Common.EventErrorResponse + { + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public MqttConnectEventErrorResponse(Microsoft.Azure.WebPubSub.Common.MqttConnectEventErrorResponseProperties mqtt) { } + public MqttConnectEventErrorResponse(Microsoft.Azure.WebPubSub.Common.MqttV311ConnectReturnCode code, string? reason) { } + public MqttConnectEventErrorResponse(Microsoft.Azure.WebPubSub.Common.MqttV500ConnectReasonCode code, string? reason) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="mqtt")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("mqtt")] + public Microsoft.Azure.WebPubSub.Common.MqttConnectEventErrorResponseProperties Mqtt { get { throw null; } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectEventErrorResponseProperties + { + public MqttConnectEventErrorResponseProperties(Microsoft.Azure.WebPubSub.Common.MqttV311ConnectReturnCode code) { } + public MqttConnectEventErrorResponseProperties(Microsoft.Azure.WebPubSub.Common.MqttV500ConnectReasonCode code) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="code")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("code")] + public int Code { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="reason")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("reason")] + public string? Reason { get { throw null; } set { } } + [System.Runtime.Serialization.DataMemberAttribute(Name="userProperties")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("userProperties")] + public System.Collections.Generic.IReadOnlyList? UserProperties { get { throw null; } set { } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectEventRequest : Microsoft.Azure.WebPubSub.Common.ConnectEventRequest + { + public MqttConnectEventRequest(Microsoft.Azure.WebPubSub.Common.MqttConnectionContext context, System.Collections.Generic.IReadOnlyDictionary claims, System.Collections.Generic.IReadOnlyDictionary query, System.Collections.Generic.IEnumerable certificates, System.Collections.Generic.IReadOnlyDictionary headers, Microsoft.Azure.WebPubSub.Common.MqttConnectProperties mqtt) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext), default(System.Collections.Generic.IReadOnlyDictionary), default(System.Collections.Generic.IReadOnlyDictionary), default(System.Collections.Generic.IEnumerable), default(System.Collections.Generic.IEnumerable)) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="mqtt")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("mqtt")] + public Microsoft.Azure.WebPubSub.Common.MqttConnectProperties Mqtt { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override Microsoft.Azure.WebPubSub.Common.EventErrorResponse CreateErrorResponse(Microsoft.Azure.WebPubSub.Common.WebPubSubErrorCode code, string? message = null) { throw null; } + public Microsoft.Azure.WebPubSub.Common.MqttConnectEventResponse CreateMqttResponse(string userId, System.Collections.Generic.IEnumerable groups, System.Collections.Generic.IEnumerable roles) { throw null; } + public Microsoft.Azure.WebPubSub.Common.MqttConnectEventErrorResponse CreateMqttV311ErrorResponse(Microsoft.Azure.WebPubSub.Common.MqttV311ConnectReturnCode code, string? message = null) { throw null; } + public Microsoft.Azure.WebPubSub.Common.MqttConnectEventErrorResponse CreateMqttV50ErrorResponse(Microsoft.Azure.WebPubSub.Common.MqttV500ConnectReasonCode code, string? message = null) { throw null; } + } + [System.Runtime.Serialization.DataContractAttribute] + public sealed partial class MqttConnectEventResponse : Microsoft.Azure.WebPubSub.Common.ConnectEventResponse + { + public MqttConnectEventResponse() { } + public MqttConnectEventResponse(string? userId, System.Collections.Generic.IEnumerable? groups, System.Collections.Generic.IEnumerable? roles) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="mqtt")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("mqtt")] + public Microsoft.Azure.WebPubSub.Common.MqttConnectEventResponseProperties? Mqtt { get { throw null; } set { } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectEventResponseProperties + { + public MqttConnectEventResponseProperties() { } + [System.Runtime.Serialization.DataMemberAttribute(Name="userProperties")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("userProperties")] + public System.Collections.Generic.IReadOnlyList? UserProperties { get { throw null; } set { } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectionContext : Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext + { + public MqttConnectionContext(Microsoft.Azure.WebPubSub.Common.WebPubSubEventType eventType, string eventName, string hub, string connectionId, string physicalConnectionId, string? sessionId, string? userId = null, string? signature = null, string? origin = null, System.Collections.Generic.IReadOnlyDictionary? connectionStates = null, System.Collections.Generic.IReadOnlyDictionary? headers = null) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubEventType), default(string), default(string), default(string), default(string), default(string), default(string), default(System.Collections.Generic.IReadOnlyDictionary), default(System.Collections.Generic.IReadOnlyDictionary)) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="physicalConnectionId")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("physicalConnectionId")] + public string PhysicalConnectionId { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="sessionId")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("sessionId")] + public string? SessionId { get { throw null; } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttConnectProperties + { + internal MqttConnectProperties() { } + [System.Runtime.Serialization.DataMemberAttribute(Name="password")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("password")] + public string? Password { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="protocolVersion")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("protocolVersion")] + public Microsoft.Azure.WebPubSub.Common.MqttProtocolVersion ProtocolVersion { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="username")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("username")] + public string? Username { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="userProperties")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("userProperties")] + public System.Collections.Generic.IReadOnlyList? UserProperties { get { throw null; } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttDisconnectedEventRequest : Microsoft.Azure.WebPubSub.Common.DisconnectedEventRequest + { + public MqttDisconnectedEventRequest(Microsoft.Azure.WebPubSub.Common.MqttConnectionContext context, string reason, Microsoft.Azure.WebPubSub.Common.MqttDisconnectedEventRequestProperties mqtt) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext), default(string)) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="mqtt")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("mqtt")] + public Microsoft.Azure.WebPubSub.Common.MqttDisconnectedEventRequestProperties Mqtt { get { throw null; } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttDisconnectedEventRequestProperties + { + internal MqttDisconnectedEventRequestProperties() { } + [System.Runtime.Serialization.DataMemberAttribute(Name="disconnectPacket")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("disconnectPacket")] + public Microsoft.Azure.WebPubSub.Common.MqttDisconnectPacketProperties? DisconnectPacket { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="initiatedByClient")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("initiatedByClient")] + public bool InitiatedByClient { get { throw null; } } + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttDisconnectPacketProperties + { + internal MqttDisconnectPacketProperties() { } + [System.Runtime.Serialization.DataMemberAttribute(Name="code")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("code")] + public Microsoft.Azure.WebPubSub.Common.MqttDisconnectReasonCode Code { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="userProperties")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("userProperties")] + public System.Collections.Generic.IReadOnlyList? UserProperties { get { throw null; } } + } + public enum MqttDisconnectReasonCode : byte + { + NormalDisconnection = (byte)0, + DisconnectWithWillMessage = (byte)4, + UnspecifiedError = (byte)128, + MalformedPacket = (byte)129, + ProtocolError = (byte)130, + ImplementationSpecificError = (byte)131, + NotAuthorized = (byte)135, + ServerBusy = (byte)137, + ServerShuttingDown = (byte)139, + KeepAliveTimeout = (byte)141, + SessionTakenOver = (byte)142, + TopicFilterInvalid = (byte)143, + TopicNameInvalid = (byte)144, + ReceiveMaximumExceeded = (byte)147, + TopicAliasInvalid = (byte)148, + PacketTooLarge = (byte)149, + MessageRateTooHigh = (byte)150, + QuotaExceeded = (byte)151, + AdministrativeAction = (byte)152, + PayloadFormatInvalid = (byte)153, + RetainNotSupported = (byte)154, + QosNotSupported = (byte)155, + UseAnotherServer = (byte)156, + ServerMoved = (byte)157, + SharedSubscriptionsNotSupported = (byte)158, + ConnectionRateExceeded = (byte)159, + MaximumConnectTime = (byte)160, + SubscriptionIdentifiersNotSupported = (byte)161, + WildcardSubscriptionsNotSupported = (byte)162, + } + public enum MqttProtocolVersion + { + V311 = 4, + V500 = 5, + } + [System.Runtime.Serialization.DataContractAttribute] + public partial class MqttUserProperty : System.IEquatable + { + protected MqttUserProperty(Microsoft.Azure.WebPubSub.Common.MqttUserProperty original) { } + public MqttUserProperty(string name, string value) { } + protected virtual System.Type EqualityContract { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="name")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("name")] + public string Name { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute(Name="value")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("value")] + public string Value { get { throw null; } } + public virtual bool Equals(Microsoft.Azure.WebPubSub.Common.MqttUserProperty? other) { throw null; } + public override bool Equals(object? obj) { throw null; } + public override int GetHashCode() { throw null; } + public static bool operator ==(Microsoft.Azure.WebPubSub.Common.MqttUserProperty? left, Microsoft.Azure.WebPubSub.Common.MqttUserProperty? right) { throw null; } + public static bool operator !=(Microsoft.Azure.WebPubSub.Common.MqttUserProperty? left, Microsoft.Azure.WebPubSub.Common.MqttUserProperty? right) { throw null; } + protected virtual bool PrintMembers(System.Text.StringBuilder builder) { throw null; } + public override string ToString() { throw null; } + public virtual Microsoft.Azure.WebPubSub.Common.MqttUserProperty $() { throw null; } + } + public enum MqttV311ConnectReturnCode : byte + { + UnacceptableProtocolVersion = (byte)1, + IdentifierRejected = (byte)2, + ServerUnavailable = (byte)3, + BadUsernameOrPassword = (byte)4, + NotAuthorized = (byte)5, + } + public enum MqttV500ConnectReasonCode : byte + { + UnspecifiedError = (byte)128, + MalformedPacket = (byte)129, + ProtocolError = (byte)130, + ImplementationSpecificError = (byte)131, + UnsupportedProtocolVersion = (byte)132, + ClientIdentifierNotValid = (byte)133, + BadUserNameOrPassword = (byte)134, + NotAuthorized = (byte)135, + ServerUnavailable = (byte)136, + ServerBusy = (byte)137, + Banned = (byte)138, + BadAuthenticationMethod = (byte)140, + TopicNameInvalid = (byte)144, + PacketTooLarge = (byte)149, + QuotaExceeded = (byte)151, + PayloadFormatInvalid = (byte)153, + RetainNotSupported = (byte)154, + QosNotSupported = (byte)155, + UseAnotherServer = (byte)156, + ServerMoved = (byte)157, + ConnectionRateExceeded = (byte)159, + } + [System.Runtime.Serialization.DataContractAttribute] public sealed partial class PreflightRequest : Microsoft.Azure.WebPubSub.Common.WebPubSubEventRequest { public PreflightRequest(bool isValid) : base (default(Microsoft.Azure.WebPubSub.Common.WebPubSubConnectionContext)) { } @@ -122,9 +326,15 @@ public void SetState(string key, System.BinaryData value) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public void SetState(string key, object value) { } } + [System.Runtime.Serialization.DataContractAttribute] public sealed partial class WebPubSubClientCertificate { public WebPubSubClientCertificate(string thumbprint) { } + public WebPubSubClientCertificate(string thumbprint, string? content) { } + [System.Runtime.Serialization.DataMemberAttribute(Name="content")] + [System.Text.Json.Serialization.JsonPropertyNameAttribute("content")] + public string? Content { get { throw null; } } + [System.Runtime.Serialization.DataMemberAttribute] [System.Text.Json.Serialization.JsonPropertyNameAttribute("thumbprint")] public string Thumbprint { get { throw null; } } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/ContributionHints.md b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/ContributionHints.md new file mode 100644 index 000000000000..76e246498994 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/ContributionHints.md @@ -0,0 +1,28 @@ +# Contribution Hints + +This file provides some hints for contributing to the Microsoft.Azure.WebPubSub.Common library. + +## JSON serialization and deserialization + +The main purpose of this project is to provide classes for JSON serialization and deserialization to the Azure Functions extensions and the `AspNetCore` project. + +```mermaid +sequenceDiagram + participant W as Web PubSub Service + participant H as Functions Extensions (Host Process) + participant WP as Functions Extensions (Worker Process) + + W->>H: Send HTTP Request + H->>H: Deserialize HTTP Request using System.Text.Json + + H->>H: Serialize HTTP Request Body Object using Newtonsoft.Json + H->>WP: Send JSON requests + WP->>WP: Process Request in Worker Process + + WP->>H: Return JSON responses + H->>H: Deserialize JSON Response using Newtonsoft.Json + H->>H: Serialize into HTTP response using Newtonsoft.Json + H->>W: Send HTTP Response +``` + +Currently all the classes for CloudEvents requests have customized JSON converters or customized deserialization classes. This is because in .NET framework, `System.Text.Json` cannot support deserialization of classes without a pameterless constructor. Therefore we need to customize the deserialization of these classes. \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttConnectPropertiesJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttConnectPropertiesJsonConverter.cs new file mode 100644 index 000000000000..6217fea32f6f --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttConnectPropertiesJsonConverter.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +internal class MqttConnectPropertiesJsonConverter : JsonConverter +{ + public override MqttConnectProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + MqttProtocolVersion? protocolVersion = null; + string? username = null; + string? password = null; + IReadOnlyList? userProperties = null; + + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType == JsonTokenType.PropertyName) + { + var propertyName = reader.GetString(); + reader.Read(); + + switch (propertyName) + { + case MqttConnectProperties.ProtocolVersionProperty: + protocolVersion = JsonSerializer.Deserialize(ref reader, options); + break; + + case MqttConnectProperties.UsernameProperty: + username = reader.GetString(); + break; + + case MqttConnectProperties.PasswordProperty: + password = reader.GetString(); + break; + + case MqttConnectProperties.UserPropertiesProperty: + userProperties = JsonSerializer.Deserialize>(ref reader, options); + break; + + default: + reader.Skip(); + break; + } + } + } + + // Ensure that the required properties are present + if (protocolVersion == null) + { + throw new JsonException($"Missing required property '{MqttConnectProperties.ProtocolVersionProperty}'."); + } + + return new MqttConnectProperties(protocolVersion.Value, username, password, userProperties); + } + + public override void Write(Utf8JsonWriter writer, MqttConnectProperties value, JsonSerializerOptions options) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectPacketPropertiesJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectPacketPropertiesJsonConverter.cs new file mode 100644 index 000000000000..295ba99b4ce9 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectPacketPropertiesJsonConverter.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +internal class MqttDisconnectPacketPropertiesJsonConverter : JsonConverter +{ + public override MqttDisconnectPacketProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + MqttDisconnectReasonCode? code = null; + IReadOnlyList? userProperties = null; + + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType == JsonTokenType.PropertyName) + { + var propertyName = reader.GetString(); + reader.Read(); + + switch (propertyName) + { + case MqttDisconnectPacketProperties.CodeProperty: + code = JsonSerializer.Deserialize(ref reader, options); + break; + + case MqttDisconnectPacketProperties.UserPropertiesProperty: + userProperties = JsonSerializer.Deserialize>(ref reader, options); + break; + + default: + reader.Skip(); + break; + } + } + } + + // Ensure that the required 'code' property is present + if (code == null) + { + throw new JsonException($"Missing required property '{MqttDisconnectPacketProperties.CodeProperty}'."); + } + + return new MqttDisconnectPacketProperties(code.Value, userProperties); + } + + public override void Write(Utf8JsonWriter writer, MqttDisconnectPacketProperties value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + + writer.WritePropertyName(MqttDisconnectPacketProperties.CodeProperty); + JsonSerializer.Serialize(writer, value.Code, options); + + if (value.UserProperties != null) + { + writer.WritePropertyName(MqttDisconnectPacketProperties.UserPropertiesProperty); + JsonSerializer.Serialize(writer, value.UserProperties, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectedEventRequestPropertiesJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectedEventRequestPropertiesJsonConverter.cs new file mode 100644 index 000000000000..fd971db28276 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttDisconnectedEventRequestPropertiesJsonConverter.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +internal class MqttDisconnectedEventRequestPropertiesJsonConverter : JsonConverter +{ + public override MqttDisconnectedEventRequestProperties Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + bool? initiatedByClient = null; + MqttDisconnectPacketProperties? disconnectPacket = null; + + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType == JsonTokenType.PropertyName) + { + var propertyName = reader.GetString(); + reader.Read(); + + switch (propertyName) + { + case MqttDisconnectedEventRequestProperties.InitiatedByClientProperty: + initiatedByClient = reader.GetBoolean(); + break; + + case MqttDisconnectedEventRequestProperties.DisconnectPacketProperty: + disconnectPacket = JsonSerializer.Deserialize(ref reader, options); + break; + + default: + reader.Skip(); + break; + } + } + } + + // Ensure that the required 'initiatedByClient' property is present + if (initiatedByClient == null) + { + throw new JsonException($"Missing required property '{MqttDisconnectedEventRequestProperties.InitiatedByClientProperty}'."); + } + + return new MqttDisconnectedEventRequestProperties(initiatedByClient.Value, disconnectPacket); + } + + public override void Write(Utf8JsonWriter writer, MqttDisconnectedEventRequestProperties value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + + writer.WritePropertyName(MqttDisconnectedEventRequestProperties.InitiatedByClientProperty); + writer.WriteBooleanValue(value.InitiatedByClient); + + if (value.DisconnectPacket != null) + { + writer.WritePropertyName(MqttDisconnectedEventRequestProperties.DisconnectPacketProperty); + JsonSerializer.Serialize(writer, value.DisconnectPacket, options); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttUserPropertyJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttUserPropertyJsonConverter.cs new file mode 100644 index 000000000000..0bd5861fd7a7 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/MqttUserPropertyJsonConverter.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +internal class MqttUserPropertyJsonConverter : JsonConverter +{ + public override MqttUserProperty Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType != JsonTokenType.StartObject) + { + throw new JsonException(); + } + + string name = null; + string value = null; + + while (reader.Read()) + { + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException(); + } + + var propertyName = reader.GetString(); + reader.Read(); + + switch (propertyName) + { + case MqttUserProperty.NamePropertyName: + name = reader.GetString(); + break; + case MqttUserProperty.ValuePropertyName: + value = reader.GetString(); + break; + default: + reader.Skip(); + break; + } + } + + return new MqttUserProperty(name, value); + } + + public override void Write(Utf8JsonWriter writer, MqttUserProperty value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + + writer.WriteString(MqttUserProperty.NamePropertyName, value.Name); + writer.WriteString(MqttUserProperty.ValuePropertyName, value.Value); + + writer.WriteEndObject(); + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/WebPubSubClientCertificateJsonConverter.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/WebPubSubClientCertificateJsonConverter.cs index 5a9f2bfb8cce..c8db1a8a77e9 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/WebPubSubClientCertificateJsonConverter.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Internal/WebPubSubClientCertificateJsonConverter.cs @@ -5,25 +5,65 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Microsoft.Azure.WebPubSub.Common +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +internal class WebPubSubClientCertificateJsonConverter : JsonConverter { - internal class WebPubSubClientCertificateJsonConverter : JsonConverter + public override WebPubSubClientCertificate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - public override WebPubSubClientCertificate Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + string? thumbprint = null; + string? content = null; + + while (reader.Read()) { - using var jsonDocument = JsonDocument.ParseValue(ref reader); - var element = jsonDocument.RootElement; + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType == JsonTokenType.PropertyName) + { + var propertyName = reader.GetString(); + reader.Read(); + + switch (propertyName) + { + case WebPubSubClientCertificate.ThumbprintProperty: + thumbprint = reader.GetString(); + break; + + case WebPubSubClientCertificate.ContentProperty: + content = reader.GetString(); + break; - return new WebPubSubClientCertificate( - element.ReadString(WebPubSubClientCertificate.ThumbprintProperty)); + default: + reader.Skip(); + break; + } + } } - public override void Write(Utf8JsonWriter writer, WebPubSubClientCertificate value, JsonSerializerOptions options) + // Ensure that the required 'thumbprint' property is present + if (thumbprint == null) + { + throw new JsonException($"Missing required property '{WebPubSubClientCertificate.ThumbprintProperty}'."); + } + + return new WebPubSubClientCertificate(thumbprint, content); + } + + public override void Write(Utf8JsonWriter writer, WebPubSubClientCertificate value, JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WritePropertyName(WebPubSubClientCertificate.ThumbprintProperty); + JsonSerializer.Serialize(writer, value.Thumbprint, options); + if (value.Content != null) { - writer.WriteStartObject(); - writer.WritePropertyName(WebPubSubClientCertificate.ThumbprintProperty); - JsonSerializer.Serialize(writer, value.Thumbprint, options); - writer.WriteEndObject(); + writer.WritePropertyName(WebPubSubClientCertificate.ContentProperty); + JsonSerializer.Serialize(writer, value.Content, options); } + writer.WriteEndObject(); } } diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Microsoft.Azure.WebPubSub.Common.csproj b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Microsoft.Azure.WebPubSub.Common.csproj index e3a00eea2950..562be6698b4f 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Microsoft.Azure.WebPubSub.Common.csproj +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Microsoft.Azure.WebPubSub.Common.csproj @@ -2,9 +2,8 @@ Azure SDK Common object library for the WebPubSub service Azure SDK Common for WebPubSub - 1.3.0-beta.1 + 1.3.0 - 1.2.0 Azure, WebPubSub netstandard2.0 $(RequiredTargetFrameworks) diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventErrorResponseProperties.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventErrorResponseProperties.cs new file mode 100644 index 000000000000..2ffc56712071 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventErrorResponseProperties.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the properties of an MQTT connection failure response. +/// +[DataContract] +public class MqttConnectEventErrorResponseProperties +{ + internal const string CodeProperty = "code"; + internal const string ReasonProperty = "reason"; + internal const string UserPropertiesProperty = "userProperties"; + /// + /// The failure code. It will be sent to the clients in the CONNACK packet as a return code (MQTT 3.1.1) or reason code (MQTT 5.0). Upstream webhook should select a valid integer value defined the MQTT protocols according to the protocol versions of the clients. If Upstream webhook sets an invalid value, clients will receive "unspecified error" in the CONNACK packet. + /// + [DataMember(Name = CodeProperty)] + [JsonPropertyName(CodeProperty)] + public int Code + { + get; + } + + /// + /// The reason for the failure. It's a human readable failure reason string designed for diagnostics. It will be sent to those clients whose protocols support reason string in the CONNACK packet. Now only MQTT 5.0 supports it. + /// + [DataMember(Name = ReasonProperty)] + [JsonPropertyName(ReasonProperty)] + public string? Reason { get; set; } + + /// + /// The user properties in the response. + /// + [DataMember(Name = UserPropertiesProperty)] + [JsonPropertyName(UserPropertiesProperty)] + public IReadOnlyList? UserProperties { get; set; } + + /// + /// Creates a new instance of . + /// + /// + public MqttConnectEventErrorResponseProperties(MqttV500ConnectReasonCode code) + { + Code = (int)code; + } + + /// + /// Creates a new instance of . + /// + /// + public MqttConnectEventErrorResponseProperties(MqttV311ConnectReturnCode code) + { + Code = (int)code; + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventResponseProperties.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventResponseProperties.cs new file mode 100644 index 000000000000..b2a119d6f583 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectEventResponseProperties.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the MQTT specific properties in a successful MQTT connection event response. +/// +[DataContract] +public class MqttConnectEventResponseProperties +{ + internal const string UserPropertiesProperty = "userProperties"; + + /// + /// It's additional diagnostic or other information provided by upstream server. They'll be converted to the user properties field in the CONNACK packet, and sent to clients whose protocols support user properties. Now only MQTT 5.0 supports user properties. Upstream webhook can use the property to communicate additional diagnostic or other information with clients. + /// + [DataMember(Name = UserPropertiesProperty)] + [JsonPropertyName(UserPropertiesProperty)] + public IReadOnlyList? UserProperties { get; set; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectProperties.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectProperties.cs new file mode 100644 index 000000000000..a18122955952 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttConnectProperties.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable enable + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// The properties of the MQTT CONNECT packet. +/// +[DataContract] +[JsonConverter(typeof(MqttConnectPropertiesJsonConverter))] +public class MqttConnectProperties +{ + internal const string ProtocolVersionProperty = "protocolVersion"; + internal const string UsernameProperty = "username"; + internal const string PasswordProperty = "password"; + internal const string UserPropertiesProperty = "userProperties"; + + /// + /// Creates a new instance of . + /// + /// + /// + /// + /// + internal MqttConnectProperties(MqttProtocolVersion protocolVersion, string? username, string? password, IReadOnlyList? userProperties) + { + ProtocolVersion = protocolVersion; + Username = username; + Password = password; + UserProperties = userProperties; + } + + /// + /// MQTT protocol version. + /// + [JsonPropertyName(ProtocolVersionProperty)] + [DataMember(Name = ProtocolVersionProperty)] + public MqttProtocolVersion ProtocolVersion { get; } + + /// + /// The username field in the MQTT CONNECT packet. + /// + [JsonPropertyName(UsernameProperty)] + [DataMember(Name = UsernameProperty)] + public string? Username { get; } + + /// + ///The password field in the MQTT CONNECT packet. + /// Use string type instead of byte[] to avoid the problem of serialization. + /// Although System.Text.Json serializes byte[] to base64 string by default, it is not explicitly documented. + /// + [JsonPropertyName(PasswordProperty)] + [DataMember(Name = PasswordProperty)] + public string? Password { get; } + + /// + /// The user properties in the MQTT CONNECT packet. + /// + [JsonPropertyName(UserPropertiesProperty)] + [DataMember(Name = UserPropertiesProperty)] + public IReadOnlyList? UserProperties { get; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectPacketProperties.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectPacketProperties.cs new file mode 100644 index 000000000000..8f8f423dec1f --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectPacketProperties.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the properties of an MQTT DISCONNECT packet. +/// +[DataContract] +[JsonConverter(typeof(MqttDisconnectPacketPropertiesJsonConverter))] +public class MqttDisconnectPacketProperties +{ + internal const string CodeProperty = "code"; + internal const string UserPropertiesProperty = "userProperties"; + + /// + /// Creates a new instance of . + /// + /// + /// + internal MqttDisconnectPacketProperties(MqttDisconnectReasonCode code, IReadOnlyList? userProperties) + { + Code = code; + UserProperties = userProperties; + } + + /// + /// The DISCONNECT reason code defined in MQTT 5.0 spec. + /// For MQTT 3.1.1 clients, it's always the default value 0. + /// + [JsonPropertyName(CodeProperty)] + [DataMember(Name = CodeProperty)] + public MqttDisconnectReasonCode Code { get; } + + /// + /// The user properties in the DISCONNECT packet sent by the client. The value is not null only if the client sent a DISCONNECT packet with user properties. + /// + [DataMember(Name = UserPropertiesProperty)] + [JsonPropertyName(UserPropertiesProperty)] + public IReadOnlyList? UserProperties { get; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectReasonCode.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectReasonCode.cs new file mode 100644 index 000000000000..fdbd228502ee --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectReasonCode.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// MQTT Disconnect Reason Codes +/// These codes represent the reasons for disconnecting an MQTT client as per MQTT 5.0 specification. +/// +public enum MqttDisconnectReasonCode : byte +{ + /// + /// 0x00 - Normal disconnection + /// Sent by: Client or Server + /// Description: Close the connection normally. Do not send the Will Message. + /// + NormalDisconnection = 0x00, + + /// + /// 0x04 - Disconnect with Will Message + /// Sent by: Client + /// Description: The Client wishes to disconnect but requires that the Server also publishes its Will Message. + /// + DisconnectWithWillMessage = 0x04, + + /// + /// 0x80 - Unspecified error + /// Sent by: Client or Server + /// Description: The Connection is closed but the sender either does not wish to reveal the reason, or none of the other Reason Codes apply. + /// + UnspecifiedError = 0x80, + + /// + /// 0x81 - Malformed Packet + /// Sent by: Client or Server + /// Description: The received packet does not conform to this specification. + /// + MalformedPacket = 0x81, + + /// + /// 0x82 - Protocol Error + /// Sent by: Client or Server + /// Description: An unexpected or out of order packet was received. + /// + ProtocolError = 0x82, + + /// + /// 0x83 - Implementation specific error + /// Sent by: Client or Server + /// Description: The packet received is valid but cannot be processed by this implementation. + /// + ImplementationSpecificError = 0x83, + + /// + /// 0x87 - Not authorized + /// Sent by: Server + /// Description: The request is not authorized. + /// + NotAuthorized = 0x87, + + /// + /// 0x89 - Server busy + /// Sent by: Server + /// Description: The Server is busy and cannot continue processing requests from this Client. + /// + ServerBusy = 0x89, + + /// + /// 0x8B - Server shutting down + /// Sent by: Server + /// Description: The Server is shutting down. + /// + ServerShuttingDown = 0x8B, + + /// + /// 0x8D - Keep Alive timeout + /// Sent by: Server + /// Description: The Connection is closed because no packet has been received for 1.5 times the Keepalive time. + /// + KeepAliveTimeout = 0x8D, + + /// + /// 0x8E - Session taken over + /// Sent by: Server + /// Description: Another Connection using the same ClientID has connected causing this Connection to be closed. + /// + SessionTakenOver = 0x8E, + + /// + /// 0x8F - Topic Filter invalid + /// Sent by: Server + /// Description: The Topic Filter is correctly formed, but is not accepted by this Server. + /// + TopicFilterInvalid = 0x8F, + + /// + /// 0x90 - Topic Name invalid + /// Sent by: Client or Server + /// Description: The Topic Name is correctly formed, but is not accepted by this Client or Server. + /// + TopicNameInvalid = 0x90, + + /// + /// 0x93 - Receive Maximum exceeded + /// Sent by: Client or Server + /// Description: The Client or Server has received more than Receive Maximum publication for which it has not sent PUBACK or PUBCOMP. + /// + ReceiveMaximumExceeded = 0x93, + + /// + /// 0x94 - Topic Alias invalid + /// Sent by: Client or Server + /// Description: The Client or Server has received a PUBLISH packet containing a Topic Alias which is greater than the Maximum Topic Alias it sent in the CONNECT or CONNACK packet. + /// + TopicAliasInvalid = 0x94, + + /// + /// 0x95 - Packet too large + /// Sent by: Client or Server + /// Description: The packet size is greater than Maximum Packet Size for this Client or Server. + /// + PacketTooLarge = 0x95, + + /// + /// 0x96 - Message rate too high + /// Sent by: Client or Server + /// Description: The received data rate is too high. + /// + MessageRateTooHigh = 0x96, + + /// + /// 0x97 - Quota exceeded + /// Sent by: Client or Server + /// Description: An implementation or administrative imposed limit has been exceeded. + /// + QuotaExceeded = 0x97, + + /// + /// 0x98 - Administrative action + /// Sent by: Client or Server + /// Description: The Connection is closed due to an administrative action. + /// + AdministrativeAction = 0x98, + + /// + /// 0x99 - Payload format invalid + /// Sent by: Client or Server + /// Description: The payload format does not match the one specified by the Payload Format Indicator. + /// + PayloadFormatInvalid = 0x99, + + /// + /// 0x9A - Retain not supported + /// Sent by: Server + /// Description: The Server does not support retained messages. + /// + RetainNotSupported = 0x9A, + + /// + /// 0x9B - QoS not supported + /// Sent by: Server + /// Description: The Client specified a QoS greater than the QoS specified in a Maximum QoS in the CONNACK. + /// + QosNotSupported = 0x9B, + + /// + /// 0x9C - Use another server + /// Sent by: Server + /// Description: The Client should temporarily change its Server. + /// + UseAnotherServer = 0x9C, + + /// + /// 0x9D - Server moved + /// Sent by: Server + /// Description: The Server is moved and the Client should permanently change its server location. + /// + ServerMoved = 0x9D, + + /// + /// 0x9E - Shared Subscriptions not supported + /// Sent by: Server + /// Description: The Server does not support Shared Subscriptions. + /// + SharedSubscriptionsNotSupported = 0x9E, + + /// + /// 0x9F - Connection rate exceeded + /// Sent by: Server + /// Description: This connection is closed because the connection rate is too high. + /// + ConnectionRateExceeded = 0x9F, + + /// + /// 0xA0 - Maximum connect time + /// Sent by: Server + /// Description: The maximum connection time authorized for this connection has been exceeded. + /// + MaximumConnectTime = 0xA0, + + /// + /// 0xA1 - Subscription Identifiers not supported + /// Sent by: Server + /// Description: The Server does not support Subscription Identifiers; the subscription is not accepted. + /// + SubscriptionIdentifiersNotSupported = 0xA1, + + /// + /// 0xA2 - Wildcard Subscriptions not supported + /// Sent by: Server + /// Description: The Server does not support Wildcard Subscriptions; the subscription is not accepted. + /// + WildcardSubscriptionsNotSupported = 0xA2 +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectedEventRequestProperties.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectedEventRequestProperties.cs new file mode 100644 index 000000000000..dac49cfda88d --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttDisconnectedEventRequestProperties.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the properties of an MQTT disconnection event. +/// +[DataContract] +[JsonConverter(typeof(MqttDisconnectedEventRequestPropertiesJsonConverter))] +public class MqttDisconnectedEventRequestProperties +{ + internal const string InitiatedByClientProperty = "initiatedByClient"; + internal const string DisconnectPacketProperty = "disconnectPacket"; + + /// + /// Indicates whether the disconnection is initiated by the client. + /// + [DataMember(Name = InitiatedByClientProperty)] + [JsonPropertyName(InitiatedByClientProperty)] + public bool InitiatedByClient { get; } + + /// + ///The DISCONNECT packet properties to end the last physical connection. It may be sent by the client or server. + /// + [DataMember(Name = DisconnectPacketProperty)] + [JsonPropertyName(DisconnectPacketProperty)] + public MqttDisconnectPacketProperties? DisconnectPacket { get; } + + /// + /// Creates an instance of . + /// + /// + /// + internal MqttDisconnectedEventRequestProperties(bool initiatedByClient, MqttDisconnectPacketProperties? disconnectPacket) + { + InitiatedByClient = initiatedByClient; + DisconnectPacket = disconnectPacket; + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttProtocolVersion.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttProtocolVersion.cs new file mode 100644 index 000000000000..55a2935ecba3 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttProtocolVersion.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// MQTT protocol versions supported by Web PubSub service. +/// +public enum MqttProtocolVersion +{ + /// + /// MQTT 3.1.1 + /// + V311 = 4, + + /// + /// MQTT 5.0 + /// + V500 = 5 +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttUserProperty.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttUserProperty.cs new file mode 100644 index 000000000000..3bc918276d0c --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttUserProperty.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// A class representing a user property in MQTT. +/// +[DataContract] +[JsonConverter(typeof(MqttUserPropertyJsonConverter))] +public record MqttUserProperty +{ + internal const string NamePropertyName = "name"; + internal const string ValuePropertyName = "value"; + + /// + /// Creates a new instance of . + /// + /// + /// + public MqttUserProperty(string name, string value) + { + Name = name; + Value = value; + } + + /// + /// The name of the property. + /// + [DataMember(Name = NamePropertyName)] + [JsonPropertyName(NamePropertyName)] + public string Name { get; } + + /// + /// The value of the property. + /// + [DataMember(Name = ValuePropertyName)] + [JsonPropertyName(ValuePropertyName)] + public string Value { get; } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV311ConnectReturnCode.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV311ConnectReturnCode.cs new file mode 100644 index 000000000000..6cdf5c099bbf --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV311ConnectReturnCode.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// MQTT 3.1.1 Connect Return Codes. +/// +public enum MqttV311ConnectReturnCode : byte +{ + /// + /// 0x01: Connection refused, unacceptable protocol version + /// The Server does not support the level of the MQTT protocol requested by the Client. + /// + UnacceptableProtocolVersion = 0x01, + + /// + /// 0x02: Connection refused, identifier rejected + /// The Client identifier is correct UTF-8 but not allowed by the Server. + /// + IdentifierRejected = 0x02, + + /// + /// 0x03: Connection refused, server unavailable + /// The Network Connection has been made but the MQTT service is unavailable. + /// + ServerUnavailable = 0x03, + + /// + /// 0x04: Connection refused, bad user name or password + /// The data in the user name or password is malformed. + /// + BadUsernameOrPassword = 0x04, + + /// + /// 0x05: Connection refused, not authorized + /// The Client is not authorized to connect. + /// + NotAuthorized = 0x05, +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV500ConnectReasonCode.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV500ConnectReasonCode.cs new file mode 100644 index 000000000000..a35b3f21cc17 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Mqtt/MqttV500ConnectReasonCode.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// MQTT Connect Reason Codes +/// These codes represent the reasons for the outcome of an MQTT CONNECT packet as per MQTT 5.0 specification. +/// +public enum MqttV500ConnectReasonCode : byte +{ + /// + /// 0x80 - Unspecified error + /// Description: The Server does not wish to reveal the reason for the failure, or none of the other Reason Codes apply. + /// + UnspecifiedError = 0x80, + + /// + /// 0x81 - Malformed Packet + /// Description: Data within the CONNECT packet could not be correctly parsed. + /// + MalformedPacket = 0x81, + + /// + /// 0x82 - Protocol Error + /// Description: Data in the CONNECT packet does not conform to this specification. + /// + ProtocolError = 0x82, + + /// + /// 0x83 - Implementation specific error + /// Description: The CONNECT is valid but is not accepted by this Server. + /// + ImplementationSpecificError = 0x83, + + /// + /// 0x84 - Unsupported Protocol Version + /// Description: The Server does not support the version of the MQTT protocol requested by the Client. + /// + UnsupportedProtocolVersion = 0x84, + + /// + /// 0x85 - Client Identifier not valid + /// Description: The Client Identifier is a valid string but is not allowed by the Server. + /// + ClientIdentifierNotValid = 0x85, + + /// + /// 0x86 - Bad User Name or Password + /// Description: The Server does not accept the User Name or Password specified by the Client. + /// + BadUserNameOrPassword = 0x86, + + /// + /// 0x87 - Not authorized + /// Description: The Client is not authorized to connect. + /// + NotAuthorized = 0x87, + + /// + /// 0x88 - Server unavailable + /// Description: The MQTT Server is not available. + /// + ServerUnavailable = 0x88, + + /// + /// 0x89 - Server busy + /// Description: The Server is busy. Try again later. + /// + ServerBusy = 0x89, + + /// + /// 0x8A - Banned + /// Description: This Client has been banned by administrative action. Contact the server administrator. + /// + Banned = 0x8A, + + /// + /// 0x8C - Bad authentication method + /// Description: The authentication method is not supported or does not match the authentication method currently in use. + /// + BadAuthenticationMethod = 0x8C, + + /// + /// 0x90 - Topic Name invalid + /// Description: The Will Topic Name is not malformed, but is not accepted by this Server. + /// + TopicNameInvalid = 0x90, + + /// + /// 0x95 - Packet too large + /// Description: The CONNECT packet exceeded the maximum permissible size. + /// + PacketTooLarge = 0x95, + + /// + /// 0x97 - Quota exceeded + /// Description: An implementation or administrative imposed limit has been exceeded. + /// + QuotaExceeded = 0x97, + + /// + /// 0x99 - Payload format invalid + /// Description: The Will Payload does not match the specified Payload Format Indicator. + /// + PayloadFormatInvalid = 0x99, + + /// + /// 0x9A - Retain not supported + /// Description: The Server does not support retained messages, and Will Retain was set to 1. + /// + RetainNotSupported = 0x9A, + + /// + /// 0x9B - QoS not supported + /// Description: The Server does not support the QoS set in Will QoS. + /// + QosNotSupported = 0x9B, + + /// + /// 0x9C - Use another server + /// Description: The Client should temporarily use another server. + /// + UseAnotherServer = 0x9C, + + /// + /// 0x9D - Server moved + /// Description: The Client should permanently use another server. + /// + ServerMoved = 0x9D, + + /// + /// 0x9F - Connection rate exceeded + /// Description: The connection rate limit has been exceeded. + /// + ConnectionRateExceeded = 0x9F +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/MqttConnectionContext.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/MqttConnectionContext.cs new file mode 100644 index 000000000000..e6976d218ce0 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/MqttConnectionContext.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// MQTT Request context from headers following CloudEvents. +/// +[DataContract] +public class MqttConnectionContext : WebPubSubConnectionContext +{ + internal const string PhysicalConnectionIdProperty = "physicalConnectionId"; + internal const string SessionIdProperty = "sessionId"; + + /// + /// The unique identifier generated by the service of the network connection. + /// + [JsonPropertyName(PhysicalConnectionIdProperty)] + [DataMember(Name = PhysicalConnectionIdProperty)] + public string PhysicalConnectionId { get; } + + /// + /// The unique identifier generated by the service of the MQTT session. + /// + [JsonPropertyName(SessionIdProperty)] + [DataMember(Name = SessionIdProperty)] + public string? SessionId { get; } + + /// + /// The MQTT connection context contains the CloudEvents headers under Web PubSub protocol. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public MqttConnectionContext(WebPubSubEventType eventType, string eventName, string hub, string connectionId, string physicalConnectionId, string? sessionId, string? userId = null, string? signature = null, string? origin = null, IReadOnlyDictionary? connectionStates = null, IReadOnlyDictionary? headers = null) : base(eventType, eventName, hub, connectionId, userId, signature, origin, connectionStates, headers) + { + PhysicalConnectionId = physicalConnectionId; + SessionId = sessionId; + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectEventRequest.cs index 5adeee257987..0e6e4644be80 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectEventRequest.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectEventRequest.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.WebPubSub.Common /// [DataContract] [JsonConverter(typeof(ConnectEventRequestJsonConverter))] - public sealed class ConnectEventRequest : WebPubSubEventRequest + public class ConnectEventRequest : WebPubSubEventRequest { internal const string ClaimsProperty = "claims"; internal const string QueryProperty = "query"; @@ -76,7 +76,7 @@ public ConnectEventResponse CreateResponse(string userId, IEnumerable gr /// . /// Detail error message. /// A error response to return caller and will drop connection. - public EventErrorResponse CreateErrorResponse(WebPubSubErrorCode code, string message) + public virtual EventErrorResponse CreateErrorResponse(WebPubSubErrorCode code, string message) { return new EventErrorResponse(code, message); } diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectedEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectedEventRequest.cs index 4d8fe966c1be..6a80e9c55977 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectedEventRequest.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/ConnectedEventRequest.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.WebPubSub.Common /// /// ServiceRequest for connected event. /// - public sealed class ConnectedEventRequest : WebPubSubEventRequest + public class ConnectedEventRequest : WebPubSubEventRequest { /// /// The connected event request diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/DisconnectedEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/DisconnectedEventRequest.cs index 35fc9a9e0b5b..8936bd7bcf98 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/DisconnectedEventRequest.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/DisconnectedEventRequest.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.WebPubSub.Common /// [DataContract] [JsonConverter(typeof(DisconnectedEventRequestJsonConverter))] - public sealed class DisconnectedEventRequest : WebPubSubEventRequest + public class DisconnectedEventRequest : WebPubSubEventRequest { internal const string ReasonProperty = "reason"; diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttConnectEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttConnectEventRequest.cs new file mode 100644 index 000000000000..36f0500e1648 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttConnectEventRequest.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable enable + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// MQTT Connect event request. It's sent when a MQTT client connects to the service. +/// +[DataContract] +public class MqttConnectEventRequest : ConnectEventRequest +{ + internal const string MqttPropertyName = "mqtt"; + private static readonly string[] MqttWebSocketSubprotocol = new string[] { "mqtt" }; + + /// + /// Creates a new instance of . + /// + /// + /// + /// + /// + /// + /// + public MqttConnectEventRequest(MqttConnectionContext context, IReadOnlyDictionary claims, IReadOnlyDictionary query, IEnumerable certificates, IReadOnlyDictionary headers, MqttConnectProperties mqtt) : base(context, claims, query, MqttWebSocketSubprotocol, certificates, headers) + { + Mqtt = mqtt; + } + + /// + /// The properties of the MQTT CONNECT packet. + /// + [DataMember(Name = MqttPropertyName)] + [JsonPropertyName(MqttPropertyName)] + public MqttConnectProperties Mqtt { get; } + + /// + /// Create with general Web PubSub error code. + /// + /// . + /// Detail error message. + /// A error response to return caller and will drop connection. + [EditorBrowsable(EditorBrowsableState.Never)] + public override EventErrorResponse CreateErrorResponse(WebPubSubErrorCode code, string? message = null) + { + return Mqtt.ProtocolVersion switch + { + MqttProtocolVersion.V311 => new MqttConnectEventErrorResponse(code.ToMqttV311ConnectReturnCode(), message), + MqttProtocolVersion.V500 => new MqttConnectEventErrorResponse(code.ToMqttV500ConnectReasonCode(), message), + _ => throw new ArgumentOutOfRangeException($"MQTT protocol version {Mqtt.ProtocolVersion} is invalid.") + }; + } + + /// + /// Create . + /// + /// Caller userId for current connection. + /// User roles applied to current connection. + /// Groups applied to current connection. + /// A connect response to return service. + public MqttConnectEventResponse CreateMqttResponse(string userId, IEnumerable groups, IEnumerable roles) + { + return new MqttConnectEventResponse(userId, groups, roles); + } + + /// + /// Creates error response for MQTT protocol 5.0. + /// + /// + /// + /// A error response to return caller and will drop connection. + public MqttConnectEventErrorResponse CreateMqttV50ErrorResponse(MqttV500ConnectReasonCode code, string? message = null) + { + if (Mqtt.ProtocolVersion != MqttProtocolVersion.V500) + { + throw new InvalidOperationException("The MQTT protocol version of the client is not 5.0."); + } + return new MqttConnectEventErrorResponse(code, message); + } + + /// + /// Creates error response for MQTT protocol 3.1.1. + /// + /// + /// + /// A error response to return caller and will drop connection. + public MqttConnectEventErrorResponse CreateMqttV311ErrorResponse(MqttV311ConnectReturnCode code, string? message = null) + { + if (Mqtt.ProtocolVersion != MqttProtocolVersion.V311) + { + throw new InvalidOperationException("The MQTT protocol version of the client is not 3.1.1."); + } + return new MqttConnectEventErrorResponse(code, message); + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttDisconnectedEventRequest.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttDisconnectedEventRequest.cs new file mode 100644 index 000000000000..1599b78588c3 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Request/MqttDisconnectedEventRequest.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the response of an MQTT connection failure. +/// +[DataContract] +public class MqttDisconnectedEventRequest : DisconnectedEventRequest +{ + internal const string MqttProperty = "mqtt"; + + /// + /// Creates a new instance of . + /// + /// + /// + /// + public MqttDisconnectedEventRequest(MqttConnectionContext context, string reason, MqttDisconnectedEventRequestProperties mqtt) : base(context, reason) + { + Mqtt = mqtt; + } + + /// + /// Represents the properties of an MQTT disconnection event request. + /// + [DataMember(Name = MqttProperty)] + [JsonPropertyName(MqttProperty)] + public MqttDisconnectedEventRequestProperties Mqtt { get; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventErrorResponse.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventErrorResponse.cs new file mode 100644 index 000000000000..6a799dd252ca --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventErrorResponse.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ComponentModel; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +/// +/// Represents the response properties of an MQTT connection failure. +/// +[DataContract] +public class MqttConnectEventErrorResponse : EventErrorResponse +{ + internal const string MqttProperty = "mqtt"; + + /// + /// Represents the properties of an MQTT connection failure response. + /// + [DataMember(Name = MqttProperty)] + [JsonPropertyName(MqttProperty)] + public MqttConnectEventErrorResponseProperties Mqtt + { + get; + } + + /// + /// Creates an instance of . + /// + public MqttConnectEventErrorResponse(MqttV500ConnectReasonCode code, string? reason) : base(WebPubSubErrorCodeExtensions.FromMqttV500ConnectReasonCode(code), reason) + { + Mqtt = new MqttConnectEventErrorResponseProperties(code) + { + Reason = reason + }; + } + + /// + /// Creates an instance of . + /// + public MqttConnectEventErrorResponse(MqttV311ConnectReturnCode code, string? reason) : base(WebPubSubErrorCodeExtensions.FromMqttV311ConnectReturnCode(code), reason) + { + Mqtt = new MqttConnectEventErrorResponseProperties(code) + { + Reason = reason + }; + } + + /// + /// Default constructor for JsonSerialize. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public MqttConnectEventErrorResponse(MqttConnectEventErrorResponseProperties mqtt) + { + Mqtt = mqtt; + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventResponse.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventResponse.cs new file mode 100644 index 000000000000..fe0c3f18b26c --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Response/MqttConnectEventResponse.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +#nullable enable + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// Successful response for MQTT connect event. +/// +[DataContract] +public sealed class MqttConnectEventResponse : ConnectEventResponse +{ + internal const string MqttWebSocketSubprotocolHeaderValue = "mqtt"; + internal const string MqttProperty = "mqtt"; + + /// + /// Default constructor for JsonSerialize. + /// + public MqttConnectEventResponse() + { + } + + /// + /// Creates a new instance of . + /// + /// + /// + /// + public MqttConnectEventResponse(string? userId, IEnumerable? groups, IEnumerable? roles) : base(userId, groups, MqttWebSocketSubprotocolHeaderValue, roles) + { + } + + /// + /// Represents the MQTT specific properties in a successful MQTT connection event response. + /// + [JsonPropertyName(MqttProperty)] + [DataMember(Name = MqttProperty)] + public MqttConnectEventResponseProperties? Mqtt { get; set; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventErrorResponseContent.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventErrorResponseContent.cs new file mode 100644 index 000000000000..88f71a962d15 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventErrorResponseContent.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; + +namespace Microsoft.Azure.WebPubSub.Common; + +#nullable enable + +internal class MqttConnectEventErrorResponseContent : MqttConnectEventErrorResponse +{ + public MqttConnectEventErrorResponseContent(MqttConnectEventErrorResponsePropertiesContent mqtt) : base(new MqttConnectEventErrorResponseProperties((MqttV500ConnectReasonCode)mqtt.Code)) + { + Mqtt.Reason = mqtt.Reason; + Mqtt.UserProperties = mqtt.UserProperties; + // Set the proper WebPubSubErrorCode + if (mqtt.Code < 0x80) + { + // MQTT 3.1.1 + Code = WebPubSubErrorCodeExtensions.FromMqttV311ConnectReturnCode((MqttV311ConnectReturnCode)mqtt.Code); + } + else + { + // MQTT 5.0 + Code = WebPubSubErrorCodeExtensions.FromMqttV500ConnectReasonCode((MqttV500ConnectReasonCode)mqtt.Code); + } + } +} + +internal class MqttConnectEventErrorResponsePropertiesContent : MqttConnectEventErrorResponseProperties +{ + public MqttConnectEventErrorResponsePropertiesContent(int code, string? reason, IReadOnlyList? userProperties) : base((MqttV500ConnectReasonCode)code) + { + Reason = reason; + UserProperties = userProperties; + } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventRequestContent.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventRequestContent.cs new file mode 100644 index 000000000000..fd70a67980cf --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttConnectEventRequestContent.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +/// +/// Class to represent the request body of MqttConnectEvent for Newtonsoft.JSON deserialization. +/// contains a field "ConnectionContext", which is not available during deserialization. Use a subclass to avoid a customized JSON converter./> +/// +internal class MqttConnectEventRequestContent +{ + internal const string ClaimsProperty = "claims"; + internal const string QueryProperty = "query"; + internal const string HeadersProperty = "headers"; + internal const string SubprotocolsProperty = "subprotocols"; + internal const string ClientCertificatesProperty = "clientCertificates"; + internal const string MqttPropertyName = "mqtt"; + + /// + /// User Claims. + /// + [JsonPropertyName(ClaimsProperty)] + [DataMember(Name = ClaimsProperty)] + public IReadOnlyDictionary Claims { get; set; } + + /// + /// Request query. + /// + [JsonPropertyName(QueryProperty)] + [DataMember(Name = QueryProperty)] + public IReadOnlyDictionary Query { get; set; } + + /// + /// Request headers. + /// + [JsonPropertyName(HeadersProperty)] + [DataMember(Name = HeadersProperty)] + public IReadOnlyDictionary Headers { get; set; } + + /// + /// Supported subprotocols. + /// + [JsonPropertyName(SubprotocolsProperty)] + [DataMember(Name = SubprotocolsProperty)] + public IReadOnlyList Subprotocols { get; set; } + + /// + /// Client certificates. + /// + [JsonPropertyName(ClientCertificatesProperty)] + [DataMember(Name = ClientCertificatesProperty)] + public IReadOnlyList ClientCertificates { get; set; } + + /// + /// The properties of the MQTT CONNECT packet. + /// + [DataMember(Name = MqttPropertyName)] + [JsonPropertyName(MqttPropertyName)] + public MqttConnectProperties Mqtt { get; set; } +} \ No newline at end of file diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttDisconnectedEventRequestContent.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttDisconnectedEventRequestContent.cs new file mode 100644 index 000000000000..16547c332b76 --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/MqttDisconnectedEventRequestContent.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System.Text.Json.Serialization; + +namespace Microsoft.Azure.WebPubSub.Common; + +internal class MqttDisconnectedEventRequestContent +{ + [JsonPropertyName("reason")] + public string Reason { get; set; } + + [JsonPropertyName("mqtt")] + public MqttDisconnectedEventRequestProperties Mqtt { get; set; } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/WebPubSubErrorCodeExtensions.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/WebPubSubErrorCodeExtensions.cs new file mode 100644 index 000000000000..130a3a0adcdd --- /dev/null +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/Shared/WebPubSubErrorCodeExtensions.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; + +namespace Microsoft.Azure.WebPubSub.Common; + +internal static class WebPubSubErrorCodeExtensions +{ + public static MqttV311ConnectReturnCode ToMqttV311ConnectReturnCode(this WebPubSubErrorCode code) + { + return code switch + { + WebPubSubErrorCode.Unauthorized => MqttV311ConnectReturnCode.NotAuthorized, + WebPubSubErrorCode.UserError => MqttV311ConnectReturnCode.BadUsernameOrPassword, + WebPubSubErrorCode.ServerError => MqttV311ConnectReturnCode.ServerUnavailable, + _ => throw new ArgumentOutOfRangeException(nameof(code), code, null) + }; + } + + public static MqttV500ConnectReasonCode ToMqttV500ConnectReasonCode(this WebPubSubErrorCode code) + { + return code switch + { + WebPubSubErrorCode.Unauthorized => MqttV500ConnectReasonCode.NotAuthorized, + WebPubSubErrorCode.UserError => MqttV500ConnectReasonCode.BadUserNameOrPassword, + WebPubSubErrorCode.ServerError => MqttV500ConnectReasonCode.ServerUnavailable, + _ => throw new ArgumentOutOfRangeException(nameof(code), code, null) + }; + } + + public static WebPubSubErrorCode FromMqttV311ConnectReturnCode(MqttV311ConnectReturnCode code) + { + return code switch + { + //MqttV311ConnectReturnCode.ConnectionAccepted => throw new ArgumentOutOfRangeException(nameof(code), $"MQTT 'ConnectionAccepted' return code cannot be converted to a Web PubSub error code."), + MqttV311ConnectReturnCode.UnacceptableProtocolVersion => WebPubSubErrorCode.UserError, + MqttV311ConnectReturnCode.IdentifierRejected => WebPubSubErrorCode.UserError, + MqttV311ConnectReturnCode.ServerUnavailable => WebPubSubErrorCode.ServerError, + MqttV311ConnectReturnCode.BadUsernameOrPassword => WebPubSubErrorCode.UserError, + MqttV311ConnectReturnCode.NotAuthorized => WebPubSubErrorCode.Unauthorized, + _ => throw new ArgumentOutOfRangeException(nameof(code), code, null) + }; + } + + public static WebPubSubErrorCode FromMqttV500ConnectReasonCode(this MqttV500ConnectReasonCode code) + { + return code switch + { + // Map to Unauthorized + MqttV500ConnectReasonCode.NotAuthorized => WebPubSubErrorCode.Unauthorized, + + // Map to UserError + MqttV500ConnectReasonCode.BadUserNameOrPassword => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.ClientIdentifierNotValid => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.MalformedPacket => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.UnsupportedProtocolVersion => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.BadAuthenticationMethod => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.TopicNameInvalid => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.PayloadFormatInvalid => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.Banned => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.ConnectionRateExceeded => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.ImplementationSpecificError => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.PacketTooLarge => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.QuotaExceeded => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.RetainNotSupported => WebPubSubErrorCode.UserError, + MqttV500ConnectReasonCode.QosNotSupported => WebPubSubErrorCode.UserError, + + // Map to ServerError + MqttV500ConnectReasonCode.UseAnotherServer => WebPubSubErrorCode.ServerError, + MqttV500ConnectReasonCode.ServerMoved => WebPubSubErrorCode.ServerError, + MqttV500ConnectReasonCode.ServerUnavailable => WebPubSubErrorCode.ServerError, + MqttV500ConnectReasonCode.ServerBusy => WebPubSubErrorCode.ServerError, + MqttV500ConnectReasonCode.UnspecifiedError => WebPubSubErrorCode.ServerError, + + // These don't directly map and will throw an exception. + //MqttV50ConnectReasonCode.Success => throw new ArgumentOutOfRangeException(nameof(code), code, "Success is not an error"), + MqttV500ConnectReasonCode.ProtocolError => throw new ArgumentOutOfRangeException(nameof(code), code, "Protocol Error"), + + _ => throw new ArgumentOutOfRangeException(nameof(code), code, "Unsupported MqttV500ConnectReasonCode") + }; + } +} diff --git a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/WebPubSubClientCertificate.cs b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/WebPubSubClientCertificate.cs index 717c3833dad7..07c4764fbe8f 100644 --- a/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/WebPubSubClientCertificate.cs +++ b/sdk/webpubsub/Microsoft.Azure.WebPubSub.Common/src/WebPubSubClientCertificate.cs @@ -1,23 +1,37 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System.Runtime.Serialization; using System.Text.Json.Serialization; +#nullable enable + namespace Microsoft.Azure.WebPubSub.Common { /// /// Client certificate info. /// [JsonConverter(typeof(WebPubSubClientCertificateJsonConverter))] + [DataContract] public sealed class WebPubSubClientCertificate { internal const string ThumbprintProperty = "thumbprint"; + internal const string ContentProperty = "content"; /// /// Certificate thumbprint. /// [JsonPropertyName(ThumbprintProperty)] + // As the released version already used PascalCase, we keep it for backward-compatibility. + [DataMember] public string Thumbprint { get; } + /// + /// Certificate content. + /// + [JsonPropertyName(ContentProperty)] + [DataMember(Name = ContentProperty)] + public string? Content { get; } + /// /// Create an instance of WebPubSubClientCertificate. /// @@ -26,5 +40,16 @@ public WebPubSubClientCertificate(string thumbprint) { Thumbprint = thumbprint; } + + /// + /// Initializes a new instance of the class. + /// + /// + /// + public WebPubSubClientCertificate(string thumbprint, string? content) + { + Content = content; + Thumbprint = thumbprint; + } } }