diff --git a/eng/scripts/Automation-Sdk-Init.ps1 b/eng/scripts/Automation-Sdk-Init.ps1 index f0dc155ae037..c9e93380612b 100644 --- a/eng/scripts/Automation-Sdk-Init.ps1 +++ b/eng/scripts/Automation-Sdk-Init.ps1 @@ -44,3 +44,5 @@ $dotnet = Join-Path $RepoRoot "../.dotnet" if (Test-Path $installScript) { Remove-Item $installScript } + +# npm install -g @azure-tools/cadl-csharp \ No newline at end of file diff --git a/eng/scripts/Invoke-GenerateAndBuildV2.ps1 b/eng/scripts/Invoke-GenerateAndBuildV2.ps1 index 8d4fde0a1ce0..22f896cff830 100644 --- a/eng/scripts/Invoke-GenerateAndBuildV2.ps1 +++ b/eng/scripts/Invoke-GenerateAndBuildV2.ps1 @@ -22,8 +22,8 @@ please refer to eng/scripts/automation/unified-pipeline-test.md for more test sc #> param ( - [string]$inputJsonFile, - [string]$outputJsonFile + [string]$inputJsonFile="./eng/scripts/tests/firstOnboardInput.json", + [string]$outputJsonFile="output.json" ) . (Join-Path $PSScriptRoot ".." "common" "scripts" "Helpers" PSModule-Helpers.ps1) @@ -41,6 +41,7 @@ $commitid = $inputJson.headSha $repoHttpsUrl = $inputJson.repoHttpsUrl $downloadUrlPrefix = $inputJson.installInstructionInput.downloadUrlPrefix $autorestConfig = $inputJson.autorestConfig +$relatedCadlProjectFolder = $inputJson.relatedCadlProjectFolder $autorestConfigYaml = "" if ($autorestConfig) { @@ -108,6 +109,45 @@ if ($inputFileToGen) { UpdateExistingSDKByInputFiles -inputFilePaths $inputFileToGen -sdkRootPath $sdkPath -headSha $commitid -repoHttpsUrl $repoHttpsUrl -downloadUrlPrefix "$downloadUrlPrefix" -generatedSDKPackages $generatedSDKPackages } +# generate sdk from cadl file +if ($relatedCadlProjectFolder) { + # Push-Location $swaggerDir + # npm install @azure-tools/cadl-csharp + # Pop-Location + for ($i = 0; $i -le $relatedCadlProjectFolder.Count - 1; $i++) { + $caldFolder = (Join-Path $swaggerDir $relatedCadlProjectFolder[$i]) -replace "\\", "/" + $newPackageOutput = "newPackageOutput.json" + + Push-Location $caldFolder + $cadlProjectYaml = Get-Content -Path "$caldFolder/cadl-project.yaml" -Raw + + Install-ModuleIfNotInstalled "powershell-yaml" "0.4.1" | Import-Module + $yml = ConvertFrom-YAML $cadlProjectYaml + $sdkFolder = $yml["emitters"]["@azure-tools/cadl-csharp"]["sdk-folder"] + $projectFolder = (Join-Path $sdkPath $sdkFolder) + $projectFolder = $projectFolder -replace "\\", "/" + if ($projectFolder) { + $directories = $projectFolder.Split("/"); + $count = $directories.Count + $projectFolder = $directories[0 .. ($count-2)] -join "/" + $service = $directories[-3]; + $namespace = $directories[-2]; + } + New-CADLPackageFolder -service $service -namespace $namespace -sdkPath $sdkPath -cadlInput $caldFolder/main.cadl -outputJsonFile $newpackageoutput + $newPackageOutputJson = Get-Content $newPackageOutput | Out-String | ConvertFrom-Json + $relativeSdkPath = $newPackageOutputJson.path + # node $swaggerDir/node_modules/@cadl-lang/compiler/cmd/cadl.js compile --emit @azure-tools/cadl-csharp --output-path $sdkPath .\main.cadl + + # node $swaggerDir/node_modules/@cadl-lang/compiler/cmd/cadl.js compile --output-path $sdkPath --emit @azure-tools/cadl-csharp ./main.cadl + npm install + npx cadl compile --output-path $sdkPath --emit @azure-tools/cadl-csharp . + if ( !$?) { + Throw "Failed to generate sdk for cadl. exit code: $?" + } + GeneratePackage -projectFolder $projectFolder -sdkRootPath $sdkPath -path $relativeSdkPath -downloadUrlPrefix "$downloadUrlPrefix" -skipGenerate -generatedSDKPackages $generatedSDKPackages + Pop-Location + } +} $outputJson = [PSCustomObject]@{ packages = $generatedSDKPackages } diff --git a/eng/scripts/automation/GenerateAndBuildLib.ps1 b/eng/scripts/automation/GenerateAndBuildLib.ps1 index bf8013242523..8515b8084075 100644 --- a/eng/scripts/automation/GenerateAndBuildLib.ps1 +++ b/eng/scripts/automation/GenerateAndBuildLib.ps1 @@ -357,6 +357,100 @@ function New-MgmtPackageFolder() { return $projectFolder } +function New-CADLPackageFolder() { + param( + [string]$service, + [string]$namespace, + [string]$sdkPath = "", + [string]$cadlInput ="", + [string]$outputJsonFile = "output.json" + ) + $serviceFolder = (Join-Path $sdkPath "sdk" $service) + $projectFolder=(Join-Path $sdkPath "sdk" $service $namespace) + $ciymlFilePath =(Join-Path $sdkPath "sdk" $service $CI_YAML_FILE) + $apifolder = (Join-Path $projectFolder "api") + Write-Host "projectFolder:$projectFolder, apifolder:$apifolder" + if ((Test-Path -Path $projectFolder) -And (Test-Path -Path $apifolder)) { + Write-Host "Path exists!" + if (Test-Path -Path $projectFolder/src/autorest.md) { + Remove-Item -Path $projectFolder/src/autorest.md + } + $projFile = (Join-Path $projectFolder "src" "$namespace.csproj") + $fileContent = Get-Content -Path $projFile + $match = ($fileContent | Select-String -Pattern "").LineNumber + if ($match.count -gt 0) { + $fileContent[$match[0] - 1] = "$cadlInput"; + } else { + $startNum = ($fileContent | Select-String -Pattern '').LineNumber[0] + $fileContent[$startNum - 2] += ([Environment]::NewLine + "$cadlInput") + } + $fileContent | Out-File $projFile + + Update-CIYmlFile -ciFilePath $ciymlFilePath -artifact $namespace + } else { + Write-Host "Path doesn't exist. create template." + dotnet new -i $sdkPath/sdk/template + Write-Host "Create project folder $projectFolder" + if (Test-Path -Path $projectFolder) { + Remove-Item -Path $projectFolder -ItemType Directory + } + + Push-Location $serviceFolder + $namespaceArray = $namespace.Split(".") + if ( $namespaceArray.Count -lt 3) { + Throw "Error: invalid namespace name." + } + + $endIndex = $namespaceArray.Count - 2 + $clientName = $namespaceArray[-1] + $groupName = $namespaceArray[1..$endIndex] -join "." + $dotnetNewCmd = "dotnet new azsdkdpg --name $namespace --clientName $clientName --groupName $groupName --serviceDirectory $service --force" + + if (Test-Path -Path $ciymlFilePath) { + Write-Host "ci.yml already exists. update it to include the new serviceDirectory." + Update-CIYmlFile -ciFilePath $ciymlFilePath -artifact $namespace + + $dotnetNewCmd = $dotnetNewCmd + " --includeCI false" + } + # dotnet new azsdkdpg --name $namespace --clientName $clientName --groupName $groupName --serviceDirectory $service --swagger $inputfile --securityScopes $securityScope --securityHeaderName $securityHeaderName --includeCI true --force + Write-Host "Invoke dotnet new command: $dotnetNewCmd" + Invoke-Expression $dotnetNewCmd + + $projFile = (Join-Path $projectFolder "src" "$namespace.csproj") + $fileContent = Get-Content -Path $projFile + $fileContent = $fileContent -replace "*.*.*-*.*", "1.0.0-beta.1" + $startNum = ($fileContent | Select-String -Pattern '').LineNumber[0] + $fileContent[$startNum - 2] += ([Environment]::NewLine + "$cadlInput") + $fileContent | Out-File $projFile + # (Get-Content $projFile) -replace "*.*.*-*.*", "1.0.0-beta.1" | -replace "*", "$cadlInput" |Set-Content $projFile + Pop-Location + # dotnet sln + Push-Location $projectFolder + if (Test-Path -Path $projectFolder/src/autorest.md) { + Remove-Item -Path $projectFolder/src/autorest.md + } + dotnet sln remove src/$namespace.csproj + dotnet sln add src/$namespace.csproj + dotnet sln remove tests/$namespace.Tests.csproj + dotnet sln add tests/$namespace.Tests.csproj + Pop-Location + } + + Push-Location $sdkPath + $relativeFolderPath = Resolve-Path $projectFolder -Relative + Pop-Location + + $outputJson = [PSCustomObject]@{ + service = $service + packageName = $namespace + projectFolder = $projectFolder + path = @($relativeFolderPath) + } + + $outputJson | ConvertTo-Json -depth 100 | Out-File $outputJsonFile + return $projectFolder +} + function Get-ResourceProviderFromReadme($readmeFile) { $readmeFile = $readmeFile -replace "\\", "/" $pathArray = $readmeFile.Split("/"); @@ -523,6 +617,7 @@ function GeneratePackage() [string]$sdkRootPath, [string]$path, [string]$downloadUrlPrefix="", + [switch]$skipGenerate, [object]$generatedSDKPackages ) @@ -540,7 +635,9 @@ function GeneratePackage() # Generate Code Write-Host "Start to generate sdk $projectFolder" $srcPath = Join-Path $projectFolder 'src' - dotnet build /t:GenerateCode $srcPath + if (!$skipGenerate) { + dotnet build /t:GenerateCode $srcPath + } if ( !$?) { Write-Error "Failed to generate sdk. exit code: $?" $result = "failed" diff --git a/eng/scripts/automation/Invoke-GenerateAndBuild.ps1 b/eng/scripts/automation/Invoke-GenerateAndBuild.ps1 index 7a25d8fdef06..59672449274a 100644 --- a/eng/scripts/automation/Invoke-GenerateAndBuild.ps1 +++ b/eng/scripts/automation/Invoke-GenerateAndBuild.ps1 @@ -22,9 +22,10 @@ $downloadUrlPrefix = $inputJson.installInstructionInput.downloadUrlPrefix $autorestConfig = $inputJson.autorestConfig $autorestConfig = $inputJson.autorestConfig +$relatedCadlProjectFolder = $inputJson.relatedCadlProjectFolder $autorestConfigYaml = "" -if ($autorestConfig -ne "") { +if ($autorestConfig) { $autorestConfig | Set-Content "config.md" $autorestConfigYaml = Get-Content -Path .\config.md $range = ($autorestConfigYaml | Select-String -Pattern '```').LineNumber @@ -41,27 +42,62 @@ if ($autorestConfig -ne "") { } } -Write-Host "swaggerDir:$swaggerDir, readmeFile:$readmeFile" +$generatedSDKPackages = New-Object 'Collections.Generic.List[System.Object]' # $service, $serviceType = Get-ResourceProviderFromReadme $readmeFile $sdkPath = (Join-Path $PSScriptRoot .. .. ..) $sdkPath = Resolve-Path $sdkPath $sdkPath = $sdkPath -replace "\\", "/" -$readme = "" -if ($commitid -ne "") { - if ($repoHttpsUrl -ne "") { - $readme = "$repoHttpsUrl/blob/$commitid/$readmeFile" +if ($readmeFile) { + Write-Host "swaggerDir:$swaggerDir, readmeFile:$readmeFile" + + $readme = "" + if ($commitid -ne "") { + if ($repoHttpsUrl -ne "") { + $readme = "$repoHttpsUrl/blob/$commitid/$readmeFile" + } else { + $readme = "https://github.com/$org/azure-rest-api-specs/blob/$commitid/$readmeFile" + } } else { - $readme = "https://github.com/$org/azure-rest-api-specs/blob/$commitid/$readmeFile" + $readme = (Join-Path $swaggerDir $readmeFile) } -} else { - $readme = (Join-Path $swaggerDir $readmeFile) + Invoke-GenerateAndBuildSDK -readmeAbsolutePath $readme -sdkRootPath $sdkPath -autorestConfigYaml "$autorestConfigYaml" -downloadUrlPrefix "$downloadUrlPrefix" -generatedSDKPackages $generatedSDKPackages } -$generatedSDKPackages = New-Object 'Collections.Generic.List[System.Object]' -Invoke-GenerateAndBuildSDK -readmeAbsolutePath $readme -sdkRootPath $sdkPath -autorestConfigYaml "$autorestConfigYaml" -downloadUrlPrefix "$downloadUrlPrefix" -generatedSDKPackages $generatedSDKPackages +if ($relatedCadlProjectFolder) { + $caldFolder = (Join-Path $swaggerDir $relatedCadlProjectFolder) -replace "\\", "/" + $newPackageOutput = "newPackageOutput.json" + + Push-Location $caldFolder + $cadlProjectYaml = Get-Content -Path "$caldFolder/cadl-project.yaml" -Raw + Install-ModuleIfNotInstalled "powershell-yaml" "0.4.1" | Import-Module + $yml = ConvertFrom-YAML $cadlProjectYaml + $sdkFolder = $yml["emitters"]["@azure-tools/cadl-csharp"]["sdk-folder"] + $projectFolder = (Join-Path $sdkPath $sdkFolder) + $projectFolder = $projectFolder -replace "\\", "/" + if ($projectFolder) { + $directories = $projectFolder.Split("/"); + $count = $directories.Count + $projectFolder = $directories[0 .. ($count-2)] -join "/" + $service = $directories[-3]; + $namespace = $directories[-2]; + } + New-CADLPackageFolder -service $service -namespace $namespace -sdkPath $sdkPath -cadlInput $caldFolder/main.cadl -outputJsonFile $newpackageoutput + $newPackageOutputJson = Get-Content $newPackageOutput | Out-String | ConvertFrom-Json + $relativeSdkPath = $newPackageOutputJson.path + # node $swaggerDir/node_modules/@cadl-lang/compiler/cmd/cadl.js compile --emit @azure-tools/cadl-csharp --output-path $sdkPath .\main.cadl + + # node $swaggerDir/node_modules/@cadl-lang/compiler/cmd/cadl.js compile --output-path $sdkPath --emit @azure-tools/cadl-csharp ./main.cadl + npm install + npx cadl compile --output-path $sdkPath --emit @azure-tools/cadl-csharp . + if ( !$?) { + Throw "Failed to generate sdk for cadl. exit code: $?" + } + GeneratePackage -projectFolder $projectFolder -sdkRootPath $sdkPath -path $relativeSdkPath -downloadUrlPrefix "$downloadUrlPrefix" -skipGenerate -generatedSDKPackages $generatedSDKPackages + Pop-Location +} $outputJson = [PSCustomObject]@{ packages = $generatedSDKPackages } diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj index 6b2f15958ff0..8cf44ef7f8fe 100644 --- a/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedger/src/Azure.Security.ConfidentialLedger.csproj @@ -4,7 +4,7 @@ Azure Confidential Ledger 1.1.0-beta.2 - 1.0.0 + Azure ConfidentialLedger $(RequiredTargetFrameworks) $(DefineConstants) diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/Azure.Security.ConfidentialLedgerDemo.sln b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/Azure.Security.ConfidentialLedgerDemo.sln new file mode 100644 index 000000000000..0084999ab047 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/Azure.Security.ConfidentialLedgerDemo.sln @@ -0,0 +1,69 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{F496793D-E397-4B77-869A-71287E62A92D}") = "Azure.Security.ConfidentialLedgerDemo.Perf", "perf\Azure.Security.ConfidentialLedgerDemo.Perf.csproj", "{30C5FF85-655A-49FC-A324-16438130FF3F}" +EndProject +Project("{F496793D-E397-4B77-869A-71287E62A92D}") = "Azure.Security.ConfidentialLedgerDemo.Stress", "stress\Azure.Security.ConfidentialLedgerDemo.Stress.csproj", "{47E3BC66-5C4F-47CD-A37B-A973E54BCBA9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Security.ConfidentialLedgerDemo", "src\Azure.Security.ConfidentialLedgerDemo.csproj", "{33A76AED-02F0-479D-9AF0-07034633E1F1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Security.ConfidentialLedgerDemo.Tests", "tests\Azure.Security.ConfidentialLedgerDemo.Tests.csproj", "{56049BA5-6383-45B9-A7B5-F613036CB7F1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {30C5FF85-655A-49FC-A324-16438130FF3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {30C5FF85-655A-49FC-A324-16438130FF3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {30C5FF85-655A-49FC-A324-16438130FF3F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {30C5FF85-655A-49FC-A324-16438130FF3F}.Release|Any CPU.Build.0 = Release|Any CPU + {47E3BC66-5C4F-47CD-A37B-A973E54BCBA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {47E3BC66-5C4F-47CD-A37B-A973E54BCBA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47E3BC66-5C4F-47CD-A37B-A973E54BCBA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {47E3BC66-5C4F-47CD-A37B-A973E54BCBA9}.Release|Any CPU.Build.0 = Release|Any CPU + {33A76AED-02F0-479D-9AF0-07034633E1F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {33A76AED-02F0-479D-9AF0-07034633E1F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {33A76AED-02F0-479D-9AF0-07034633E1F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {33A76AED-02F0-479D-9AF0-07034633E1F1}.Release|Any CPU.Build.0 = Release|Any CPU + {56049BA5-6383-45B9-A7B5-F613036CB7F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56049BA5-6383-45B9-A7B5-F613036CB7F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56049BA5-6383-45B9-A7B5-F613036CB7F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56049BA5-6383-45B9-A7B5-F613036CB7F1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/CHANGELOG.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/CHANGELOG.md new file mode 100644 index 000000000000..13dd08af78ab --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/Directory.Build.props b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/Directory.Build.props new file mode 100644 index 000000000000..1a9611bd4924 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/README.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/README.md new file mode 100644 index 000000000000..3abf0b0e3124 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/README.md @@ -0,0 +1,90 @@ +# Azure ConfidentialLedgerDemo client library for .NET + +This section should give out brief introduction of the client library. + +* First sentence: **Describe the service** briefly. You can usually use the first line of the service's docs landing page for this (Example: [Cosmos DB docs landing page](https://docs.microsoft.com/azure/cosmos-db/)). +* Next, add a **bulleted list** of the **most common tasks** supported by the package or library, prefaced with "Use the client library for [Product Name] to:". Then, provide code snippets for these tasks in the [Examples](#examples) section later in the document. Keep the task list short but include those tasks most developers need to perform with your package. + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src) | [Package (NuGet)](https://www.nuget.org/packages/Azure.Security.ConfidentialLedgerDemo) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Security.ConfidentialLedgerDemo --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/samples). + +### + +You can create a client and call the client's `` method. + +```C# Snippet:Azure_Security_ConfidentialLedgerDemo_Scenario +``` + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/README.png) \ No newline at end of file diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/api/Azure.Security.ConfidentialLedgerDemo.netstandard2.0.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/api/Azure.Security.ConfidentialLedgerDemo.netstandard2.0.cs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/perf/Azure.Security.ConfidentialLedgerDemo.Perf.csproj b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/perf/Azure.Security.ConfidentialLedgerDemo.Perf.csproj new file mode 100644 index 000000000000..011f0c94868d --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/perf/Azure.Security.ConfidentialLedgerDemo.Perf.csproj @@ -0,0 +1,16 @@ + + + + Exe + + + + + + + + + + + + diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/perf/ConfidentialLedgerDemoClientTest.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/perf/ConfidentialLedgerDemoClientTest.cs new file mode 100644 index 000000000000..4ae633105d7a --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/perf/ConfidentialLedgerDemoClientTest.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Identity; +using Azure.Test.Perf; +using CommandLine; + +namespace Azure.Security.ConfidentialLedgerDemo.Perf +{ + public class ConfidentialLedgerDemoClientTest : PerfTest + { + /* please refer to https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/perf/TemplateClientTest.cs to write perf test. */ + + public ConfidentialLedgerDemoClientTest(ConfidentialLedgerDemoClientPerfOptions options) : base(options) + { + } + public class ConfidentialLedgerDemoClientPerfOptions : PerfOptions + { + } + + public override void Run(CancellationToken cancellationToken) + { + } + + public override async Task RunAsync(CancellationToken cancellationToken) + { + await Task.Run(() => + { + Console.WriteLine("exec some async operation"); + }); + } + } +} diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/perf/Program.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/perf/Program.cs new file mode 100644 index 000000000000..78a52ddce190 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/perf/Program.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using Azure.Test.Perf; + + await PerfProgram.Main(Assembly.GetEntryAssembly(), args); diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/samples/README.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/samples/README.md new file mode 100644 index 000000000000..583863c800ec --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/samples/README.md @@ -0,0 +1,14 @@ +--- +page_type: sample +languages: +- csharp +products: +# Including relevant stubs from https://review.docs.microsoft.com/help/contribute/metadata-taxonomies#product +- azure +name: Azure.Security.ConfidentialLedgerDemo samples for .NET +description: Samples for the Azure.Security.ConfidentialLedgerDemo client library. +--- + +# Azure.Security.ConfidentialLedgerDemo Samples + + diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/samples/Sample1_HelloWorld.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/samples/Sample1_HelloWorld.md new file mode 100644 index 000000000000..e24f2de29e2a --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/samples/Sample1_HelloWorld.md @@ -0,0 +1,15 @@ +# + +To use these samples, you'll first need to set up resources. See [getting started](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/README.md#getting-started) for details. + +## + +You can create a client and call the client's `` method + +```C# Snippet:Azure_Security_ConfidentialLedgerDemo_Scenario +``` + +To see the full example source files, see: +* [HelloWorld](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Samples/Sample1_HelloWorld.cs)) + + \ No newline at end of file diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/samples/Sample1_HelloWorldAsync.md b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/samples/Sample1_HelloWorldAsync.md new file mode 100644 index 000000000000..9517f55f240a --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/samples/Sample1_HelloWorldAsync.md @@ -0,0 +1,15 @@ +# + +To use these samples, you'll first need to set up resources. See [getting started](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/README.md#getting-started) for details. + +## asynchronously + +You can create a client and call the client's `` method + +```C# Snippet:Azure_Security_ConfidentialLedgerDemo_ScenarioAsync +``` + +To see the full example source files, see: +* [HelloWorld](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Samples/Sample1_HelloWorldAsync.cs)) + + \ No newline at end of file diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/Azure.Security.ConfidentialLedgerDemo.csproj b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/Azure.Security.ConfidentialLedgerDemo.csproj new file mode 100644 index 000000000000..0f09c0f44cb3 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/Azure.Security.ConfidentialLedgerDemo.csproj @@ -0,0 +1,23 @@ + + + This is the ConfidentialLedgerDemo client library for developing .NET applications with rich experience. + Azure SDK Code Generation ConfidentialLedgerDemo for Azure Data Plane + 1.0.0-beta.1 + Azure ConfidentialLedgerDemo + $(RequiredTargetFrameworks) + true +/spec-repo/specification/confidentialledger/ConfientialLedger/main.cadl + + + + + + + + + + + + + + diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/Generated/Configuration.json b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/Generated/Configuration.json new file mode 100644 index 000000000000..bffec785c300 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/Generated/Configuration.json @@ -0,0 +1,9 @@ +{ + "OutputFolder": ".", + "Namespace": "Azure.Security.ConfidentialLedger", + "LibraryName": null, + "SharedSourceFolders": [ + "../../../../../../spec-repo/specification/confidentialledger/ConfientialLedger/node_modules/@autorest/csharp/Generator.Shared", + "../../../../../../spec-repo/specification/confidentialledger/ConfientialLedger/node_modules/@autorest/csharp/Azure.Core.Shared" + ] +} diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/Generated/cadl.json b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/Generated/cadl.json new file mode 100644 index 000000000000..7ce8818bb163 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/Generated/cadl.json @@ -0,0 +1,1757 @@ +{ + "$id": "1", + "Name": "Azure.Security.ConfidentialLedger", + "ApiVersions": [ + "2022-08-13" + ], + "Enums": [ + { + "$id": "2", + "Name": "LedgerQueryState", + "Namespace": "Azure.Security.ConfidentialLedger", + "Description": "State of a ledger query.", + "EnumValueType": "String", + "AllowedValues": [ + { + "$id": "3", + "Name": "Loading", + "Value": "Loading" + }, + { + "$id": "4", + "Name": "Ready", + "Value": "Ready" + } + ], + "IsExtensible": true, + "IsNullable": false, + "Usage": "RoundTrip" + }, + { + "$id": "5", + "Name": "TransactionState", + "Namespace": "Azure.Security.ConfidentialLedger", + "Description": "Represents the state of the transaction.", + "EnumValueType": "String", + "AllowedValues": [ + { + "$id": "6", + "Name": "Committed", + "Value": "Committed" + }, + { + "$id": "7", + "Name": "Pending", + "Value": "Pending" + } + ], + "IsExtensible": true, + "IsNullable": false, + "Usage": "RoundTrip" + }, + { + "$id": "8", + "Name": "LedgerUserRole", + "Namespace": "Azure.Security.ConfidentialLedger", + "Description": "Represents an assignable role.", + "EnumValueType": "String", + "AllowedValues": [ + { + "$id": "9", + "Name": "Administrator", + "Value": "Administrator" + }, + { + "$id": "10", + "Name": "Contributor", + "Value": "Contributor" + }, + { + "$id": "11", + "Name": "Reader", + "Value": "Reader" + } + ], + "IsExtensible": true, + "IsNullable": false, + "Usage": "RoundTrip" + } + ], + "Models": [ + { + "$id": "12", + "Name": "CollectionModel", + "Namespace": "Azure.Security.ConfidentialLedger", + "Description": "Identifier for collections.", + "IsNullable": false, + "Usage": "None", + "Properties": [ + { + "$id": "13", + "Name": "collectionId", + "SerializedName": "collectionId", + "Description": "", + "Type": { + "$id": "14", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + }, + { + "$id": "15", + "Name": "PagedLedgerEntries", + "Namespace": "Azure.Security.ConfidentialLedger", + "Description": "Paginated ledger entries returned in response to a query.", + "IsNullable": false, + "Usage": "None", + "Properties": [ + { + "$id": "16", + "Name": "entries", + "SerializedName": "entries", + "Description": "", + "Type": { + "$id": "17", + "Name": "Array", + "ElementType": { + "$id": "18", + "Name": "LedgerEntry", + "Namespace": "Azure.Security.ConfidentialLedger", + "IsNullable": false, + "Usage": "None", + "Properties": [ + { + "$id": "19", + "Name": "contents", + "SerializedName": "contents", + "Description": "", + "Type": { + "$id": "20", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "21", + "Name": "collectionId", + "SerializedName": "collectionId", + "Description": "", + "Type": { + "$id": "22", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": true, + "IsDiscriminator": false + }, + { + "$id": "23", + "Name": "transactionId", + "SerializedName": "transactionId", + "Description": "", + "Type": { + "$id": "24", + "Name": "TransactionId", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": true, + "IsDiscriminator": false + } + ] + }, + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "25", + "Name": "state", + "SerializedName": "state", + "Description": "", + "Type": { + "$ref": "2" + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "26", + "Name": "nextLink", + "SerializedName": "nextLink", + "Description": "", + "Type": { + "$id": "27", + "Name": "ResourceLocation", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": false, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + }, + { + "$ref": "18" + }, + { + "$id": "28", + "Name": "TransactionReceipt", + "Namespace": "Azure.Security.ConfidentialLedger", + "Description": "A receipt certifying the transaction at the specified id.", + "IsNullable": false, + "Usage": "None", + "Properties": [ + { + "$id": "29", + "Name": "receipt", + "SerializedName": "receipt", + "Description": "", + "Type": { + "$id": "30", + "Name": "ReceiptContents", + "Namespace": "Azure.Security.ConfidentialLedger", + "IsNullable": false, + "Usage": "None", + "Properties": [] + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "31", + "Name": "state", + "SerializedName": "state", + "Description": "", + "Type": { + "$ref": "2" + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "32", + "Name": "transactionId", + "SerializedName": "transactionId", + "Description": "", + "Type": { + "$id": "33", + "Name": "TransactionId", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + }, + { + "$ref": "30" + }, + { + "$id": "34", + "Name": "TransactionStatus", + "Namespace": "Azure.Security.ConfidentialLedger", + "Description": "Response returned to a query for the transaction status.", + "IsNullable": false, + "Usage": "None", + "Properties": [ + { + "$id": "35", + "Name": "state", + "SerializedName": "state", + "Description": "", + "Type": { + "$ref": "5" + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "36", + "Name": "transactionId", + "SerializedName": "transactionId", + "Description": "", + "Type": { + "$id": "37", + "Name": "TransactionId", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + }, + { + "$id": "38", + "Name": "LedgerUser", + "Namespace": "Azure.Security.ConfidentialLedger", + "Description": "Details about a Confidential ledger user.", + "IsNullable": false, + "Usage": "None", + "Properties": [ + { + "$id": "39", + "Name": "userId", + "SerializedName": "userId", + "Description": "", + "Type": { + "$id": "40", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + }, + { + "$id": "41", + "Name": "assignedRole", + "SerializedName": "assignedRole", + "Description": "", + "Type": { + "$ref": "8" + }, + "IsRequired": true, + "IsReadOnly": false, + "IsDiscriminator": false + } + ] + } + ], + "Clients": [ + { + "$id": "42", + "Name": "ConfidentialLedger", + "Operations": [ + { + "$id": "43", + "Name": "listCollections", + "Summary": "Retrieves a list of collection ids present in the Confidential Ledger", + "Description": "Collection ids are user-created collections of ledger entries", + "Parameters": [ + { + "$id": "44", + "Name": "ledgerUri", + "NameInRequest": "ledgerUri", + "Type": { + "$id": "45", + "Name": "Uri", + "Kind": "Uri", + "IsNullable": false + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "46", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "47", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$id": "48", + "Type": { + "$id": "49", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Value": "2022-08-13" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "50", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "51", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "52", + "Type": { + "$ref": "51" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "53", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$id": "54", + "Name": "Array", + "ElementType": { + "$ref": "12" + }, + "IsNullable": false + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/collections", + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "55", + "Name": "getEnclaveQuotes", + "Summary": "Gets quotes for all nodes of the Confidential Ledger.", + "Description": "A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "56", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "57", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "58", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "59", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "60", + "Type": { + "$ref": "59" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "61", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/enclaveQuotes", + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "62", + "Name": "getConstitution", + "Summary": "Gets the constitution used for governance.", + "Description": "The constitution is a script that assesses and applies proposals from consortium members.", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "63", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "64", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "65", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "66", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "67", + "Type": { + "$ref": "66" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "68", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/governance/constitution", + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "69", + "Name": "getConsortiumMembers", + "Summary": "Gets the consortium members.", + "Description": "Consortium members can manage the Confidential Ledger.", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "70", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "71", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "72", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "73", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "74", + "Type": { + "$ref": "73" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "75", + "StatusCodes": [ + 200 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/governance/members", + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "76", + "Name": "listLedgerEntries", + "Summary": "Gets ledger entries from a collection corresponding to a range.", + "Description": "A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "77", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "78", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "79", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "80", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "81", + "Type": { + "$ref": "80" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "82", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "15" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/transactions", + "BufferResponse": true, + "Paging": { + "$id": "83", + "NextLinkName": "nextLink", + "ItemName": "entries" + }, + "GenerateConvenienceMethod": false + }, + { + "$id": "84", + "Name": "createLedgerEntry", + "Summary": "Writes a ledger entry.", + "Description": "A collection id may optionally be specified.", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "85", + "Name": "collectionId", + "NameInRequest": "collectionId", + "Description": "The collection id.", + "Type": { + "$id": "86", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "IsRequired": false, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "87", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "88", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "89", + "Name": "LedgerEntry", + "NameInRequest": "LedgerEntry", + "Type": { + "$ref": "18" + }, + "Location": "Body", + "IsRequired": true, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "90", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Type": { + "$id": "91", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": true, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "92", + "Type": { + "$ref": "91" + }, + "Value": "application/json" + } + }, + { + "$id": "93", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "94", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "95", + "Type": { + "$ref": "94" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "96", + "StatusCodes": [ + 201 + ], + "BodyMediaType": "Json", + "Headers": [ + { + "$id": "97", + "Name": "Location", + "NameInResponse": "location", + "Description": "", + "Type": { + "$id": "98", + "Name": "ResourceLocation", + "Kind": "String", + "IsNullable": false + } + } + ], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/transactions", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "99", + "Name": "getLedgerEntry", + "Summary": "Gets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate the collection from which to fetch the value.", + "Description": "Get a LedgerEntry", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "100", + "Name": "transactionId", + "NameInRequest": "transactionId", + "Type": { + "$id": "101", + "Name": "TransactionId", + "Kind": "String", + "IsNullable": false + }, + "Location": "Path", + "IsRequired": true, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "102", + "Name": "collectionId", + "NameInRequest": "collectionId", + "Description": "The collection id.", + "Type": { + "$id": "103", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "IsRequired": false, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "104", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "105", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "106", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "107", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "108", + "Type": { + "$ref": "107" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "109", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "18" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/transactions/{transactionId}", + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "110", + "Name": "getReceipt", + "Summary": "Gets a receipt certifying ledger contents at a particular transaction id.", + "Description": "Runs a custom action on LedgerEntry", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "111", + "Name": "transactionId", + "NameInRequest": "transactionId", + "Type": { + "$id": "112", + "Name": "TransactionId", + "Kind": "String", + "IsNullable": false + }, + "Location": "Path", + "IsRequired": true, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "113", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "114", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "115", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "116", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "117", + "Type": { + "$ref": "116" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "118", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "28" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/transactions/{transactionId}/receipt", + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "119", + "Name": "getTransactionStatus", + "Summary": "Gets a receipt certifying ledger contents at a particular transaction id.", + "Description": "Runs a custom action on LedgerEntry", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "120", + "Name": "transactionId", + "NameInRequest": "transactionId", + "Type": { + "$id": "121", + "Name": "TransactionId", + "Kind": "String", + "IsNullable": false + }, + "Location": "Path", + "IsRequired": true, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "122", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "123", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "124", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "125", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "126", + "Type": { + "$ref": "125" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "127", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "34" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/transactions/{transactionId}/status", + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "128", + "Name": "getCurrentLedgerEntry", + "Summary": "Gets the current value available in the ledger.", + "Description": "Runs a custom action on LedgerEntry", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "129", + "Name": "collectionId", + "NameInRequest": "collectionId", + "Description": "The collection id.", + "Type": { + "$id": "130", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "IsRequired": false, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "131", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "132", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "133", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "134", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "135", + "Type": { + "$ref": "134" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "136", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "18" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/transactions:getCurrentLedgerEntry", + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "137", + "Name": "deleteUser", + "Summary": "Deletes a user from the Confidential Ledger.", + "Description": "Delete a LedgerUser", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "138", + "Name": "userId", + "NameInRequest": "userId", + "Description": "The user id, either an AAD object ID or certificate fingerprint.", + "Type": { + "$id": "139", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Path", + "IsRequired": true, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "140", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "141", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "142", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "143", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "144", + "Type": { + "$ref": "143" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "145", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "DELETE", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/users/{userId}", + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "146", + "Name": "getUser", + "Summary": "Gets a user.", + "Description": "Get a LedgerUser", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "147", + "Name": "userId", + "NameInRequest": "userId", + "Description": "The user id, either an AAD object ID or certificate fingerprint.", + "Type": { + "$id": "148", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Path", + "IsRequired": true, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "149", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "150", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "151", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "152", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "153", + "Type": { + "$ref": "152" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "154", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "38" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "GET", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/users/{userId}", + "BufferResponse": true, + "GenerateConvenienceMethod": false + }, + { + "$id": "155", + "Name": "createOrUpdateUser", + "Summary": "Adds a user or updates a user's fields.", + "Description": "Creates or updates a LedgerUser", + "Parameters": [ + { + "$ref": "44" + }, + { + "$id": "156", + "Name": "userId", + "NameInRequest": "userId", + "Description": "The user id, either an AAD object ID or certificate fingerprint.", + "Type": { + "$id": "157", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Path", + "IsRequired": true, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "158", + "Name": "content-type", + "NameInRequest": "content-type", + "Type": { + "$id": "159", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "DefaultValue": { + "$id": "160", + "Type": { + "$ref": "159" + }, + "Value": "application/merge-patch+json" + }, + "IsRequired": true, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant" + }, + { + "$id": "161", + "Name": "api-version", + "NameInRequest": "api-version", + "Description": "The API version to use for this operation.", + "Type": { + "$id": "162", + "Name": "string", + "Kind": "String", + "IsNullable": false + }, + "Location": "Query", + "DefaultValue": { + "$ref": "48" + }, + "IsRequired": true, + "IsApiVersion": true, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "163", + "Name": "LedgerUser", + "NameInRequest": "LedgerUser", + "Description": "Details about a Confidential ledger user.", + "Type": { + "$ref": "38" + }, + "Location": "Body", + "IsRequired": true, + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Method" + }, + { + "$id": "164", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "165", + "Name": "String", + "Kind": "String", + "IsNullable": false + }, + "Location": "Header", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Constant", + "DefaultValue": { + "$id": "166", + "Type": { + "$ref": "165" + }, + "Value": "application/json" + } + } + ], + "Responses": [ + { + "$id": "167", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "38" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + }, + { + "$id": "168", + "StatusCodes": [ + 201 + ], + "BodyType": { + "$ref": "38" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "PATCH", + "RequestBodyMediaType": "Json", + "Uri": "{ledgerUri}", + "Path": "/app/users/{userId}", + "RequestMediaTypes": [ + "application/merge-patch+json" + ], + "BufferResponse": true, + "GenerateConvenienceMethod": false + } + ], + "Protocol": { + "$id": "169" + } + } + ], + "Auth": { + "$id": "170", + "OAuth2": { + "$id": "171", + "Scopes": [ + "https://confidential-ledger.azure.com/.default" + ] + } + } +} diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/GlobalSuppressions.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/GlobalSuppressions.cs new file mode 100644 index 000000000000..9b3803f9838c --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/GlobalSuppressions.cs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Usage", "AZC0002:DO ensure all service methods, both asynchronous and synchronous, take an optional CancellationToken parameter called cancellationToken.", Justification = "CancellationToken can be passed through RequestOptions")] \ No newline at end of file diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/properties/AssemblyInfo.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/properties/AssemblyInfo.cs new file mode 100644 index 000000000000..4fe22dda482a --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/src/properties/AssemblyInfo.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +// Replace with test project/test project public key and uncomment to make internal members visible to +// your test project. If not needed, this can be deleted. +// [assembly: InternalsVisibleTo("Azure.Security.ConfidentialLedgerDemo.Generated.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Confidentialledger")] diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/stress/Azure.Security.ConfidentialLedgerDemo.Stress.csproj b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/stress/Azure.Security.ConfidentialLedgerDemo.Stress.csproj new file mode 100644 index 000000000000..1eee64089b29 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/stress/Azure.Security.ConfidentialLedgerDemo.Stress.csproj @@ -0,0 +1,16 @@ + + + + Exe + + + + + + + + + + + + diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/stress/ConfidentialLedgerDemoClientTest.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/stress/ConfidentialLedgerDemoClientTest.cs new file mode 100644 index 000000000000..8e34adffdb8d --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/stress/ConfidentialLedgerDemoClientTest.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Identity; +using Azure.Test.Stress; +using CommandLine; + +namespace Azure.Security.ConfidentialLedgerDemo.Stress +{ + public class ConfidentialLedgerDemoClientTest : StressTest + { + public ConfidentialLedgerDemoClientTest(ConfidentialLedgerDemoClientStressOptions options, ConfidentialLedgerDemoClientStressMetrics metrics) : base(options, metrics) + { + } + + /* please refer to https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/stress/TemplateClientTest.cs to write stress tests. */ + + public override async Task RunAsync(CancellationToken cancellationToken) + { + await Task.Run(() => + { + Console.WriteLine("exec some async operation"); + }); + } + public class ConfidentialLedgerDemoClientStressMetrics : StressMetrics + { + } + + public class ConfidentialLedgerDemoClientStressOptions : StressOptions + { + } + } +} diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/stress/Program.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/stress/Program.cs new file mode 100644 index 000000000000..d25a1b56e291 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/stress/Program.cs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Reflection; +using Azure.Test.Stress; + +await StressProgram.Main(Assembly.GetEntryAssembly(), args); diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Azure.Security.ConfidentialLedgerDemo.Tests.csproj b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Azure.Security.ConfidentialLedgerDemo.Tests.csproj new file mode 100644 index 000000000000..e05d978112f2 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Azure.Security.ConfidentialLedgerDemo.Tests.csproj @@ -0,0 +1,25 @@ + + + $(RequiredTargetFrameworks) + + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/ConfidentialLedgerDemoClientTest.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/ConfidentialLedgerDemoClientTest.cs new file mode 100644 index 000000000000..42b9eb3877bd --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/ConfidentialLedgerDemoClientTest.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.IO; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core.Pipeline; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.Security.ConfidentialLedgerDemo.Tests +{ + public class ConfidentialLedgerDemoClientTest: RecordedTestBase + { + public ConfidentialLedgerDemoClientTest(bool isAsync) : base(isAsync) + { + } + + /* please refer to https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/tests/TemplateClientLiveTests.cs to write tests. */ + + [RecordedTest] + public void TestOperation() + { + Assert.IsTrue(true); + } + + #region Helpers + + private static BinaryData GetContentFromResponse(Response r) + { + // Workaround azure/azure-sdk-for-net#21048, which prevents .Content from working when dealing with responses + // from the playback system. + + MemoryStream ms = new MemoryStream(); + r.ContentStream.CopyTo(ms); + return new BinaryData(ms.ToArray()); + } + #endregion + } +} diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/ConfidentialLedgerDemoClientTestEnvironment.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/ConfidentialLedgerDemoClientTestEnvironment.cs new file mode 100644 index 000000000000..9731eb6df83b --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/ConfidentialLedgerDemoClientTestEnvironment.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.Security.ConfidentialLedgerDemo.Tests +{ + public class ConfidentialLedgerDemoClientTestEnvironment : TestEnvironment + { + public string Endpoint => GetRecordedVariable("ConfidentialLedgerDemo_ENDPOINT"); + + // Add other client paramters here as above. + } +} diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Samples/Sample1_HelloWorld.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Samples/Sample1_HelloWorld.cs new file mode 100644 index 000000000000..e5e6062e3835 --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Samples/Sample1_HelloWorld.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.Security.ConfidentialLedgerDemo.Tests.Samples +{ + public partial class ConfidentialLedgerDemoSamples: SamplesBase + { + /* please refer to https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/tests/Samples/Sample1.HelloWorld.cs to write samples. */ + #region Snippet:Azure_Security_ConfidentialLedgerDemo_Scenario + + #endregion + } +} diff --git a/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Samples/Sample1_HelloWorldAsync.cs b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Samples/Sample1_HelloWorldAsync.cs new file mode 100644 index 000000000000..cf8d5fe3345b --- /dev/null +++ b/sdk/confidentialledger/Azure.Security.ConfidentialLedgerDemo/tests/Samples/Sample1_HelloWorldAsync.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Linq; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using NUnit.Framework; + +namespace Azure.Security.ConfidentialLedgerDemo.Tests.Samples +{ + public partial class ConfidentialLedgerDemoSamples: SamplesBase + { + /* please refer to https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template/tests/Samples/Sample1.HelloWorldAsync.cs to write samples. */ + #region Snippet:Azure_Security_ConfidentialLedgerDemo_ScenarioAsync + + #endregion + } +}