diff --git a/.github/workflows/ci-cd-main.yml b/.github/workflows/ci-cd-main.yml index 52a8bd597..50995fbc1 100644 --- a/.github/workflows/ci-cd-main.yml +++ b/.github/workflows/ci-cd-main.yml @@ -3,7 +3,7 @@ on: workflow_dispatch: push: - branches: [main] + branches: [ main ] concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} @@ -40,7 +40,7 @@ jobs: build-and-test: name: Build and test backend uses: ./.github/workflows/workflow-build-and-test.yml - needs: [check-for-changes] + needs: [ check-for-changes ] if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true' }} publish: @@ -62,7 +62,7 @@ jobs: deploy-infra: name: Deploy infra to test - needs: [get-current-version, check-for-changes, generate-git-short-sha] + needs: [ get-current-version, check-for-changes, generate-git-short-sha ] if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasInfraChanges == 'true' }} uses: ./.github/workflows/workflow-deploy-infra.yml secrets: @@ -108,9 +108,19 @@ jobs: version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }} runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }} + publish-sdk-to-nuget: + uses: ./.github/workflows/workflow-publish-nuget.yml + needs: [ get-current-version, generate-git-short-sha, check-for-changes ] + if: ${{ needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true' }} + with: + version: ${{ needs.get-current-version.outputs.version }}-rc.${{ needs.generate-git-short-sha.outputs.gitShortSha }} + path: $(find . -name '*Digdir.Library.Dialogporten.WebApiClient.csproj' -printf "%p" -quit) + secrets: + NUGET_API_KEY: ${{ secrets.NUGET_API_TEST_KEY }} + deploy-slack-notifier: name: Deploy slack notifier (test) - needs: [check-for-changes] + needs: [ check-for-changes ] if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSlackNotifierChanges == 'true' }} uses: ./.github/workflows/workflow-deploy-function.yml secrets: @@ -126,7 +136,7 @@ jobs: publish-schema-npm: name: Deploy schema npm package - needs: [check-for-changes, get-current-version, generate-git-short-sha, deploy-apps] + needs: [ check-for-changes, get-current-version, generate-git-short-sha, deploy-apps ] if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSchemaChanges == 'true') }} uses: ./.github/workflows/workflow-publish-schema.yml with: @@ -138,7 +148,7 @@ jobs: name: "Run K6 functional end-to-end tests" # we want the end-to-end tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true') }} - needs: [deploy-apps, check-for-changes] + needs: [ deploy-apps, check-for-changes ] uses: ./.github/workflows/workflow-run-k6-tests.yml secrets: TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }} diff --git a/.github/workflows/ci-cd-pull-request.yml b/.github/workflows/ci-cd-pull-request.yml index 67d057123..be4356c0f 100644 --- a/.github/workflows/ci-cd-pull-request.yml +++ b/.github/workflows/ci-cd-pull-request.yml @@ -2,10 +2,9 @@ on: pull_request: - branches: [main] + branches: [ main ] paths-ignore: - "tests/k6/**" - - "CHANGELOG.md" jobs: generate-git-short-sha: @@ -19,15 +18,15 @@ jobs: check-for-changes: name: Check for changes uses: ./.github/workflows/workflow-check-for-changes.yml - + build: uses: ./.github/workflows/workflow-build-and-test.yml - needs: [check-for-changes] + needs: [ check-for-changes ] if: ${{ needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true' }} - + build-infrastructure: uses: ./.github/workflows/workflow-build-infrastructure.yml - needs: [check-for-changes] + needs: [ check-for-changes ] if: ${{ always() && needs.check-for-changes.outputs.hasInfraChanges == 'true' }} secrets: AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} @@ -35,7 +34,7 @@ jobs: AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} with: environment: "test" - + dry-run-deploy-infra: name: Dry run deploy infrastructure uses: ./.github/workflows/workflow-deploy-infra.yml @@ -93,7 +92,7 @@ jobs: delete-github-deployments: name: Delete GitHub deployments uses: ./.github/workflows/workflow-delete-deployments.yml - needs: [dry-run-deploy-apps, dry-run-deploy-infra] + needs: [ dry-run-deploy-apps, dry-run-deploy-infra ] if: ${{ always() && !failure() && !cancelled() }} with: - gitSha: ${{ github.event.pull_request.head.sha }} \ No newline at end of file + gitSha: ${{ github.event.pull_request.head.sha }} diff --git a/.github/workflows/ci-cd-staging.yml b/.github/workflows/ci-cd-staging.yml index 5091b5238..a6816fc8a 100644 --- a/.github/workflows/ci-cd-staging.yml +++ b/.github/workflows/ci-cd-staging.yml @@ -20,7 +20,7 @@ jobs: check-for-changes: name: Check for changes - needs: [get-versions-from-github] + needs: [ get-versions-from-github ] uses: ./.github/workflows/workflow-check-for-changes.yml with: infra_base_sha: ${{ needs.get-versions-from-github.outputs.infra_version_sha }} @@ -33,7 +33,7 @@ jobs: deploy-infra: name: Deploy infra to staging if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasInfraChanges == 'true' }} - needs: [get-current-version, check-for-changes] + needs: [ get-current-version, check-for-changes ] uses: ./.github/workflows/workflow-deploy-infra.yml secrets: AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} @@ -50,7 +50,7 @@ jobs: store-infra-version: name: Store Latest Deployed Infra Version as GitHub Variable - needs: [deploy-infra, get-current-version] + needs: [ deploy-infra, get-current-version ] if: ${{ needs.deploy-infra.result == 'success' }} uses: ./.github/workflows/workflow-store-github-env-variable.yml with: @@ -64,7 +64,7 @@ jobs: name: Build and publish docker images uses: ./.github/workflows/workflow-publish.yml if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true' }} - needs: [get-current-version, check-for-changes] + needs: [ get-current-version, check-for-changes ] secrets: GCR_PASSWORD: ${{ secrets.GITHUB_TOKEN }} with: @@ -74,7 +74,7 @@ jobs: deploy-apps: name: Deploy apps to staging needs: - [get-current-version, check-for-changes, deploy-infra, publish] + [ get-current-version, check-for-changes, deploy-infra, publish ] if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }} uses: ./.github/workflows/workflow-deploy-apps.yml secrets: @@ -93,9 +93,19 @@ jobs: version: ${{ needs.get-current-version.outputs.version }} runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }} + publish-sdk-to-nuget: + uses: ./.github/workflows/workflow-publish-nuget.yml + needs: [ get-current-version, check-for-changes ] + if: ${{ needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true' }} + with: + version: ${{ needs.get-current-version.outputs.version }} + path: $(find . -name '*Digdir.Library.Dialogporten.WebApiClient.csproj' -printf "%p" -quit) + secrets: + NUGET_API_KEY: ${{ secrets.NUGET_API_TEST_KEY }} + store-apps-version: name: Store Latest Deployed Apps Version as GitHub Variable - needs: [deploy-apps, get-current-version] + needs: [ deploy-apps, get-current-version ] if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.deploy-apps.outputs.deployment_executed == 'true') }} uses: ./.github/workflows/workflow-store-github-env-variable.yml with: @@ -107,7 +117,7 @@ jobs: deploy-slack-notifier: name: Deploy slack notifier (staging) - needs: [check-for-changes] + needs: [ check-for-changes ] if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSlackNotifierChanges == 'true' }} uses: ./.github/workflows/workflow-deploy-function.yml secrets: @@ -123,7 +133,7 @@ jobs: publish-schema-npm: name: Publish schema npm package - needs: [check-for-changes, get-current-version, deploy-apps] + needs: [ check-for-changes, get-current-version, deploy-apps ] if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSchemaChanges == 'true') }} uses: ./.github/workflows/workflow-publish-schema.yml with: @@ -135,7 +145,7 @@ jobs: name: "Run K6 functional end-to-end tests" # we want the end-to-end tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true') }} - needs: [deploy-apps, check-for-changes] + needs: [ deploy-apps, check-for-changes ] uses: ./.github/workflows/workflow-run-k6-tests.yml secrets: TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }} @@ -150,7 +160,7 @@ jobs: send-slack-message-on-failure: name: Send Slack message on failure - needs: [deploy-infra, deploy-apps, deploy-slack-notifier, run-e2e-tests, publish-schema-npm, publish] + needs: [ deploy-infra, deploy-apps, deploy-slack-notifier, run-e2e-tests, publish-schema-npm, publish ] if: ${{ always() && failure() && !cancelled() }} uses: ./.github/workflows/workflow-send-ci-cd-status-slack-message.yml with: diff --git a/.github/workflows/workflow-publish-nuget.yml b/.github/workflows/workflow-publish-nuget.yml new file mode 100644 index 000000000..e941fc04b --- /dev/null +++ b/.github/workflows/workflow-publish-nuget.yml @@ -0,0 +1,62 @@ +name: "Publish nuget package" + +on: + workflow_call: + inputs: + version: + description: "Version" + required: true + type: string + path: + description: "Path to project" + required: true + type: string + source: + description: "Nuget Source" + required: false + type: string + default: https://int.nugettest.org + secrets: + NUGET_API_KEY: + required: true +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: set PROJECT variable to point to project + run: | + PROJECT=${{inputs.path}} + echo "PROJECT ${PROJECT}" + echo "PROJECT=${PROJECT}" >> $GITHUB_ENV + + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + global-json-file: ./global.json + + - name: Build + run: dotnet build --configuration Release /p:Version=${{ inputs.version }} ${PROJECT} + + - name: Pack with debug symbols + run: dotnet pack --configuration Release /p:Version=${{ inputs.version }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg --output . ${PROJECT} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: package + path: '*.*nupkg' + push: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: package + + - name: Push to NuGet + run: dotnet nuget push *.nupkg --source ${{ inputs.source }} --api-key ${{secrets.NUGET_API_KEY}} + diff --git a/.refitter b/.refitter new file mode 100644 index 000000000..62ef65a3d --- /dev/null +++ b/.refitter @@ -0,0 +1,14 @@ +{ + "openApiPath": "docs/schema/V1/swagger.verified.json", + "namespace": "Digdir.Library.Dialogporten.WebApiClient.Features.V1", + "outputFolder": "src/Digdir.Library.Dialogporten.WebApiClient/Features/V1/", + "operationNameGenerator": "SingleClientFromOperationId", + "multipleInterfaces": "ByTag", + "includeTags": [ + + ], + "useCancellationTokens": true, + "returnIApiResponse": true, + "useDynamicQuerystringParameters": true, + "outputFilename": "RefitterInterface.cs" +} diff --git a/Digdir.Domain.Dialogporten.sln b/Digdir.Domain.Dialogporten.sln index 04d95ab2f..ac06dab11 100644 --- a/Digdir.Domain.Dialogporten.sln +++ b/Digdir.Domain.Dialogporten.sln @@ -67,6 +67,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digdir.Library.Utils.AspNet EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digdir.Tool.Dialogporten.SlackNotifier.Tests", "tests\Digdir.Tool.Dialogporten.SlackNotifier.Tests\Digdir.Tool.Dialogporten.SlackNotifier.Tests.csproj", "{F7DF2792-9C83-49F7-B7DD-556E8EC577DB}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebApiClient", "WebApiClient", "{9B809C3A-B169-4599-A2D3-A25E87C510FC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digdir.Library.Dialogporten.WebApiClient", "src\Digdir.Library.Dialogporten.WebApiClient\Digdir.Library.Dialogporten.WebApiClient.csproj", "{714FBB11-ADC0-44E8-A768-D1A59D641D31}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digdir.Library.Dialogporten.WebApiClient.Sample", "src\Digdir.Library.Dialogporten.WebApiClient.Sample\Digdir.Library.Dialogporten.WebApiClient.Sample.csproj", "{F8CB7159-4346-4436-9C35-BFCFDDE5DC2B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digdir.Library.Dialogporten.WebApiClient.Integration.Tests", "tests\Digdir.Library.Dialogporten.WebApiClient.Integration.Tests\Digdir.Library.Dialogporten.WebApiClient.Integration.Tests.csproj", "{7014AC47-0DF5-48C1-BD72-EE587FF3278B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -165,6 +173,18 @@ Global {F7DF2792-9C83-49F7-B7DD-556E8EC577DB}.Debug|Any CPU.Build.0 = Debug|Any CPU {F7DF2792-9C83-49F7-B7DD-556E8EC577DB}.Release|Any CPU.ActiveCfg = Release|Any CPU {F7DF2792-9C83-49F7-B7DD-556E8EC577DB}.Release|Any CPU.Build.0 = Release|Any CPU + {714FBB11-ADC0-44E8-A768-D1A59D641D31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {714FBB11-ADC0-44E8-A768-D1A59D641D31}.Debug|Any CPU.Build.0 = Debug|Any CPU + {714FBB11-ADC0-44E8-A768-D1A59D641D31}.Release|Any CPU.ActiveCfg = Release|Any CPU + {714FBB11-ADC0-44E8-A768-D1A59D641D31}.Release|Any CPU.Build.0 = Release|Any CPU + {F8CB7159-4346-4436-9C35-BFCFDDE5DC2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F8CB7159-4346-4436-9C35-BFCFDDE5DC2B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F8CB7159-4346-4436-9C35-BFCFDDE5DC2B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F8CB7159-4346-4436-9C35-BFCFDDE5DC2B}.Release|Any CPU.Build.0 = Release|Any CPU + {7014AC47-0DF5-48C1-BD72-EE587FF3278B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7014AC47-0DF5-48C1-BD72-EE587FF3278B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7014AC47-0DF5-48C1-BD72-EE587FF3278B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7014AC47-0DF5-48C1-BD72-EE587FF3278B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -196,6 +216,10 @@ Global {E389C7C8-9610-40AC-86DC-769B1B7DC78E} = {CADB8189-4AA1-4732-844A-C41DBF3EC8B7} {6A485C65-3613-4A49-A16F-2789119F6F38} = {096E9B69-6783-4446-A895-0B6D7729A0D9} {F7DF2792-9C83-49F7-B7DD-556E8EC577DB} = {CADB8189-4AA1-4732-844A-C41DBF3EC8B7} + {9B809C3A-B169-4599-A2D3-A25E87C510FC} = {096E9B69-6783-4446-A895-0B6D7729A0D9} + {714FBB11-ADC0-44E8-A768-D1A59D641D31} = {9B809C3A-B169-4599-A2D3-A25E87C510FC} + {F8CB7159-4346-4436-9C35-BFCFDDE5DC2B} = {9B809C3A-B169-4599-A2D3-A25E87C510FC} + {7014AC47-0DF5-48C1-BD72-EE587FF3278B} = {CADB8189-4AA1-4732-844A-C41DBF3EC8B7} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B2FE67FF-7622-4AFB-AD8E-961B6A39D888} diff --git a/docs/schema/V1/swagger.verified.json b/docs/schema/V1/swagger.verified.json index e617e216e..36ef265ed 100644 --- a/docs/schema/V1/swagger.verified.json +++ b/docs/schema/V1/swagger.verified.json @@ -6970,4 +6970,4 @@ "url": "https://altinn-dev-api.azure-api.net/dialogporten" } ] -} +} \ No newline at end of file diff --git a/src/Digdir.Library.Dialogporten.WebApiClient.Sample/Dialogs.cs b/src/Digdir.Library.Dialogporten.WebApiClient.Sample/Dialogs.cs new file mode 100644 index 000000000..9251bbed6 --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient.Sample/Dialogs.cs @@ -0,0 +1,24 @@ +using Digdir.Library.Dialogporten.WebApiClient.Features.V1; +using Refit; + +namespace Digdir.Library.Dialogporten.WebApiClient.Sample; + +public sealed class Dialogs(IServiceownerApi client) +{ + public async Task Purge(Guid dialogId, Guid? ifMatch = null) + { + var response = await client.V1ServiceOwnerDialogsPurgePurgeDialog(dialogId, ifMatch); + Console.WriteLine($"Purge response status code: {response.StatusCode}"); + Console.WriteLine($"Purge Response: {response.StatusCode}"); + return response; + } + + public static void PrintGetDialog(V1ServiceOwnerDialogsQueriesGet_Dialog dialog) + { + Console.WriteLine($"System Label: {dialog.SystemLabel}"); + Console.WriteLine($"Dialog Status: {dialog.Status}"); + Console.WriteLine($"Dialog Org: {dialog.Org}"); + Console.WriteLine($"Dialog Progress: {dialog.Progress}"); + Console.WriteLine($"Deleted at: {dialog.DeletedAt}"); + } +} diff --git a/src/Digdir.Library.Dialogporten.WebApiClient.Sample/Digdir.Library.Dialogporten.WebApiClient.Sample.csproj b/src/Digdir.Library.Dialogporten.WebApiClient.Sample/Digdir.Library.Dialogporten.WebApiClient.Sample.csproj new file mode 100644 index 000000000..6f78501ed --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient.Sample/Digdir.Library.Dialogporten.WebApiClient.Sample.csproj @@ -0,0 +1,22 @@ + + + + Exe + enable + enable + + + + + + + + + PreserveNewest + + + PreserveNewest + + + + diff --git a/src/Digdir.Library.Dialogporten.WebApiClient.Sample/Program.cs b/src/Digdir.Library.Dialogporten.WebApiClient.Sample/Program.cs new file mode 100644 index 000000000..2c72d1b1f --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient.Sample/Program.cs @@ -0,0 +1,355 @@ +using System.Diagnostics; +using Digdir.Library.Dialogporten.WebApiClient.Extensions; +using Digdir.Library.Dialogporten.WebApiClient.Features.V1; +using Digdir.Library.Dialogporten.WebApiClient.Sample; +using Digdir.Library.Dialogporten.WebApiClient.Services; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +// Setup +var configuration = new ConfigurationBuilder() + .AddJsonFile("appsettings.local.json", optional: false, reloadOnChange: true) + .Build(); + +var services = new ServiceCollection(); + +services.AddSingleton(configuration); + +services.AddDialogportenClient(); +services.AddDialogTokenVerifer(); + + +var serviceProvider = services.BuildServiceProvider(); +var now = DateTime.UtcNow; + +var dialogportenClient = serviceProvider.GetRequiredService(); + +var dialogs = new Dialogs(dialogportenClient); +var verifier = serviceProvider.GetRequiredService(); + +// Usage +// Test token +var token = + "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6ImRldi1wcmltYXJ5LXNpZ25pbmcta2V5In0.eyJqdGkiOiIzNGZhMGViNS0xZGVmLTQxMDYtYWY4YS0xMjljYjNiNTliNDYiLCJjIjoidXJuOmFsdGlubjpwZXJzb246aWRlbnRpZmllci1ubzowODg5NTY5OTY4NCIsImwiOjMsInAiOiJ1cm46YWx0aW5uOnBlcnNvbjppZGVudGlmaWVyLW5vOjA4ODk1Njk5Njg0IiwicyI6InVybjphbHRpbm46cmVzb3VyY2U6c3VwZXItc2ltcGxlLXNlcnZpY2UiLCJpIjoiMDE5MzI1MzgtMzEzZC03NGI1LTg1ZWMtMWI5MGIxMjYzNWRjIiwiYSI6InJlYWQiLCJpc3MiOiJodHRwczovL2xvY2FsaG9zdDo3MjE0L2FwaS92MSIsImlhdCI6MTczMTU3ODk5OCwibmJmIjoxNzMxNTc4OTk4LCJleHAiOjE3MzE1Nzk1OTh9.fL-rpDsXqwOSVk5zMizLZRaFugaz2VfVNf0CjOxIhSdwrkAhh1UfRu5RcD2OK4ddnRrCuz8iKKJyadkek9UGAg"; +Console.WriteLine(verifier.Verify(token)); +var dict = DialogTokenVerifier.GetDialogTokenClaims(token); +Console.WriteLine(dict); +Console.WriteLine(dict[DialogTokenClaimTypes.Actions]); + + +Console.WriteLine("== Start Create Dialog =="); +// Create dialog SO +var createDialogCommand = CreateCommand(); +var response = await dialogportenClient.V1ServiceOwnerDialogsCreateDialog(createDialogCommand); +if (response.IsSuccessStatusCode) +{ + Console.WriteLine(response.StatusCode); + Console.WriteLine(response.Content); +} +Console.WriteLine("== End Create Dialog =="); + + +// Get single dialog SO +Console.WriteLine("==Start Get Single Dialog=="); +Debug.Assert(response.Content != null, "response.Content != null"); +var guid = Guid.Parse(response.Content.Replace("\"", "").Trim()); +var dialog = dialogportenClient.V1ServiceOwnerDialogsGetGetDialog(guid, null!).Result.Content; +Debug.Assert(dialog != null, nameof(dialog) + " != null"); +Dialogs.PrintGetDialog(dialog); +Console.WriteLine("==End Get Single Dialog=="); + + +Console.WriteLine("==Start Search Dialogs=="); +var param = new V1ServiceOwnerDialogsSearchSearchDialogQueryParams() +{ + SystemLabel = [DialogEndUserContextsEntities_SystemLabel.Default] +}; +var result = await dialogportenClient.V1ServiceOwnerDialogsSearchSearchDialog(param); +Console.WriteLine(now); +Console.WriteLine(result.Content!.Items.Count); +Console.WriteLine(result.Content.Items.First().Org); +Console.WriteLine("==End Search Dialogs=="); + + +Console.WriteLine("== Start Patch Dialog =="); +List patchDocument = +[ + new() + { + Op = "replace", + OperationType = JsonPatchOperations_OperationType.Replace, + Path = "/progress", + Value = 50 + } +]; +var patchResponse = await dialogportenClient.V1ServiceOwnerDialogsPatchDialog(guid, patchDocument, null); +Console.WriteLine(patchResponse.IsSuccessStatusCode); +Console.WriteLine(patchResponse.StatusCode); +Console.WriteLine("== End Patch Dialog =="); + + +Console.WriteLine("== Start update Dialog =="); +var updateCommand = UpdateCommand(); +var updateResponse = await dialogportenClient.V1ServiceOwnerDialogsUpdateDialog(guid, updateCommand, null, CancellationToken.None); +Console.WriteLine(updateResponse.StatusCode); +Console.WriteLine(updateResponse.Error?.Content); +Console.WriteLine("== End Update Dialog =="); + + +Console.WriteLine("== Start Delete Dialog =="); +var deleteResponse = await dialogportenClient.V1ServiceOwnerDialogsDeleteDialog(guid, null); +Console.WriteLine(deleteResponse.IsSuccessStatusCode); +Console.WriteLine("== End Delete Dialog =="); + + +Console.WriteLine("==Start Get Single Dialog=="); +// var guid = Guid.Parse("0192b307-f5a5-7450-bee2-04a3515337ff"); +dialog = dialogportenClient.V1ServiceOwnerDialogsGetGetDialog(guid, null!).Result.Content; +Debug.Assert(dialog != null, nameof(dialog) + " != null"); +Dialogs.PrintGetDialog(dialog); +Console.WriteLine("==End Get Single Dialog=="); + + +result = await dialogportenClient.V1ServiceOwnerDialogsSearchSearchDialog(param); +Debug.Assert(result.Content != null, nameof(result) + " != null"); +Console.WriteLine(result.Content!.Items.Count); + + +Console.WriteLine("== Start Purge Dialog == "); +var purgeResponse = await dialogs.Purge(guid, dialog.Revision); + +Console.WriteLine($"Purge response status code: {purgeResponse.StatusCode}"); +if (purgeResponse.IsSuccessStatusCode) +{ + var dialogAfterPurge = await dialogportenClient.V1ServiceOwnerDialogsGetGetDialog(guid, null!); + Console.WriteLine(dialogAfterPurge.StatusCode); +} +Console.WriteLine("== End Purge Dialog =="); +return; + +static V1ServiceOwnerDialogsCommandsCreate_DialogCommand CreateCommand() +{ + return new V1ServiceOwnerDialogsCommandsCreate_DialogCommand + { + ServiceResource = "urn:altinn:resource:super-simple-service", + Party = "urn:altinn:person:identifier-no:14886498226", + SystemLabel = DialogEndUserContextsEntities_SystemLabel.Default, + Status = DialogsEntities_DialogStatus.New, + Progress = 2, + Content = new V1ServiceOwnerDialogsCommandsCreate_Content + { + Title = new V1CommonContent_ContentValue + { + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved" + }, + new V1CommonLocalizations_Localization + { + LanguageCode = "en", + Value = "Main" + } + ], + MediaType = "text/plain" + }, + Summary = new V1CommonContent_ContentValue + { + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved Summary" + }, + new V1CommonLocalizations_Localization + { + LanguageCode = "en", + Value = "Main Summary" + } + ], + MediaType = "text/plain" + } + + + }, + Transmissions = + [ + new V1ServiceOwnerDialogsCommandsCreate_Transmission + { + Attachments = + [ + new V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachment + { + DisplayName = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved misson" + } + ], + Urls = + [ + new V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachmentUrl + { + ConsumerType = Attachments_AttachmentUrlConsumerType.Gui, + Url = new Uri("https://digdir.apps.tt02.altinn.no/some-other-url") + } + ] + + } + ], + Content = new V1ServiceOwnerDialogsCommandsCreate_TransmissionContent + { + Summary = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Tranmission summary" + } + ] + }, + Title = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Tranmission Title" + } + ] + } + }, + Sender = new V1ServiceOwnerCommonActors_Actor + { + ActorType = Actors_ActorType.ServiceOwner + }, + Type = DialogsEntitiesTransmissions_DialogTransmissionType.Information + } + ] + }; +} + +static V1ServiceOwnerDialogsCommandsUpdate_Dialog UpdateCommand() +{ + return new V1ServiceOwnerDialogsCommandsUpdate_Dialog + { + Activities = [], + ApiActions = [], + Attachments = [], + SearchTags = [], + Status = DialogsEntities_DialogStatus.New, + Progress = 60, + Content = new V1ServiceOwnerDialogsCommandsUpdate_Content + { + Title = new V1CommonContent_ContentValue + { + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved" + }, + new V1CommonLocalizations_Localization + { + LanguageCode = "en", + Value = "Main" + } + ], + MediaType = "text/plain" + }, + Summary = new V1CommonContent_ContentValue + { + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved Summary" + }, + new V1CommonLocalizations_Localization + { + LanguageCode = "en", + Value = "Main Summary" + } + ], + MediaType = "text/plain" + } + + + }, + GuiActions = [], + Transmissions = + [ + new V1ServiceOwnerDialogsCommandsUpdate_Transmission + { + Attachments = + [ + new V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachment + { + DisplayName = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved mission" + } + ], + Urls = + [ + new V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachmentUrl + { + ConsumerType = Attachments_AttachmentUrlConsumerType.Gui, + Url = new Uri("https://digdir.apps.tt02.altinn.no/some-other-url") + } + ] + + } + ], + Content = new V1ServiceOwnerDialogsCommandsUpdate_TransmissionContent + { + Summary = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Transmission summary" + } + ] + }, + Title = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Transmission Title" + } + ] + } + }, + Sender = new V1ServiceOwnerCommonActors_Actor + { + ActorType = Actors_ActorType.ServiceOwner + }, + Type = DialogsEntitiesTransmissions_DialogTransmissionType.Information + } + ], + VisibleFrom = null + }; +} diff --git a/src/Digdir.Library.Dialogporten.WebApiClient.Sample/appsettings.json b/src/Digdir.Library.Dialogporten.WebApiClient.Sample/appsettings.json new file mode 100644 index 000000000..1fb853d49 --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient.Sample/appsettings.json @@ -0,0 +1,10 @@ +{ + "DialogportenSettings": { + "Environment": "local", + "Maskinporten": { + "ClientId": "ce3b732a-d4f2-4997-8545-adf8df70fe6c", + "Scope": "digdir:dialogporten.serviceprovider digdir:dialogporten.serviceprovider.search", + "EncodedJwk": "eyJwIjoieTRBZEhlVVBxdFEtSFlOWkR5ci0zS09RT3NQajA5TFh2a2hIUFlTdGFYNThkMndIWUJiVXlDTWdMYWtGTHo4UExKNWtscURsanRoczFtM1dFVGJhSWVuY25TalpjZTh4S1Q2SHh3bTNyaDlydWZ1TWVOZDRqaFptTm9WZmJrcGNXcVh0UDFvb1NPTE5zYUNVUWFUUEVKTXlFd3VhdWxMSzgxRG1SSTlMSmVNIiwia3R5IjoiUlNBIiwicSI6InFmOEQ2Uy1Kd19BdVQ0Q2hjQTlDek9WNk1uTW9mc1VCdTkteHJBcVFDRjh4WWZZOTRxQ1ZjQ3llajlkTlN3eXZUZXg1dThIMzNSaU1LMEFWM2tTQlpJLVZqcXJHLUx6YzNfTUlTTVpSVDJfbzNVQlRWVHpqTkUtSkpMX1hKaXJ6ZVhhQjM1UmFZMjFnWVhKQWg3X2tuR3dpRzF3MGxiT2ozQ0FzdnVwaU1BMCIsImQiOiJLVkF1b1Zhd2paTTgwenRYcUxSZUJGZkJ3M3pxVjdkUGFpaWFONWU0RFp6bW5MYTFMNEZJMTgtanVraHN4UVdqR1NFQnBIdTFrOHRPUWMyWjBsSDVaaTBydERqM0JKeEhxeDNsUGdYMWdTNXNiX1EyeXNfb2FKcklSX012MHBDQUFHX3hpa2lUY2kzTHMyeV9femV4QTdLbG0yalNmYW9Udzdhbml1R3RId1d5dHhCSnJnZ0J2c3loaHZIaUVQcnZaMHZBZldYYWI3QUtkUjc1cEtEaVVHOGdGNTdJN0hrWnpJSk9QYXp3MTU1Skx4TG9HcDVzeTFCVVpBNHRiQmlseWVsdG9ONGZINWd1aUktOXJjTE5zUmVYazJ1c3NFbE9EbVZ2Qmx2ZVVfb1ZRMVYtVDRJRnUzZk1BYVJGUFA2Wlo1akJJX2hkOFJOTTJ3eUp5UHVRWVEiLCJlIjoiQVFBQiIsInVzZSI6InNpZyIsImtpZCI6ImRpYWxvZ3BvcnRlbi1zcC1zZGstdGVzdC0yMDI0MTAxMCIsInFpIjoiQm9VS0RlczQ0UTNpXzNyT3Q4aHRrS2NxWkFNem00Njl2cTZuQnJVcHBTU1Ric3YwalZwN1daRGRRR0Q0bU8yMVJVOEFUbmN3NjFPOUt3YXktOGloX082VWFWbGxZN3NHYlVrQ2NVaG43ZDkzSElLZnhybnhWVE9nNUNMWTBka2Zwa3A1V2pyU1VvMTVKQURsY3BRM0ItRlU0Nm9PTG9ydjJ0SVFQekE4OF93IiwiZHAiOiJ1emVaRWZpN2Fqa3JFREhYekZtTThXWFUtZ3RmM1ctN0pnY082MnpWc1JrNTN4QlcxTE1NZlRlN2tlWk9xOEhDN3hTbGktSm9idnR6WGU3Y295ZW9sTXkzTnlydXFhQVp4VTBPMHpHQWQ4UFdjdHNXeDlITHlrU1hNby1QVlVNNkpmZERCaWFtcXk5bGQ0WTRfdzlscEdVWEMyaUFwLXdsWktaSHdrbG1KR3MiLCJhbGciOiJSUzI1NiIsImRxIjoiVENBcV9DMlJuX0RhakRlcUU2aUIzWWVWNVNtMHBMQk1Tbm10OHNENEp3ZVo4YWgzcGhrTFVxUm9qVGw1SDNhYXVtWl9UUmxiaWVNSVFnWDh4UUFnZ1l2YkNYeG9oZEx0aGt3ckZZdlp0WjBEeHJDYm9Md1hjc0Y3Ukwyejl4LWMwSFBGVFAzLVREQWF6UWlBNVVtRmNwYnAzeDYzWGFLSWFuYnVFc0NiSDdFIiwibiI6Imh5Sks4WnE2Wk8tRjFSSklVWVNCdUpfeG9RWkNNV1EyTVhrSFQ1bVROVVJJZmVWWWpCNWMwMzI0Uk5nc3ZPMEtXX0hUejRRSnptLV9rU1VaZ0h1Z2JoR0F3a1Vqc1lwTlJJRTBvLVNtdEExMlMxZHVCZWx6ajg2LVFrZkFzeFlwblNnSzl5OXpTS1B0YVlzMS1EcEVIb0hVdk9BSDJlNktFTXRaYUZPM0J0Yk9WUURXMENMYi1FY0UyaDBQRlFMMUp3NU8zeDhHcXBZeUFhamNoWnptcWlFbjBaSEd1QTNZZ1NyNGxQV1lkTzBNWHZmRFdyaFBTcnVTS3FodzBHMTlBRUpHOFhoek9xTWxLTUFIbW5ybk9XOHM2cWR2Sy1UQ1BiVGJJOU5XUWdFd2JpUFBBdlU0MUFITzZmTEYxUHZzQ3FhNjZTSGdYMkJzS3pvNVhORjhodyJ9" + } + } +} diff --git a/src/Digdir.Library.Dialogporten.WebApiClient/Config/DialogportenSettings.cs b/src/Digdir.Library.Dialogporten.WebApiClient/Config/DialogportenSettings.cs new file mode 100644 index 000000000..b9ebd64bc --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient/Config/DialogportenSettings.cs @@ -0,0 +1,19 @@ +namespace Digdir.Library.Dialogporten.WebApiClient.Config; + +public class DialogportenSettings +{ + public string Environment { get; set; } = null!; + public MaskinportenSettings Maskinporten { get; set; } = null!; +} + +public record Ed25519Keys +{ + public Ed25519Key Primary { get; set; } = null!; + public Ed25519Key Secondary { get; set; } = null!; +} + +public record Ed25519Key +{ + public string Kid { get; set; } = null!; + public string PublicComponent { get; set; } = null!; +} diff --git a/src/Digdir.Library.Dialogporten.WebApiClient/Config/MaskinportenSettings.cs b/src/Digdir.Library.Dialogporten.WebApiClient/Config/MaskinportenSettings.cs new file mode 100644 index 000000000..1fdc74983 --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient/Config/MaskinportenSettings.cs @@ -0,0 +1,3 @@ +namespace Digdir.Library.Dialogporten.WebApiClient.Config; + +public sealed record MaskinportenSettings(string ClientId, string EncodedJwk, string Scope); diff --git a/src/Digdir.Library.Dialogporten.WebApiClient/Digdir.Library.Dialogporten.WebApiClient.csproj b/src/Digdir.Library.Dialogporten.WebApiClient/Digdir.Library.Dialogporten.WebApiClient.csproj new file mode 100644 index 000000000..75b302c68 --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient/Digdir.Library.Dialogporten.WebApiClient.csproj @@ -0,0 +1,31 @@ + + + + enable + enable + README.md + Link to release notes. + LICENSE + Digitaliseringsdirektoratet + digdir;altinn;dialogporten + git + https://github.com/digdir/dialogporten + + + + + + + + + + + + + + + + + + + diff --git a/src/Digdir.Library.Dialogporten.WebApiClient/Extensions/ServiceCollectionExtensions.cs b/src/Digdir.Library.Dialogporten.WebApiClient/Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..678fbca34 --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient/Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,94 @@ +using System.Buffers.Text; +using System.Reflection; +using Altinn.ApiClients.Maskinporten.Extensions; +using Altinn.ApiClients.Maskinporten.Services; +using Digdir.Library.Dialogporten.WebApiClient.Config; +using Digdir.Library.Dialogporten.WebApiClient.Services; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using NSec.Cryptography; +using Refit; +using MaskinportenSettings = Altinn.ApiClients.Maskinporten.Config.MaskinportenSettings; +// using MaskinportenSettings = Altinn.Apiclient.Serviceowner.Config.MaskinportenSettings; + +namespace Digdir.Library.Dialogporten.WebApiClient.Extensions; + +public static class ServiceCollectionExtensions +{ + + public static IServiceCollection AddDialogTokenVerifer(this IServiceCollection services) + { + var provider = services.BuildServiceProvider(); + var dialogportenSettings = provider.GetRequiredService() + .GetSection("Ed25519Keys") + .Get(); + Console.WriteLine(dialogportenSettings); + + var keyPair = dialogportenSettings!.Primary; + var kid = keyPair.Kid; + + var publicKey = PublicKey.Import(SignatureAlgorithm.Ed25519, + Base64Url.DecodeFromChars(keyPair.PublicComponent), KeyBlobFormat.RawPublicKey); + services.AddSingleton(new DialogTokenVerifier(kid, publicKey)); + return services; + } + public static IServiceCollection AddDialogportenClient(this IServiceCollection services) + { + // Bygge en service provider for å få hentet ut settings + var provider = services.BuildServiceProvider(); + var dialogportenSettings = provider.GetRequiredService() + .GetSection("DialogportenSettings") + .Get(); + + // Vi mapper denne til en Maskinporten setting + var maskinportenSettings = new MaskinportenSettings() + { + EncodedJwk = dialogportenSettings!.Maskinporten.EncodedJwk, + ClientId = dialogportenSettings.Maskinporten.ClientId, + // Maskinportenmiljø utleded av Dialogporten-miljø + Environment = dialogportenSettings.Environment switch + { + "prod" => "prod", + "local" => "test", + "test" => "test", + _ => throw new ArgumentException() + }, + Scope = dialogportenSettings.Maskinporten.Scope, + }; + + // Vi registrerer en maskinporten klient med oppgite settings, som kan brukes som en http message handler + services.RegisterMaskinportenClientDefinition("dialogporten-sp-sdk", maskinportenSettings); + + var baseAddress = dialogportenSettings.Environment switch + { + "test" => "https://platform.tt02.altinn.no/dialogporten", + "local" => "https://localhost:7214", + // "prod" => "https://platform.altinn.no/dialogporten", + _ => throw new NotImplementedException() + }; + // Vi registrerer Refit, og legger til den registrerte maskinporten http message handlern + // Amund: Partial er ikke mulig å finne etter compile time. + var refitClients = Assembly.GetExecutingAssembly().GetTypes() + .Where(x => + x.Namespace!.StartsWith("Digdir.Library.Dialogporten.WebApiClient.Features.V1", StringComparison.InvariantCulture) && + x.IsInterface) + .ToList(); + + ; + foreach (var refitClient in refitClients) + { + services + .AddRefitClient(refitClient) + .ConfigureHttpClient(c => + { + c.BaseAddress = new Uri(baseAddress); + }) + .AddMaskinportenHttpMessageHandler("dialogporten-sp-sdk"); + } + + // Vi registrerer vår egen API-abstraksjon, som selv tar inn og wrapper IDialgportenApi, som nå er "maskinporten-powered" + // services.AddSingleton(); + + return services; + } +} diff --git a/src/Digdir.Library.Dialogporten.WebApiClient/Features/V1/RefitterInterface.verified.cs b/src/Digdir.Library.Dialogporten.WebApiClient/Features/V1/RefitterInterface.verified.cs new file mode 100644 index 000000000..b74070a38 --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient/Features/V1/RefitterInterface.verified.cs @@ -0,0 +1,4190 @@ +// +// This code was generated by Refitter. +// + + +using Refit; +using System.Collections.Generic; +using System.Text.Json.Serialization; +using System.Threading; +using System.Threading.Tasks; + +#nullable enable annotations + +namespace Digdir.Library.Dialogporten.WebApiClient.Features.V1 +{ + public class V1ServiceOwnerDialogsSearchSearchDialogQueryParams + { + + /// + /// Filter by one or more service resources + /// + [Query(CollectionFormat.Multi)] + public IEnumerable ServiceResource { get; set; } + + /// + /// Filter by one or more owning parties + /// + [Query(CollectionFormat.Multi)] + public IEnumerable Party { get; set; } + + /// + /// Filter by end user id + /// + [Query] + public string EndUserId { get; set; } + + /// + /// Filter by one or more extended statuses + /// + [Query(CollectionFormat.Multi)] + public IEnumerable ExtendedStatus { get; set; } + + /// + /// Filter by external reference + /// + [Query] + public string ExternalReference { get; set; } + + /// + /// Filter by status + /// + [Query(CollectionFormat.Multi)] + public IEnumerable Status { get; set; } + + /// + /// Only return dialogs created after this date + /// + [Query(Format = "yyyy-MM-ddTHH:mm:ssZ")] + public System.DateTimeOffset? CreatedAfter { get; set; } + + /// + /// Only return dialogs created before this date + /// + [Query(Format = "yyyy-MM-ddTHH:mm:ssZ")] + public System.DateTimeOffset? CreatedBefore { get; set; } + + /// + /// Only return dialogs updated after this date + /// + [Query(Format = "yyyy-MM-ddTHH:mm:ssZ")] + public System.DateTimeOffset? UpdatedAfter { get; set; } + + /// + /// Only return dialogs updated before this date + /// + [Query(Format = "yyyy-MM-ddTHH:mm:ssZ")] + public System.DateTimeOffset? UpdatedBefore { get; set; } + + /// + /// Only return dialogs with due date after this date + /// + [Query(Format = "yyyy-MM-ddTHH:mm:ssZ")] + public System.DateTimeOffset? DueAfter { get; set; } + + /// + /// Only return dialogs with due date before this date + /// + [Query(Format = "yyyy-MM-ddTHH:mm:ssZ")] + public System.DateTimeOffset? DueBefore { get; set; } + + /// + /// Only return dialogs with visible-from date after this date + /// + [Query(Format = "yyyy-MM-ddTHH:mm:ssZ")] + public System.DateTimeOffset? VisibleAfter { get; set; } + + /// + /// Only return dialogs with visible-from date before this date + /// + [Query(Format = "yyyy-MM-ddTHH:mm:ssZ")] + public System.DateTimeOffset? VisibleBefore { get; set; } + + /// + /// Filter by process + /// + [Query] + public string Process { get; set; } + + /// + /// Filter by Display state + /// + [Query(CollectionFormat.Multi)] + public IEnumerable SystemLabel { get; set; } + + /// + /// Search string for free text search. Will attempt to fuzzily match in all free text fields in the aggregate + /// + [Query] + public string Search { get; set; } + + /// + /// Limit free text search to texts with this language code, e.g. 'no', 'en'. Culture codes will be normalized to neutral language codes (ISO 639). Default: search all culture codes + /// + [Query] + public string SearchLanguageCode { get; set; } + + [Query] + public OrderSetOfTOrderDefinitionAndTTarget OrderBy { get; set; } + + /// + /// Supply "continuationToken" for the response to get the next page of results, if hasNextPage is true + /// + [Query] + public ContinuationTokenSetOfTOrderDefinitionAndTTarget ContinuationToken { get; set; } + + /// + /// Limit the number of results per page (1-1000, default: 100) + /// + [Query] + public int? Limit { get; set; } + + } + + public class V1ServiceOwnerDialogActivitiesNotificationConditionNotificationConditionQueryParams + { + public V1ServiceOwnerDialogActivitiesNotificationConditionNotificationConditionQueryParams(V1ServiceOwnerDialogActivitiesQueriesNotificationCondition_NotificationConditionType conditionType, DialogsEntitiesActivities_DialogActivityType activityType) + { + + ConditionType = conditionType; + ActivityType = activityType; + } + + [Query] + public V1ServiceOwnerDialogActivitiesQueriesNotificationCondition_NotificationConditionType ConditionType { get; set; } + + [Query] + public DialogsEntitiesActivities_DialogActivityType ActivityType { get; set; } + + [Query] + public System.Guid? TransmissionId { get; set; } + + } + + /// Gets a list of dialogs + [System.CodeDom.Compiler.GeneratedCode("Refitter", "1.1.0.0")] + public partial interface IServiceownerApi + { + /// Gets a list of dialogs + /// + /// Performs a search for dialogs, returning a paginated list of dialogs. For more information see the documentation (link TBD). + /// + /// * All date parameters must contain explicit time zone. Example: 2023-10-27T10:00:00Z or 2023-10-27T10:00:00+01:00 + /// * See "continuationToken" in the response for how to get the next page of results. + /// * hasNextPage will be set to true if there are more items to get. + /// + /// The dynamic querystring parameter wrapping all others. + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 200 + /// Successfully returned the dialog list. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider.search\". + /// + /// + /// + [Headers("Accept: application/json")] + [Get("/api/v1/serviceowner/dialogs")] + Task> V1ServiceOwnerDialogsSearchSearchDialog([Query] V1ServiceOwnerDialogsSearchSearchDialogQueryParams queryParams, CancellationToken cancellationToken = default); + + /// Creates a new dialog + /// + /// The dialog is created with the given configuration. For more information see the documentation (link TBD). + /// + /// For detailed information on validation rules, see [the source for CreateDialogCommandValidator](https://github.com/digdir/dialogporten/blob/main/src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogCommandValidator.cs) + /// + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 201 + /// The UUID of the created the dialog aggregate. A relative URL to the newly created activity is set in the \"Location\" header. + /// + /// + /// 204 + /// No Content + /// + /// + /// 400 + /// Validation error occured. See problem details for a list of errors. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to create a dialog for the given serviceResource (not owned by authenticated organization or has additional scope requirements defined in policy). + /// + /// + /// 422 + /// Domain error occured. See problem details for a list of errors. + /// + /// + /// + [Headers("Accept: application/json, application/problem+json")] + [Post("/api/v1/serviceowner/dialogs")] + Task> V1ServiceOwnerDialogsCreateDialog([Body, AliasAs("CreateDialogCommand")] V1ServiceOwnerDialogsCommandsCreate_DialogCommand createDialogCommand, CancellationToken cancellationToken = default); + + /// Deletes a dialog + /// + /// Deletes a given dialog (soft delete). For more information see the documentation (link TBD). + /// + /// Note that the dialog will still be available on the single details endpoint, but will have a deleted status. It will not appear on the list endpoint for either service owners nor end users. + /// If end users attempt to access the dialog via the details endpoint, they will get a 410 Gone response. + /// + /// Optimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not deleted by another request in the meantime. + /// + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 204 + /// The dialog aggregate was deleted successfully. + /// + /// + /// 400 + /// Validation error occured. See problem details for a list of errors. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to delete the supplied dialog (not owned by authenticated organization or has additional scope requirements defined in policy). + /// + /// + /// 404 + /// The given dialog ID was not found or is already deleted. + /// + /// + /// 410 + /// Entity with the given key(s) is removed. + /// + /// + /// 412 + /// The supplied If-Match header did not match the current Revision value for the dialog. The request was not applied. + /// + /// + /// + [Headers("Accept: application/problem+json")] + [Delete("/api/v1/serviceowner/dialogs/{dialogId}")] + Task V1ServiceOwnerDialogsDeleteDialog(System.Guid dialogId, [Header("if-Match")] System.Guid? if_Match, CancellationToken cancellationToken = default); + + /// Gets a single dialog + /// + /// Gets a single dialog aggregate. For more information see the documentation (link TBD). + /// + /// Note that this operation may return deleted dialogs (see the field `DeletedAt`). + /// + /// Filter by end user id + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 200 + /// Successfully returned the dialog aggregate. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to get the supplied dialog (not owned by authenticated organization or has additional scope requirements defined in policy). + /// + /// + /// 404 + /// The given dialog ID was not found or is already deleted. + /// + /// + /// + [Headers("Accept: application/json, application/problem+json")] + [Get("/api/v1/serviceowner/dialogs/{dialogId}")] + Task> V1ServiceOwnerDialogsGetGetDialog(System.Guid dialogId, [Query] string endUserId, CancellationToken cancellationToken = default); + + /// Patch a single dialog + /// + /// Patches a dialog aggregate with a RFC6902 JSON Patch document. The patch document must be a JSON array of RFC6902 operations. + /// See [https://tools.ietf.org/html/rfc6902](https://tools.ietf.org/html/rfc6902) for more information. + /// + /// Optimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not modified/deleted by another request in the meantime. + /// + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 204 + /// Patch was successfully applied. + /// + /// + /// 400 + /// Validation error occured. See problem details for a list of errors. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \\\"digdir:dialogporten.serviceprovider\\\" + /// + /// + /// 403 + /// Unauthorized to update a dialog for the given serviceResource (not owned by authenticated organization or has additional scope requirements defined in policy) + /// + /// + /// 404 + /// The given dialog ID was not found or is deleted + /// + /// + /// 412 + /// The supplied Revision does not match the current Revision of the dialog + /// + /// + /// 422 + /// Domain error occured. See problem details for a list of errors. + /// + /// + /// + [Headers("Accept: application/json")] + [Patch("/api/v1/serviceowner/dialogs/{dialogId}")] + Task V1ServiceOwnerDialogsPatchDialog(System.Guid dialogId, [Body] IEnumerable patchDocument, [Header("If-Match")] System.Guid? etag, CancellationToken cancellationToken = default); + + /// Replaces a dialog + /// + /// Replaces a given dialog with the supplied model. For more information see the documentation (link TBD). + /// + /// Optimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not modified/deleted by another request in the meantime. + /// + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 204 + /// The dialog aggregate was updated successfully. + /// + /// + /// 400 + /// Validation error occured. See problem details for a list of errors. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to update the supplied dialog (not owned by authenticated organization or has additional scope requirements defined in policy). + /// + /// + /// 404 + /// The given dialog ID was not found or is already deleted. + /// + /// + /// 410 + /// Entity with the given key(s) is removed. + /// + /// + /// 412 + /// The supplied If-Match header did not match the current Revision value for the dialog. The request was not applied. + /// + /// + /// 422 + /// Domain error occured. See problem details for a list of errors. + /// + /// + /// + [Headers("Accept: application/problem+json")] + [Put("/api/v1/serviceowner/dialogs/{dialogId}")] + Task V1ServiceOwnerDialogsUpdateDialog(System.Guid dialogId, [Body] V1ServiceOwnerDialogsCommandsUpdate_Dialog dto, [Header("if-Match")] System.Guid? if_Match, CancellationToken cancellationToken = default); + + /// Permanently deletes a dialog + /// + /// Deletes a given dialog (hard delete). For more information see the documentation (link TBD). + /// + /// Optimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not deleted by another request in the meantime. + /// + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 204 + /// The dialog aggregate was deleted successfully. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to delete the supplied dialog (not owned by authenticated organization or has additional scope requirements defined in policy). + /// + /// + /// 404 + /// The given dialog ID was not found or is already deleted. + /// + /// + /// 412 + /// The supplied If-Match header did not match the current Revision value for the dialog. The request was not applied. + /// + /// + /// + [Headers("Accept: application/problem+json")] + [Post("/api/v1/serviceowner/dialogs/{dialogId}/actions/purge")] + Task V1ServiceOwnerDialogsPurgePurgeDialog(System.Guid dialogId, [Header("if-Match")] System.Guid? if_Match, CancellationToken cancellationToken = default); + + /// Returns a boolean value based on conditions used to determine if a notification is to be sent + /// Used by Altinn Notification only. Takes a dialogId and returns a boolean value based on conditions used to determine if a notification is to be sent. + /// The dynamic querystring parameter wrapping all others. + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 200 + /// Successfully returned the notification determination. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"altinn:system/notifications.condition.check\". + /// + /// + /// 403 + /// Forbidden + /// + /// + /// + [Headers("Accept: application/json")] + [Get("/api/v1/serviceowner/dialogs/{dialogId}/actions/should-send-notification")] + Task> V1ServiceOwnerDialogActivitiesNotificationConditionNotificationCondition(System.Guid dialogId, [Query] V1ServiceOwnerDialogActivitiesNotificationConditionNotificationConditionQueryParams queryParams, CancellationToken cancellationToken = default); + + /// Gets a list of dialog activities + /// Gets the list of activities belonging to a dialog + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 200 + /// Successfully returned the dialog activity list. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to get the supplied dialog (not owned by authenticated organization or has additional scope requirements defined in policy). + /// + /// + /// + [Headers("Accept: application/json")] + [Get("/api/v1/serviceowner/dialogs/{dialogId}/activities")] + Task>> V1ServiceOwnerDialogActivitiesSearchSearchDialogActivity(System.Guid dialogId, CancellationToken cancellationToken = default); + + /// Adds a activity to a dialogs activity history + /// + /// The activity is created with the given configuration. For more information see the documentation (link TBD). + /// + /// Optimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not modified/deleted by another request in the meantime. + /// + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 201 + /// The UUID of the created the dialog activity. A relative URL to the newly created activity is set in the \"Location\" header. + /// + /// + /// 204 + /// No Content + /// + /// + /// 400 + /// Validation error occured. See problem details for a list of errors. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to create child entity for the given dialog (dialog not owned by authenticated organization or has additional scope requirements defined in service identifiers policy). + /// + /// + /// 404 + /// The given dialog ID was not found or is already deleted. + /// + /// + /// 410 + /// Entity with the given key(s) is removed. + /// + /// + /// 412 + /// The supplied If-Match header did not match the current Revision value for the dialog. The request was not applied. + /// + /// + /// 422 + /// Domain error occured. See problem details for a list of errors. + /// + /// + /// + [Headers("Accept: application/json, application/problem+json")] + [Post("/api/v1/serviceowner/dialogs/{dialogId}/activities")] + Task> V1ServiceOwnerDialogActivitiesCreateDialogActivity(System.Guid dialogId, [Body, AliasAs("CreateActivityRequest")] V1ServiceOwnerDialogActivitiesCreate_ActivityRequest createActivityRequest, [Header("if-Match")] System.Guid? if_Match, CancellationToken cancellationToken = default); + + /// Gets a single dialog activity + /// Gets a single activity belonging to a dialog. For more information see the documentation (link TBD). + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 200 + /// Successfully returned the dialog activity. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to get child entity for the given dialog (dialog not owned by authenticated organization or has additional scope requirements defined in service identifiers policy). + /// + /// + /// 404 + /// The given dialog ID was not found or was deleted, or the given activity ID was not found. + /// + /// + /// 410 + /// Entity with the given key(s) is removed. + /// + /// + /// + [Headers("Accept: application/json, application/problem+json")] + [Get("/api/v1/serviceowner/dialogs/{dialogId}/activities/{activityId}")] + Task> V1ServiceOwnerDialogActivitiesGetGetDialogActivity(System.Guid dialogId, System.Guid activityId, CancellationToken cancellationToken = default); + + /// Gets all seen log records for a dialog + /// Gets all seen log records for a dialog. For more information see the documentation (link TBD). + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 200 + /// Successfully returned the dialog seen log records. + /// + /// + /// 401 + /// Unauthorized + /// + /// + /// 403 + /// Forbidden + /// + /// + /// 404 + /// The given dialog ID was not found or is already deleted. + /// + /// + /// 410 + /// Entity with the given key(s) is removed. + /// + /// + /// + [Headers("Accept: application/json, application/problem+json")] + [Get("/api/v1/serviceowner/dialogs/{dialogId}/seenlog")] + Task>> V1ServiceOwnerDialogSeenLogsSearchSearchDialogSeenLog(System.Guid dialogId, CancellationToken cancellationToken = default); + + /// Gets a single dialog seen log record + /// Gets a single dialog seen log record. For more information see the documentation (link TBD). + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 200 + /// Successfully returned the dialog seen log record. + /// + /// + /// 401 + /// Unauthorized + /// + /// + /// 403 + /// Forbidden + /// + /// + /// 404 + /// The given dialog ID was not found or is already deleted. + /// + /// + /// 410 + /// Entity with the given key(s) is removed. + /// + /// + /// + [Headers("Accept: application/json, application/problem+json")] + [Get("/api/v1/serviceowner/dialogs/{dialogId}/seenlog/{seenLogId}")] + Task> V1ServiceOwnerDialogSeenLogsGetGetDialogSeenLog(System.Guid dialogId, System.Guid seenLogId, CancellationToken cancellationToken = default); + + /// Gets a list of dialog transmissions + /// Gets the list of transmissions belonging to a dialog + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 200 + /// Successfully returned the dialog transmission list. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to get the supplied dialog (not owned by authenticated organization or has additional scope requirements defined in policy). + /// + /// + /// 404 + /// The given dialog ID was not found or is already deleted. + /// + /// + /// 410 + /// Entity with the given key(s) is removed. + /// + /// + /// + [Headers("Accept: application/json, application/problem+json")] + [Get("/api/v1/serviceowner/dialogs/{dialogId}/transmissions")] + Task>> V1ServiceOwnerDialogTransmissionsSearchSearchDialogTransmission(System.Guid dialogId, CancellationToken cancellationToken = default); + + /// Adds a transmission to a dialog + /// + /// The transmission is created with the given configuration. For more information see the documentation (link TBD). + /// + /// Optimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not modified/deleted by another request in the meantime. + /// + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 201 + /// The UUID of the created the dialog transmission. A relative URL to the newly created activity is set in the \"Location\" header. + /// + /// + /// 204 + /// No Content + /// + /// + /// 400 + /// Validation error occured. See problem details for a list of errors. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to create child entity for the given dialog (dialog not owned by authenticated organization or has additional scope requirements defined in service identifiers policy). + /// + /// + /// 404 + /// The given dialog ID was not found or is already deleted. + /// + /// + /// 410 + /// Entity with the given key(s) is removed. + /// + /// + /// 412 + /// The supplied If-Match header did not match the current Revision value for the dialog. The request was not applied. + /// + /// + /// 422 + /// Domain error occured. See problem details for a list of errors. + /// + /// + /// + [Headers("Accept: application/json, application/problem+json")] + [Post("/api/v1/serviceowner/dialogs/{dialogId}/transmissions")] + Task> V1ServiceOwnerDialogTransmissionsCreateDialogTransmission(System.Guid dialogId, [Body, AliasAs("CreateTransmissionRequest")] V1ServiceOwnerDialogTransmissionsCreate_TransmissionRequest createTransmissionRequest, [Header("if-Match")] System.Guid? if_Match, CancellationToken cancellationToken = default); + + /// Gets a single dialog transmission + /// Gets a single transmission belonging to a dialog. For more information see the documentation (link TBD). + /// + /// A representing the instance containing the result: + /// + /// + /// Status + /// Description + /// + /// + /// 200 + /// Successfully returned the dialog transmission. + /// + /// + /// 401 + /// Missing or invalid authentication token. Requires a Maskinporten-token with the scope \"digdir:dialogporten.serviceprovider\". + /// + /// + /// 403 + /// Unauthorized to get child entity for the given dialog (dialog not owned by authenticated organization or has additional scope requirements defined in service identifiers policy). + /// + /// + /// 404 + /// The given dialog ID was not found or was deleted, or the given transmission ID was not found. + /// + /// + /// 410 + /// Entity with the given key(s) is removed. + /// + /// + /// + [Headers("Accept: application/json, application/problem+json")] + [Get("/api/v1/serviceowner/dialogs/{dialogId}/transmissions/{transmissionId}")] + Task> V1ServiceOwnerDialogTransmissionsGetGetDialogTransmission(System.Guid dialogId, System.Guid transmissionId, CancellationToken cancellationToken = default); + } + +} + +//---------------------- +// +// Generated using the NSwag toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org) +// +//---------------------- + +#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." +#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." +#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' +#pragma warning disable 612 // Disable "CS0612 '...' is obsolete" +#pragma warning disable 649 // Disable "CS0649 Field is never assigned to, and will always have its default value null" +#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... +#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." +#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" +#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" +#pragma warning disable 8603 // Disable "CS8603 Possible null reference return" +#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter" +#pragma warning disable 8625 // Disable "CS8625 Cannot convert null literal to non-nullable reference type" +#pragma warning disable 8765 // Disable "CS8765 Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes)." + +namespace Digdir.Library.Dialogporten.WebApiClient.Features.V1 +{ + using System = global::System; + + + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum Actors_ActorType + { + + [System.Runtime.Serialization.EnumMember(Value = @"PartyRepresentative")] + PartyRepresentative = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"ServiceOwner")] + ServiceOwner = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum Attachments_AttachmentUrlConsumerType + { + + [System.Runtime.Serialization.EnumMember(Value = @"Gui")] + Gui = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Api")] + Api = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class ContinuationTokenSetOfTOrderDefinitionAndTTarget + { + + private IDictionary _additionalProperties; + + [JsonExtensionData] + public IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum DialogEndUserContextsEntities_SystemLabel + { + + [System.Runtime.Serialization.EnumMember(Value = @"Default")] + Default = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Bin")] + Bin = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Archive")] + Archive = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum DialogsEntities_DialogStatus + { + + [System.Runtime.Serialization.EnumMember(Value = @"New")] + New = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"InProgress")] + InProgress = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Draft")] + Draft = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"Sent")] + Sent = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"RequiresAttention")] + RequiresAttention = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"Completed")] + Completed = 5, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum DialogsEntitiesActions_DialogGuiActionPriority + { + + [System.Runtime.Serialization.EnumMember(Value = @"Primary")] + Primary = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Secondary")] + Secondary = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Tertiary")] + Tertiary = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum DialogsEntitiesActivities_DialogActivityType + { + + [System.Runtime.Serialization.EnumMember(Value = @"DialogCreated")] + DialogCreated = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"DialogClosed")] + DialogClosed = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Information")] + Information = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"TransmissionOpened")] + TransmissionOpened = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"PaymentMade")] + PaymentMade = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"SignatureProvided")] + SignatureProvided = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"DialogOpened")] + DialogOpened = 6, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum DialogsEntitiesTransmissions_DialogTransmissionType + { + + [System.Runtime.Serialization.EnumMember(Value = @"Information")] + Information = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Acceptance")] + Acceptance = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Rejection")] + Rejection = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"Request")] + Request = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"Alert")] + Alert = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"Decision")] + Decision = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"Submission")] + Submission = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"Correction")] + Correction = 7, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum Http_HttpVerb + { + + [System.Runtime.Serialization.EnumMember(Value = @"GET")] + GET = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"POST")] + POST = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"PUT")] + PUT = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"PATCH")] + PATCH = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"DELETE")] + DELETE = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"HEAD")] + HEAD = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"OPTIONS")] + OPTIONS = 6, + + [System.Runtime.Serialization.EnumMember(Value = @"TRACE")] + TRACE = 7, + + [System.Runtime.Serialization.EnumMember(Value = @"CONNECT")] + CONNECT = 8, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class JsonPatchOperations_Operation + { + + [JsonPropertyName("from")] + public string From { get; set; } + + [JsonPropertyName("op")] + public string Op { get; set; } + + [JsonPropertyName("operationType")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public JsonPatchOperations_OperationType OperationType { get; set; } + + [JsonPropertyName("path")] + public string Path { get; set; } + + [JsonPropertyName("value")] + public object Value { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum JsonPatchOperations_OperationType + { + + [System.Runtime.Serialization.EnumMember(Value = @"Add")] + Add = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Remove")] + Remove = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"Replace")] + Replace = 2, + + [System.Runtime.Serialization.EnumMember(Value = @"Move")] + Move = 3, + + [System.Runtime.Serialization.EnumMember(Value = @"Copy")] + Copy = 4, + + [System.Runtime.Serialization.EnumMember(Value = @"Test")] + Test = 5, + + [System.Runtime.Serialization.EnumMember(Value = @"Invalid")] + Invalid = 6, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class OrderSetOfTOrderDefinitionAndTTarget + { + + private IDictionary _additionalProperties; + + [JsonExtensionData] + public IDictionary AdditionalProperties + { + get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class PaginatedListOfV1ServiceOwnerDialogsQueriesSearch_Dialog + { + /// + /// The continuation token to be used to fetch the next page of items + /// + + [JsonPropertyName("continuationToken")] + public string ContinuationToken { get; set; } + + /// + /// Whether there are more items available that can be fetched by supplying the continuation token + /// + + [JsonPropertyName("hasNextPage")] + public bool HasNextPage { get; set; } + + /// + /// The paginated list of items + /// + + [JsonPropertyName("items")] + public ICollection Items { get; set; } + + /// + /// The current sorting order of the items + /// + + [JsonPropertyName("orderBy")] + public string OrderBy { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class ProblemDetails + { + + [JsonPropertyName("detail")] + public string Detail { get; set; } + + [JsonPropertyName("errors")] + public ICollection Errors { get; set; } + + [JsonPropertyName("instance")] + public string Instance { get; set; } = "/api/route"; + + [JsonPropertyName("status")] + public int Status { get; set; } = 400; + + [JsonPropertyName("title")] + public string Title { get; set; } = "One or more validation errors occurred."; + + [JsonPropertyName("traceId")] + public string TraceId { get; set; } = "0HMPNHL0JHL76:00000001"; + + [JsonPropertyName("type")] + public string Type { get; set; } = "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1"; + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class ProblemDetails_Error + { + + [JsonPropertyName("code")] + public string Code { get; set; } + + [JsonPropertyName("name")] + public string Name { get; set; } = "Error or field name"; + + [JsonPropertyName("reason")] + public string Reason { get; set; } = "Error reason"; + + [JsonPropertyName("severity")] + public string Severity { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1CommonContent_ContentValue + { + /// + /// Media type of the content (plaintext, Markdown). Can also indicate that the content is embeddable. + /// + + [JsonPropertyName("mediaType")] + public string MediaType { get; set; } + + /// + /// A list of localizations for the content. + /// + + [JsonPropertyName("value")] + public ICollection Value { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1CommonLocalizations_Localization + { + /// + /// The language code of the localization in ISO 639-1 format. + /// + + [JsonPropertyName("languageCode")] + public string LanguageCode { get; set; } + + /// + /// The localized text or URI reference. + /// + + [JsonPropertyName("value")] + public string Value { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerCommonActors_Actor + { + /// + /// The identifier of the person or organization that sent the transmission. Mutually exclusive with ActorName. + ///
Might be omitted if ActorType is "ServiceOwner". + ///
+ + [JsonPropertyName("actorId")] + public string ActorId { get; set; } + + /// + /// Specifies the name of the entity that sent the transmission. Mutually exclusive with ActorId. If ActorId + ///
is supplied, the name will be automatically populated from the name registries. + ///
+ + [JsonPropertyName("actorName")] + public string ActorName { get; set; } + + /// + /// The type of actor that sent the transmission. + /// + + [JsonPropertyName("actorType")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Actors_ActorType ActorType { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogActivitiesCreate_ActivityRequest + { + /// + /// If supplied, overrides the creating date and time for the transmission. + ///
If not supplied, the current date /time will be used. + ///
+ + [JsonPropertyName("createdAt")] + public System.DateTimeOffset? CreatedAt { get; set; } + + /// + /// Unstructured text describing the activity. Only set if the activity type is "Information". + /// + + [JsonPropertyName("description")] + public ICollection Description { get; set; } + + /// + /// Arbitrary URI/URN describing a service-specific transmission type. + /// + + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// The UUDIv7 of the action may be provided to support idempotent additions to the list of activities. + ///
If not supplied, a new UUIDv7 will be generated. + ///
+ + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// The actor that performed the activity. + /// + + [JsonPropertyName("performedBy")] + public V1ServiceOwnerCommonActors_Actor PerformedBy { get; set; } + + /// + /// If the activity is related to a particular transmission, this field will contain the transmission identifier. + ///
Must be present in the request body. + ///
+ + [JsonPropertyName("transmissionId")] + public System.Guid? TransmissionId { get; set; } + + /// + /// The type of transmission. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesActivities_DialogActivityType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogActivitiesQueriesGet_Activity + { + + [JsonPropertyName("createdAt")] + public System.DateTimeOffset? CreatedAt { get; set; } + + [JsonPropertyName("deletedAt")] + public System.DateTimeOffset? DeletedAt { get; set; } + + [JsonPropertyName("description")] + public ICollection Description { get; set; } + + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + [JsonPropertyName("performedBy")] + public V1ServiceOwnerCommonActors_Actor PerformedBy { get; set; } + + [JsonPropertyName("transmissionId")] + public System.Guid? TransmissionId { get; set; } + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesActivities_DialogActivityType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogActivitiesQueriesNotificationCondition_NotificationCondition + { + + [JsonPropertyName("sendNotification")] + public bool SendNotification { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public enum V1ServiceOwnerDialogActivitiesQueriesNotificationCondition_NotificationConditionType + { + + [System.Runtime.Serialization.EnumMember(Value = @"NotExists")] + NotExists = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"Exists")] + Exists = 1, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogActivitiesQueriesSearch_Activity + { + + [JsonPropertyName("createdAt")] + public System.DateTimeOffset CreatedAt { get; set; } + + [JsonPropertyName("deletedAt")] + public System.DateTimeOffset? DeletedAt { get; set; } + + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + [JsonPropertyName("transmissionId")] + public System.Guid? TransmissionId { get; set; } + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesActivities_DialogActivityType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_Activity + { + /// + /// If supplied, overrides the creating date and time for the transmission. + ///
If not supplied, the current date /time will be used. + ///
+ + [JsonPropertyName("createdAt")] + public System.DateTimeOffset? CreatedAt { get; set; } + + /// + /// Unstructured text describing the activity. Only set if the activity type is "Information". + /// + + [JsonPropertyName("description")] + public ICollection Description { get; set; } + + /// + /// Arbitrary URI/URN describing a service-specific transmission type. + /// + + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// A self-defined UUIDv7 may be provided to support idempotent creation of activities. If not provided, a new UUIDv7 will be generated. + /// + + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// The actor that performed the activity. + /// + + [JsonPropertyName("performedBy")] + public V1ServiceOwnerCommonActors_Actor PerformedBy { get; set; } + + /// + /// If the activity is related to a particular transmission, this field will contain the transmission identifier. + ///
Must be present in the request body. + ///
+ + [JsonPropertyName("transmissionId")] + public System.Guid? TransmissionId { get; set; } + + /// + /// The type of transmission. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesActivities_DialogActivityType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_ApiAction + { + /// + /// String identifier for the action, corresponding to the "action" attributeId used in the XACML service policy, + ///
which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ + [JsonPropertyName("action")] + public string Action { get; set; } + + /// + /// Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service + ///
policy, which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ ///
Can also be used to refer to other service policies. + ///
+ + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The endpoints associated with the action. + /// + + [JsonPropertyName("endpoints")] + public ICollection Endpoints { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_ApiActionEndpoint + { + /// + /// Boolean indicating if the endpoint is deprecated. + /// + + [JsonPropertyName("deprecated")] + public bool Deprecated { get; set; } + + /// + /// Link to documentation for the endpoint, providing documentation for integrators. Should be a URL to a + ///
human-readable page. + ///
+ + [JsonPropertyName("documentationUrl")] + public System.Uri DocumentationUrl { get; set; } + + /// + /// The HTTP method that the endpoint expects for this action. + /// + + [JsonPropertyName("httpMethod")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Http_HttpVerb HttpMethod { get; set; } + + /// + /// Link to the request schema for the endpoint. Used to provide documentation for integrators. + ///
Dialogporten will not validate information on this endpoint. + ///
+ + [JsonPropertyName("requestSchema")] + public System.Uri RequestSchema { get; set; } + + /// + /// Link to the response schema for the endpoint. Used to provide documentation for integrators. + ///
Dialogporten will not validate information on this endpoint. + ///
+ + [JsonPropertyName("responseSchema")] + public System.Uri ResponseSchema { get; set; } + + /// + /// Date and time when the endpoint will no longer function. Only set if the endpoint is deprecated. Dialogporten + ///
will not enforce this date. + ///
+ + [JsonPropertyName("sunsetAt")] + public System.DateTimeOffset? SunsetAt { get; set; } + + /// + /// The fully qualified URL of the API endpoint. + /// + + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + /// + /// Arbitrary string indicating the version of the endpoint. + /// + + [JsonPropertyName("version")] + public string Version { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_Attachment + { + /// + /// The display name of the attachment that should be used in GUIs. + /// + + [JsonPropertyName("displayName")] + public ICollection DisplayName { get; set; } + + /// + /// The URLs associated with the attachment, each referring to a different representation of the attachment. + /// + + [JsonPropertyName("urls")] + public ICollection Urls { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_AttachmentUrl + { + /// + /// The type of consumer the URL is intended for. + /// + + [JsonPropertyName("consumerType")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Attachments_AttachmentUrlConsumerType ConsumerType { get; set; } + + /// + /// The media type of the attachment. + /// + + [JsonPropertyName("mediaType")] + public string MediaType { get; set; } + + /// + /// The fully qualified URL of the attachment. + /// + + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_Content + { + /// + /// Additional information about the dialog. + ///
Supported media types: text/plain, text/markdown + ///
+ + [JsonPropertyName("additionalInfo")] + public V1CommonContent_ContentValue AdditionalInfo { get; set; } + + /// + /// Used as the human-readable label used to describe the "ExtendedStatus" field. + ///
Supported media types: text/plain + ///
+ + [JsonPropertyName("extendedStatus")] + public V1CommonContent_ContentValue ExtendedStatus { get; set; } + + /// + /// Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS. + ///
Supported media types: application/vnd.dialogporten.frontchannelembed+json;type=markdown + ///
+ + [JsonPropertyName("mainContentReference")] + public V1CommonContent_ContentValue MainContentReference { get; set; } + + /// + /// Overridden sender name. If not supplied, assume "org" as the sender name. Must be text/plain if supplied. + ///
Supported media types: text/plain + ///
+ + [JsonPropertyName("senderName")] + public V1CommonContent_ContentValue SenderName { get; set; } + + /// + /// A short summary of the dialog and its current state. + ///
Supported media types: text/plain + ///
+ + [JsonPropertyName("summary")] + public V1CommonContent_ContentValue Summary { get; set; } + + /// + /// The title of the dialog. + ///
Supported media types: text/plain + ///
+ + [JsonPropertyName("title")] + public V1CommonContent_ContentValue Title { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_DialogCommand + { + /// + /// An immutable list of activities associated with the dialog. + /// + + [JsonPropertyName("activities")] + public ICollection Activities { get; set; } + + /// + /// The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations. + /// + + [JsonPropertyName("apiActions")] + public ICollection ApiActions { get; set; } + + /// + /// The attachments associated with the dialog (on an aggregate level). + /// + + [JsonPropertyName("attachments")] + public ICollection Attachments { get; set; } + + /// + /// The dialog unstructured text content. + /// + + [JsonPropertyName("content")] + public V1ServiceOwnerDialogsCommandsCreate_Content Content { get; set; } + + /// + /// If set, will override the date and time when the dialog is set as created. + ///
If not supplied, the current date /time will be used. + ///
+ + [JsonPropertyName("createdAt")] + public System.DateTimeOffset CreatedAt { get; set; } + + /// + /// The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available. + /// + + [JsonPropertyName("dueAt")] + public System.DateTimeOffset? DueAt { get; set; } + + /// + /// The expiration date for the dialog. This is the last date when the dialog is available for the end user. + ///
+ ///
After this date is passed, the dialog will be considered expired and no longer available for the end user in any + ///
API. If not supplied, the dialog will be considered to never expire. This field can be changed after creation. + ///
+ + [JsonPropertyName("expiresAt")] + public System.DateTimeOffset? ExpiresAt { get; set; } + + /// + /// Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of + ///
the dialog to further specify the "status" enum. + ///
+ + [JsonPropertyName("extendedStatus")] + public string ExtendedStatus { get; set; } + + /// + /// Arbitrary string with a service-specific reference to an external system or service. + /// + + [JsonPropertyName("externalReference")] + public string ExternalReference { get; set; } + + /// + /// The GUI actions associated with the dialog. Should be used in browser-based interactive frontends. + /// + + [JsonPropertyName("guiActions")] + public ICollection GuiActions { get; set; } + + /// + /// A self-defined UUIDv7 may be provided to support idempotent creation of dialogs. If not provided, a new UUIDv7 will be generated. + /// + + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// The party code representing the organization or person that the dialog belongs to in URN format. + /// + + [JsonPropertyName("party")] + public string Party { get; set; } + + /// + /// Optional preceding process identifier to indicate the business process that preceded the process indicated in the "Process" field. Cannot be set without also "Process" being set. + /// + + [JsonPropertyName("precedingProcess")] + public string PrecedingProcess { get; set; } + + /// + /// Optional process identifier used to indicate a business process this dialog belongs to. + /// + + [JsonPropertyName("process")] + public string Process { get; set; } + + /// + /// Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come + ///
to a natural completion (successful or not). + ///
+ + [JsonPropertyName("progress")] + public int? Progress { get; set; } + + /// + /// A list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO. + /// + + [JsonPropertyName("searchTags")] + public ICollection SearchTags { get; set; } + + /// + /// The service identifier for the service that the dialog is related to in URN-format. + ///
This corresponds to a resource in the Altinn Resource Registry, which the authenticated organization + ///
must own, i.e., be listed as the "competent authority" in the Resource Registry entry. + ///
+ + [JsonPropertyName("serviceResource")] + public string ServiceResource { get; set; } + + /// + /// The aggregated status of the dialog. + /// + + [JsonPropertyName("status")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntities_DialogStatus Status { get; set; } + + /// + /// Set the system label of the dialog Migration purposes. + /// + + [JsonPropertyName("systemLabel")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogEndUserContextsEntities_SystemLabel? SystemLabel { get; set; } + + /// + /// The immutable list of transmissions associated with the dialog. + /// + + [JsonPropertyName("transmissions")] + public ICollection Transmissions { get; set; } + + /// + /// If set, will override the date and time when the dialog is set as last updated. + ///
If not supplied, the current date /time will be used. + ///
+ + [JsonPropertyName("updatedAt")] + public System.DateTimeOffset UpdatedAt { get; set; } + + /// + /// The timestamp when the dialog should be made visible for authorized end users. If not provided, the dialog will be + ///
immediately available. + ///
+ + [JsonPropertyName("visibleFrom")] + public System.DateTimeOffset? VisibleFrom { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_GuiAction + { + /// + /// The action identifier for the action, corresponding to the "action" attributeId used in the XACML service policy. + /// + + [JsonPropertyName("action")] + public string Action { get; set; } + + /// + /// Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service + ///
policy, which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ ///
Can also be used to refer to other service policies. + ///
+ + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The HTTP method that the frontend should use when redirecting the user. + /// + + [JsonPropertyName("httpMethod")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Http_HttpVerb? HttpMethod { get; set; } + + /// + /// Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX + ///
for delete actions. + ///
+ + [JsonPropertyName("isDeleteDialogAction")] + public bool IsDeleteDialogAction { get; set; } + + /// + /// Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action + ///
priority. + ///
+ + [JsonPropertyName("priority")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesActions_DialogGuiActionPriority Priority { get; set; } + + /// + /// If there should be a prompt asking the user for confirmation before the action is executed, + ///
this field should contain the prompt text. + ///
+ + [JsonPropertyName("prompt")] + public ICollection Prompt { get; set; } + + /// + /// The title of the action, this should be short and in verb form. Must be text/plain. + /// + + [JsonPropertyName("title")] + public ICollection Title { get; set; } + + /// + /// The fully qualified URL of the action, to which the user will be redirected when the action is triggered. Will be set to + ///
"urn:dialogporten:unauthorized" if the user is not authorized to perform the action. + ///
+ + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_SearchTag + { + /// + /// A search tag value. + /// + + [JsonPropertyName("value")] + public string Value { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_Transmission + { + /// + /// The transmission-level attachments. + /// + + [JsonPropertyName("attachments")] + public ICollection Attachments { get; set; } + + /// + /// Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service + ///
policy, which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ ///
Can also be used to refer to other service policies. + ///
+ + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The transmission unstructured text content. + /// + + [JsonPropertyName("content")] + public V1ServiceOwnerDialogsCommandsCreate_TransmissionContent Content { get; set; } + + /// + /// If supplied, overrides the creating date and time for the transmission. + ///
If not supplied, the current date /time will be used. + ///
+ + [JsonPropertyName("createdAt")] + public System.DateTimeOffset CreatedAt { get; set; } + + /// + /// Arbitrary URI/URN describing a service-specific transmission type. + ///
+ ///
Refer to the service-specific documentation provided by the service owner for details (if in use). + ///
+ + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// A self-defined UUIDv7 may be provided to support idempotent creation of transmissions. If not provided, a new UUIDv7 will be generated. + /// + + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// Reference to any other transmission that this transmission is related to. + /// + + [JsonPropertyName("relatedTransmissionId")] + public System.Guid? RelatedTransmissionId { get; set; } + + /// + /// The actor that sent the transmission. + /// + + [JsonPropertyName("sender")] + public V1ServiceOwnerCommonActors_Actor Sender { get; set; } + + /// + /// The type of transmission. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesTransmissions_DialogTransmissionType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachment + { + /// + /// The display name of the attachment that should be used in GUIs. + /// + + [JsonPropertyName("displayName")] + public ICollection DisplayName { get; set; } + + /// + /// A self-defined UUIDv7 may be provided to support idempotent creation of transmission attachments. If not provided, a new UUIDv7 will be generated. + /// + + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// The URLs associated with the attachment, each referring to a different representation of the attachment. + /// + + [JsonPropertyName("urls")] + public ICollection Urls { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachmentUrl + { + /// + /// The type of consumer the URL is intended for. + /// + + [JsonPropertyName("consumerType")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Attachments_AttachmentUrlConsumerType ConsumerType { get; set; } + + /// + /// The media type of the attachment. + /// + + [JsonPropertyName("mediaType")] + public string MediaType { get; set; } + + /// + /// The fully qualified URL of the attachment. + /// + + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsCreate_TransmissionContent + { + /// + /// Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS. + ///
Allowed media types: application/vnd.dialogporten.frontchannelembed+json;type=markdown + ///
+ + [JsonPropertyName("contentReference")] + public V1CommonContent_ContentValue ContentReference { get; set; } + + /// + /// The transmission summary. + /// + + [JsonPropertyName("summary")] + public V1CommonContent_ContentValue Summary { get; set; } + + /// + /// The transmission title. Must be text/plain. + /// + + [JsonPropertyName("title")] + public V1CommonContent_ContentValue Title { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_Activity + { + /// + /// If supplied, overrides the creating date and time for the transmission. + ///
If not supplied, the current date /time will be used. + ///
+ + [JsonPropertyName("createdAt")] + public System.DateTimeOffset? CreatedAt { get; set; } + + /// + /// Unstructured text describing the activity. Only set if the activity type is "Information". + /// + + [JsonPropertyName("description")] + public ICollection Description { get; set; } + + /// + /// Arbitrary URI/URN describing a service-specific transmission type. + /// + + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// The UUDIv7 of the action may be provided to support idempotent additions to the list of activities. + ///
If not supplied, a new UUIDv7 will be generated. + ///
+ + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// The actor that performed the activity. + /// + + [JsonPropertyName("performedBy")] + public V1ServiceOwnerCommonActors_Actor PerformedBy { get; set; } + + /// + /// If the activity is related to a particular transmission, this field will contain the transmission identifier. + ///
Must be present in the request body. + ///
+ + [JsonPropertyName("transmissionId")] + public System.Guid? TransmissionId { get; set; } + + /// + /// The type of transmission. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesActivities_DialogActivityType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_ApiAction + { + /// + /// String identifier for the action, corresponding to the "action" attributeId used in the XACML service policy, + ///
which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ + [JsonPropertyName("action")] + public string Action { get; set; } + + /// + /// Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service + ///
policy, which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ ///
Can also be used to refer to other service policies. + ///
+ + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The endpoints associated with the action. + /// + + [JsonPropertyName("endpoints")] + public ICollection Endpoints { get; set; } + + /// + /// A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs. + /// + + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_ApiActionEndpoint + { + /// + /// Boolean indicating if the endpoint is deprecated. + /// + + [JsonPropertyName("deprecated")] + public bool Deprecated { get; set; } + + /// + /// Link to documentation for the endpoint, providing documentation for integrators. Should be a URL to a + ///
human-readable page. + ///
+ + [JsonPropertyName("documentationUrl")] + public System.Uri DocumentationUrl { get; set; } + + /// + /// The HTTP method that the endpoint expects for this action. + /// + + [JsonPropertyName("httpMethod")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Http_HttpVerb HttpMethod { get; set; } + + /// + /// A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs. + /// + + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// Link to the request schema for the endpoint. Used to provide documentation for integrators. + ///
Dialogporten will not validate information on this endpoint. + ///
+ + [JsonPropertyName("requestSchema")] + public System.Uri RequestSchema { get; set; } + + /// + /// Link to the response schema for the endpoint. Used to provide documentation for integrators. + ///
Dialogporten will not validate information on this endpoint. + ///
+ + [JsonPropertyName("responseSchema")] + public System.Uri ResponseSchema { get; set; } + + /// + /// Date and time when the endpoint will no longer function. Only set if the endpoint is deprecated. Dialogporten + ///
will not enforce this date. + ///
+ + [JsonPropertyName("sunsetAt")] + public System.DateTimeOffset? SunsetAt { get; set; } + + /// + /// The fully qualified URL of the API endpoint. + /// + + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + /// + /// Arbitrary string indicating the version of the endpoint. + /// + + [JsonPropertyName("version")] + public string Version { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_Attachment + { + /// + /// The display name of the attachment that should be used in GUIs. + /// + + [JsonPropertyName("displayName")] + public ICollection DisplayName { get; set; } + + /// + /// A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs. + /// + + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// The URLs associated with the attachment, each referring to a different representation of the attachment. + /// + + [JsonPropertyName("urls")] + public ICollection Urls { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_AttachmentUrl + { + /// + /// The type of consumer the URL is intended for. + /// + + [JsonPropertyName("consumerType")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Attachments_AttachmentUrlConsumerType ConsumerType { get; set; } + + /// + /// A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs. + /// + + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// The media type of the attachment. + /// + + [JsonPropertyName("mediaType")] + public string MediaType { get; set; } + + /// + /// The fully qualified URL of the attachment. + /// + + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_Content + { + /// + /// Additional information about the dialog, this may contain Markdown. + /// + + [JsonPropertyName("additionalInfo")] + public V1CommonContent_ContentValue AdditionalInfo { get; set; } + + /// + /// Used as the human-readable label used to describe the "ExtendedStatus" field. Must be text/plain. + /// + + [JsonPropertyName("extendedStatus")] + public V1CommonContent_ContentValue ExtendedStatus { get; set; } + + /// + /// Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS. + /// + + [JsonPropertyName("mainContentReference")] + public V1CommonContent_ContentValue MainContentReference { get; set; } + + /// + /// Overridden sender name. If not supplied, assume "org" as the sender name. Must be text/plain if supplied. + /// + + [JsonPropertyName("senderName")] + public V1CommonContent_ContentValue SenderName { get; set; } + + /// + /// A short summary of the dialog and its current state. Must be text/plain. + /// + + [JsonPropertyName("summary")] + public V1CommonContent_ContentValue Summary { get; set; } + + /// + /// The title of the dialog. Must be text/plain. + /// + + [JsonPropertyName("title")] + public V1CommonContent_ContentValue Title { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_Dialog + { + /// + /// An immutable list of activities associated with the dialog. When updating via PUT, any activities added here + ///
will be appended to the existing list of activities. + ///
+ + [JsonPropertyName("activities")] + public ICollection Activities { get; set; } + + /// + /// The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations. + /// + + [JsonPropertyName("apiActions")] + public ICollection ApiActions { get; set; } + + /// + /// The attachments associated with the dialog (on an aggregate level). + /// + + [JsonPropertyName("attachments")] + public ICollection Attachments { get; set; } + + /// + /// The dialog unstructured text content. + /// + + [JsonPropertyName("content")] + public V1ServiceOwnerDialogsCommandsUpdate_Content Content { get; set; } + + /// + /// The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available. + /// + + [JsonPropertyName("dueAt")] + public System.DateTimeOffset? DueAt { get; set; } + + /// + /// The expiration date for the dialog. This is the last date when the dialog is available for the end user. + ///
+ ///
After this date is passed, the dialog will be considered expired and no longer available for the end user in any + ///
API. If not supplied, the dialog will be considered to never expire. This field can be changed after creation. + ///
+ + [JsonPropertyName("expiresAt")] + public System.DateTimeOffset? ExpiresAt { get; set; } + + /// + /// Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of + ///
the dialog to further specify the "status" enum. + ///
+ + [JsonPropertyName("extendedStatus")] + public string ExtendedStatus { get; set; } + + /// + /// Arbitrary string with a service-specific reference to an external system or service. + /// + + [JsonPropertyName("externalReference")] + public string ExternalReference { get; set; } + + /// + /// The GUI actions associated with the dialog. Should be used in browser-based interactive frontends. + /// + + [JsonPropertyName("guiActions")] + public ICollection GuiActions { get; set; } + + /// + /// Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come + ///
to a natural completion (successful or not). + ///
+ + [JsonPropertyName("progress")] + public int? Progress { get; set; } + + /// + /// A list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO. + /// + + [JsonPropertyName("searchTags")] + public ICollection SearchTags { get; set; } + + /// + /// The aggregated status of the dialog. + /// + + [JsonPropertyName("status")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntities_DialogStatus Status { get; set; } + + /// + /// The immutable list of transmissions associated with the dialog. When updating via PUT, any transmissions + ///
added here will be appended to the existing list of transmissions. + ///
+ + [JsonPropertyName("transmissions")] + public ICollection Transmissions { get; set; } + + /// + /// The timestamp when the dialog should be made visible for authorized end users. If not provided, the dialog will be + ///
immediately available. + ///
+ + [JsonPropertyName("visibleFrom")] + public System.DateTimeOffset? VisibleFrom { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_GuiAction + { + /// + /// The action identifier for the action, corresponding to the "action" attributeId used in the XACML service policy. + /// + + [JsonPropertyName("action")] + public string Action { get; set; } + + /// + /// Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service + ///
policy, which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ ///
Can also be used to refer to other service policies. + ///
+ + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The HTTP method that the frontend should use when redirecting the user. + /// + + [JsonPropertyName("httpMethod")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Http_HttpVerb? HttpMethod { get; set; } + + /// + /// A UUIDv7 used for merging existing data, unknown IDs will be ignored as this entity does not support user-defined IDs. + /// + + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX + ///
for delete actions. + ///
+ + [JsonPropertyName("isDeleteDialogAction")] + public bool IsDeleteDialogAction { get; set; } + + /// + /// Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action + ///
priority. + ///
+ + [JsonPropertyName("priority")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesActions_DialogGuiActionPriority Priority { get; set; } + + /// + /// If there should be a prompt asking the user for confirmation before the action is executed, + ///
this field should contain the prompt text. + ///
+ + [JsonPropertyName("prompt")] + public ICollection Prompt { get; set; } + + /// + /// The title of the action, this should be short and in verb form. Must be text/plain. + /// + + [JsonPropertyName("title")] + public ICollection Title { get; set; } + + /// + /// The fully qualified URL of the action, to which the user will be redirected when the action is triggered. Will be set to + ///
"urn:dialogporten:unauthorized" if the user is not authorized to perform the action. + ///
+ + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_SearchTag + { + /// + /// A search tag value. + /// + + [JsonPropertyName("value")] + public string Value { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_Transmission + { + /// + /// The transmission-level attachments. + /// + + [JsonPropertyName("attachments")] + public ICollection Attachments { get; set; } + + /// + /// Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service + ///
policy, which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ ///
Can also be used to refer to other service policies. + ///
+ + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The transmission unstructured text content. + /// + + [JsonPropertyName("content")] + public V1ServiceOwnerDialogsCommandsUpdate_TransmissionContent Content { get; set; } + + /// + /// If supplied, overrides the creating date and time for the transmission. + ///
If not supplied, the current date /time will be used. + ///
+ + [JsonPropertyName("createdAt")] + public System.DateTimeOffset CreatedAt { get; set; } + + /// + /// Arbitrary URI/URN describing a service-specific transmission type. + ///
+ ///
Refer to the service-specific documentation provided by the service owner for details (if in use). + ///
+ + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// The UUDIv7 of the action may be provided to support idempotent additions to the list of transmissions. + ///
If not supplied, a new UUIDv7 will be generated. + ///
+ + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// Reference to any other transmission that this transmission is related to. + /// + + [JsonPropertyName("relatedTransmissionId")] + public System.Guid? RelatedTransmissionId { get; set; } + + /// + /// The actor that sent the transmission. + /// + + [JsonPropertyName("sender")] + public V1ServiceOwnerCommonActors_Actor Sender { get; set; } + + /// + /// The type of transmission. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesTransmissions_DialogTransmissionType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachment + { + /// + /// The display name of the attachment that should be used in GUIs. + /// + + [JsonPropertyName("displayName")] + public ICollection DisplayName { get; set; } + + /// + /// A self-defined UUIDv7 may be provided to support idempotent creation of transmission attachments. If not provided, a new UUIDv7 will be generated. + /// + + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// The URLs associated with the attachment, each referring to a different representation of the attachment. + /// + + [JsonPropertyName("urls")] + public ICollection Urls { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachmentUrl + { + /// + /// The type of consumer the URL is intended for. + /// + + [JsonPropertyName("consumerType")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Attachments_AttachmentUrlConsumerType ConsumerType { get; set; } + + /// + /// The media type of the attachment. + /// + + [JsonPropertyName("mediaType")] + public string MediaType { get; set; } + + /// + /// The fully qualified URL of the attachment. + /// + + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsCommandsUpdate_TransmissionContent + { + /// + /// Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS. + ///
Allowed media types: application/vnd.dialogporten.frontchannelembed+json;type=markdown + ///
+ + [JsonPropertyName("contentReference")] + public V1CommonContent_ContentValue ContentReference { get; set; } + + /// + /// The transmission summary. + /// + + [JsonPropertyName("summary")] + public V1CommonContent_ContentValue Summary { get; set; } + + /// + /// The transmission title. Must be text/plain. + /// + + [JsonPropertyName("title")] + public V1CommonContent_ContentValue Title { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogSeenLogsQueriesGet_SeenLog + { + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + [JsonPropertyName("isViaServiceOwner")] + public bool? IsViaServiceOwner { get; set; } + + [JsonPropertyName("seenAt")] + public System.DateTimeOffset SeenAt { get; set; } + + [JsonPropertyName("seenBy")] + public V1ServiceOwnerCommonActors_Actor SeenBy { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogSeenLogsQueriesSearch_SeenLog + { + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + [JsonPropertyName("isViaServiceOwner")] + public bool? IsViaServiceOwner { get; set; } + + [JsonPropertyName("seenAt")] + public System.DateTimeOffset SeenAt { get; set; } + + [JsonPropertyName("seenBy")] + public V1ServiceOwnerCommonActors_Actor SeenBy { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_Content + { + /// + /// Additional information about the dialog, this may contain Markdown. + /// + + [JsonPropertyName("additionalInfo")] + public V1CommonContent_ContentValue AdditionalInfo { get; set; } + + /// + /// Used as the human-readable label used to describe the "ExtendedStatus" field. + /// + + [JsonPropertyName("extendedStatus")] + public V1CommonContent_ContentValue ExtendedStatus { get; set; } + + /// + /// Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS. + ///
Allowed media types: application/vnd.dialogporten.frontchannelembed+json;type=markdown + ///
+ + [JsonPropertyName("mainContentReference")] + public V1CommonContent_ContentValue MainContentReference { get; set; } + + /// + /// Overridden sender name. If not supplied, assume "org" as the sender name. + /// + + [JsonPropertyName("senderName")] + public V1CommonContent_ContentValue SenderName { get; set; } + + /// + /// A short summary of the dialog and its current state. + /// + + [JsonPropertyName("summary")] + public V1CommonContent_ContentValue Summary { get; set; } + + /// + /// The title of the dialog. + /// + + [JsonPropertyName("title")] + public V1CommonContent_ContentValue Title { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_Dialog + { + /// + /// An immutable list of activities associated with the dialog. + /// + + [JsonPropertyName("activities")] + public ICollection Activities { get; set; } + + /// + /// The API actions associated with the dialog. Should be used in specialized, non-browser-based integrations. + /// + + [JsonPropertyName("apiActions")] + public ICollection ApiActions { get; set; } + + /// + /// The attachments associated with the dialog (on an aggregate level). + /// + + [JsonPropertyName("attachments")] + public ICollection Attachments { get; set; } + + /// + /// The dialog unstructured text content. + /// + + [JsonPropertyName("content")] + public V1ServiceOwnerDialogsQueriesGet_Content Content { get; set; } + + /// + /// The date and time when the dialog was created. + /// + + [JsonPropertyName("createdAt")] + public System.DateTimeOffset CreatedAt { get; set; } + + /// + /// If deleted, the date and time when the deletion was performed. + /// + + [JsonPropertyName("deletedAt")] + public System.DateTimeOffset? DeletedAt { get; set; } + + /// + /// The due date for the dialog. Dialogs past due date might be marked as such in frontends but will still be available. + /// + + [JsonPropertyName("dueAt")] + public System.DateTimeOffset? DueAt { get; set; } + + /// + /// The expiration date for the dialog. This is the last date when the dialog is available for the end user. + ///
+ ///
After this date is passed, the dialog will be considered expired and no longer available for the end user in any + ///
API. If not supplied, the dialog will be considered to never expire. This field can be changed by the service + ///
owner after the dialog has been created. + ///
+ + [JsonPropertyName("expiresAt")] + public System.DateTimeOffset? ExpiresAt { get; set; } + + /// + /// Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of + ///
the dialog to further specify the "status" enum. + ///
+ ///
Refer to the service-specific documentation provided by the service owner for details on the possible values (if + ///
in use). + ///
+ + [JsonPropertyName("extendedStatus")] + public string ExtendedStatus { get; set; } + + /// + /// Arbitrary string with a service-specific reference to an external system or service. + ///
+ ///
Refer to the service-specific documentation provided by the service owner for details (if in use). + ///
+ + [JsonPropertyName("externalReference")] + public string ExternalReference { get; set; } + + /// + /// The GUI actions associated with the dialog. Should be used in browser-based interactive frontends. + /// + + [JsonPropertyName("guiActions")] + public ICollection GuiActions { get; set; } + + /// + /// The unique identifier for the dialog in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The service owner code representing the organization (service owner) related to this dialog. + /// + + [JsonPropertyName("org")] + public string Org { get; set; } + + /// + /// The party code representing the organization or person that the dialog belongs to in URN format. + /// + + [JsonPropertyName("party")] + public string Party { get; set; } + + /// + /// Optional preceding process identifier to indicate the business process that preceded the process indicated in the "Process" field. Cannot be set without also "Process" being set. + /// + + [JsonPropertyName("precedingProcess")] + public string PrecedingProcess { get; set; } + + /// + /// Optional process identifier used to indicate a business process this dialog belongs to. + /// + + [JsonPropertyName("process")] + public string Process { get; set; } + + /// + /// Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come + ///
to a natural completion (successful or not). + ///
+ + [JsonPropertyName("progress")] + public int? Progress { get; set; } + + /// + /// The unique identifier for the revision in UUIDv4 format. + /// + + [JsonPropertyName("revision")] + public System.Guid Revision { get; set; } + + /// + /// The list of words (tags) that will be used in dialog search queries. Not visible in end-user DTO. + /// + + [JsonPropertyName("searchTags")] + public ICollection SearchTags { get; set; } + + /// + /// The list of seen log entries for the dialog newer than the dialog ChangedAt date. + /// + + [JsonPropertyName("seenSinceLastUpdate")] + public ICollection SeenSinceLastUpdate { get; set; } + + /// + /// The service identifier for the service that the dialog is related to in URN-format. + ///
This corresponds to a service resource in the Altinn Resource Registry. + ///
+ + [JsonPropertyName("serviceResource")] + public string ServiceResource { get; set; } + + /// + /// The ServiceResource type, as defined in Altinn Resource Registry (see ResourceType). + /// + + [JsonPropertyName("serviceResourceType")] + public string ServiceResourceType { get; set; } + + /// + /// The aggregated status of the dialog. + /// + + [JsonPropertyName("status")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntities_DialogStatus Status { get; set; } + + /// + /// Current display state. + /// + + [JsonPropertyName("systemLabel")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogEndUserContextsEntities_SystemLabel SystemLabel { get; set; } + + /// + /// The immutable list of transmissions associated with the dialog. + /// + + [JsonPropertyName("transmissions")] + public ICollection Transmissions { get; set; } + + /// + /// The date and time when the dialog was last updated. + /// + + [JsonPropertyName("updatedAt")] + public System.DateTimeOffset UpdatedAt { get; set; } + + /// + /// The timestamp when the dialog will be made visible for authorized end users. + /// + + [JsonPropertyName("visibleFrom")] + public System.DateTimeOffset? VisibleFrom { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogActivity + { + /// + /// The date and time when the activity was created. + /// + + [JsonPropertyName("createdAt")] + public System.DateTimeOffset? CreatedAt { get; set; } + + /// + /// Unstructured text describing the activity. Only set if the activity type is "Information". + /// + + [JsonPropertyName("description")] + public ICollection Description { get; set; } + + /// + /// An arbitrary URI/URN with a service-specific activity type. + ///
+ ///
Consult the service-specific documentation provided by the service owner for details (if in use). + ///
+ + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// The unique identifier for the activity in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The actor that performed the activity. + /// + + [JsonPropertyName("performedBy")] + public V1ServiceOwnerCommonActors_Actor PerformedBy { get; set; } + + /// + /// If the activity is related to a particular transmission, this field will contain the transmission identifier. + /// + + [JsonPropertyName("transmissionId")] + public System.Guid? TransmissionId { get; set; } + + /// + /// The type of activity. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesActivities_DialogActivityType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogApiAction + { + /// + /// String identifier for the action, corresponding to the "action" attributeId used in the XACML service policy, + ///
which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ + [JsonPropertyName("action")] + public string Action { get; set; } + + /// + /// Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service + ///
policy, which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ ///
Can also be used to refer to other service policies. + ///
+ + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The endpoints associated with the action. + /// + + [JsonPropertyName("endpoints")] + public ICollection Endpoints { get; set; } + + /// + /// The unique identifier for the action in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// True if the authenticated user (set in the query) is authorized for this action. + /// + + [JsonPropertyName("isAuthorized")] + public bool? IsAuthorized { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogApiActionEndpoint + { + /// + /// Boolean indicating if the endpoint is deprecated. Integrators should migrate to endpoints with a higher version. + /// + + [JsonPropertyName("deprecated")] + public bool Deprecated { get; set; } + + /// + /// Link to service provider documentation for the endpoint. Used for service owners to provide documentation for + ///
integrators. Should be a URL to a human-readable page. + ///
+ + [JsonPropertyName("documentationUrl")] + public System.Uri DocumentationUrl { get; set; } + + /// + /// The HTTP method that the endpoint expects for this action. + /// + + [JsonPropertyName("httpMethod")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Http_HttpVerb HttpMethod { get; set; } + + /// + /// The unique identifier for the endpoint in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// Link to the request schema for the endpoint. Used by service owners to provide documentation for integrators. + ///
Dialogporten will not validate information on this endpoint. + ///
+ + [JsonPropertyName("requestSchema")] + public System.Uri RequestSchema { get; set; } + + /// + /// Link to the response schema for the endpoint. Used for service owners to provide documentation for integrators. + ///
Dialogporten will not validate information on this endpoint. + ///
+ + [JsonPropertyName("responseSchema")] + public System.Uri ResponseSchema { get; set; } + + /// + /// Date and time when the service owner has indicated that endpoint will no longer function. Only set if the endpoint + ///
is deprecated. Dialogporten will not enforce this date. + ///
+ + [JsonPropertyName("sunsetAt")] + public System.DateTimeOffset? SunsetAt { get; set; } + + /// + /// The fully qualified URL of the API endpoint. + /// + + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + /// + /// Arbitrary string indicating the version of the endpoint. + ///
+ ///
Consult the service-specific documentation provided by the service owner for details (if in use). + ///
+ + [JsonPropertyName("version")] + public string Version { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogAttachment + { + /// + /// The display name of the attachment that should be used in GUIs. + /// + + [JsonPropertyName("displayName")] + public ICollection DisplayName { get; set; } + + /// + /// The unique identifier for the attachment in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The URLs associated with the attachment, each referring to a different representation of the attachment. + /// + + [JsonPropertyName("urls")] + public ICollection Urls { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogAttachmentUrl + { + /// + /// What type of consumer the URL is intended for. + /// + + [JsonPropertyName("consumerType")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Attachments_AttachmentUrlConsumerType ConsumerType { get; set; } + + /// + /// The unique identifier for the attachment URL in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The media type of the attachment. + /// + + [JsonPropertyName("mediaType")] + public string MediaType { get; set; } + + /// + /// The fully qualified URL of the attachment. + /// + + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogGuiAction + { + /// + /// The action identifier for the action, corresponding to the "action" attributeId used in the XACML service policy. + /// + + [JsonPropertyName("action")] + public string Action { get; set; } + + /// + /// Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service + ///
policy, which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ ///
Can also be used to refer to other service policies. + ///
+ + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The HTTP method that the frontend should use when redirecting the user. + /// + + [JsonPropertyName("httpMethod")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Http_HttpVerb HttpMethod { get; set; } + + /// + /// The unique identifier for the action in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// Whether the user, if supplied in the query, is authorized to perform the action. + /// + + [JsonPropertyName("isAuthorized")] + public bool? IsAuthorized { get; set; } + + /// + /// Indicates whether the action results in the dialog being deleted. Used by frontends to implement custom UX + ///
for delete actions. + ///
+ + [JsonPropertyName("isDeleteDialogAction")] + public bool IsDeleteDialogAction { get; set; } + + /// + /// Indicates a priority for the action, making it possible for frontends to adapt GUI elements based on action + ///
priority. + ///
+ + [JsonPropertyName("priority")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesActions_DialogGuiActionPriority Priority { get; set; } + + /// + /// If there should be a prompt asking the user for confirmation before the action is executed, + ///
this field should contain the prompt text. + ///
+ + [JsonPropertyName("prompt")] + public ICollection Prompt { get; set; } + + /// + /// The title of the action, this should be short and in verb form. + /// + + [JsonPropertyName("title")] + public ICollection Title { get; set; } + + /// + /// The fully qualified URL of the action, to which the user will be redirected when the action is triggered. + /// + + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogSeenLog + { + /// + /// The unique identifier for the seen log entry in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// Flag indicating whether the seen log entry was created by the current end user, if provided in the query. + /// + + [JsonPropertyName("isCurrentEndUser")] + public bool IsCurrentEndUser { get; set; } + + /// + /// Flag indicating whether the seen log entry was created via the service owner. + ///
+ ///
This is used when the service owner uses the service owner API to implement its own frontend. + ///
+ + [JsonPropertyName("isViaServiceOwner")] + public bool? IsViaServiceOwner { get; set; } + + /// + /// The timestamp when the dialog revision was seen. + /// + + [JsonPropertyName("seenAt")] + public System.DateTimeOffset SeenAt { get; set; } + + /// + /// The actor that saw the dialog revision. + /// + + [JsonPropertyName("seenBy")] + public V1ServiceOwnerCommonActors_Actor SeenBy { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogTransmission + { + /// + /// The transmission-level attachments. + /// + + [JsonPropertyName("attachments")] + public ICollection Attachments { get; set; } + + /// + /// Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service + ///
policy, which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ ///
Can also be used to refer to other service policies. + ///
+ + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The transmission unstructured text content. + /// + + [JsonPropertyName("content")] + public V1ServiceOwnerDialogsQueriesGet_DialogTransmissionContent Content { get; set; } + + /// + /// The date and time when the transmission was created. + /// + + [JsonPropertyName("createdAt")] + public System.DateTimeOffset CreatedAt { get; set; } + + /// + /// Arbitrary URI/URN describing a service-specific transmission type. + ///
+ ///
Refer to the service-specific documentation provided by the service owner for details (if in use). + ///
+ + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// The unique identifier for the transmission in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// Flag indicating if the authenticated user supplied in the query is authorized for this transmission. + /// + + [JsonPropertyName("isAuthorized")] + public bool? IsAuthorized { get; set; } + + /// + /// Reference to any other transmission that this transmission is related to. + /// + + [JsonPropertyName("relatedTransmissionId")] + public System.Guid? RelatedTransmissionId { get; set; } + + /// + /// The actor that sent the transmission. + /// + + [JsonPropertyName("sender")] + public V1ServiceOwnerCommonActors_Actor Sender { get; set; } + + /// + /// The type of transmission. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesTransmissions_DialogTransmissionType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogTransmissionAttachment + { + /// + /// The display name of the attachment that should be used in GUIs. + /// + + [JsonPropertyName("displayName")] + public ICollection DisplayName { get; set; } + + /// + /// The unique identifier for the attachment in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The URLs associated with the attachment, each referring to a different representation of the attachment. + /// + + [JsonPropertyName("urls")] + public ICollection Urls { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogTransmissionAttachmentUrl + { + /// + /// The type of consumer the URL is intended for. + /// + + [JsonPropertyName("consumerType")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Attachments_AttachmentUrlConsumerType ConsumerType { get; set; } + + /// + /// The media type of the attachment. + /// + + [JsonPropertyName("mediaType")] + public string MediaType { get; set; } + + /// + /// The fully qualified URL of the attachment. Will be set to "urn:dialogporten:unauthorized" if the user is + ///
not authorized to access the transmission. + ///
+ + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_DialogTransmissionContent + { + /// + /// Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. Must be HTTPS. + ///
Allowed media types: application/vnd.dialogporten.frontchannelembed+json;type=markdown + ///
+ + [JsonPropertyName("contentReference")] + public V1CommonContent_ContentValue ContentReference { get; set; } + + /// + /// The transmission summary. + /// + + [JsonPropertyName("summary")] + public V1CommonContent_ContentValue Summary { get; set; } + + /// + /// The transmission title. + /// + + [JsonPropertyName("title")] + public V1CommonContent_ContentValue Title { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesGet_SearchTag + { + /// + /// A search tag value. + /// + + [JsonPropertyName("value")] + public string Value { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesSearch_Content + { + /// + /// Used as the human-readable label used to describe the "ExtendedStatus" field. + /// + + [JsonPropertyName("extendedStatus")] + public V1CommonContent_ContentValue ExtendedStatus { get; set; } + + /// + /// Overridden sender name. If not supplied, assume "org" as the sender name. + /// + + [JsonPropertyName("senderName")] + public V1CommonContent_ContentValue SenderName { get; set; } + + /// + /// A short summary of the dialog and its current state. + /// + + [JsonPropertyName("summary")] + public V1CommonContent_ContentValue Summary { get; set; } + + /// + /// The title of the dialog. + /// + + [JsonPropertyName("title")] + public V1CommonContent_ContentValue Title { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesSearch_Dialog + { + /// + /// The content of the dialog in search results. + /// + + [JsonPropertyName("content")] + public V1ServiceOwnerDialogsQueriesSearch_Content Content { get; set; } + + /// + /// The date and time when the dialog was created. + /// + + [JsonPropertyName("createdAt")] + public System.DateTimeOffset CreatedAt { get; set; } + + /// + /// The due date for the dialog. This is the last date when the dialog is expected to be completed. + /// + + [JsonPropertyName("dueAt")] + public System.DateTimeOffset? DueAt { get; set; } + + /// + /// Arbitrary string with a service-specific indicator of status, typically used to indicate a fine-grained state of + ///
the dialog to further specify the "status" enum. + ///
+ ///
Refer to the service-specific documentation provided by the service owner for details on the possible values (if + ///
in use). + ///
+ + [JsonPropertyName("extendedStatus")] + public string ExtendedStatus { get; set; } + + /// + /// Arbitrary string with a service-specific reference to an external system or service. + ///
+ ///
Refer to the service-specific documentation provided by the service owner for details (if in use). + ///
+ + [JsonPropertyName("externalReference")] + public string ExternalReference { get; set; } + + /// + /// The number of attachments in the dialog made available for browser-based frontends. + /// + + [JsonPropertyName("guiAttachmentCount")] + public int? GuiAttachmentCount { get; set; } + + /// + /// The unique identifier for the dialog in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The latest entry in the dialog's activity log. + /// + + [JsonPropertyName("latestActivity")] + public V1ServiceOwnerDialogsQueriesSearch_DialogActivity LatestActivity { get; set; } + + /// + /// The service owner code representing the organization (service owner) related to this dialog. + /// + + [JsonPropertyName("org")] + public string Org { get; set; } + + /// + /// The party code representing the organization or person that the dialog belongs to in URN format. + /// + + [JsonPropertyName("party")] + public string Party { get; set; } + + /// + /// Optional preceding process identifier to indicate the business process that preceded the process indicated in the "Process" field. Cannot be set without also "Process" being set. + /// + + [JsonPropertyName("precedingProcess")] + public string PrecedingProcess { get; set; } + + /// + /// Optional process identifier used to indicate a business process this dialog belongs to. + /// + + [JsonPropertyName("process")] + public string Process { get; set; } + + /// + /// Advisory indicator of progress, represented as 1-100 percentage value. 100% representing a dialog that has come + ///
to a natural completion (successful or not). + ///
+ + [JsonPropertyName("progress")] + public int? Progress { get; set; } + + /// + /// The unique identifier for the revision in UUIDv4 format. + /// + + [JsonPropertyName("revision")] + public System.Guid Revision { get; set; } + + /// + /// The list of seen log entries for the dialog newer than the dialog ChangedAt date. + /// + + [JsonPropertyName("seenSinceLastUpdate")] + public ICollection SeenSinceLastUpdate { get; set; } + + /// + /// The service identifier for the service that the dialog is related to in URN-format. + ///
This corresponds to a service resource in the Altinn Resource Registry. + ///
+ + [JsonPropertyName("serviceResource")] + public string ServiceResource { get; set; } + + /// + /// The ServiceResource type, as defined in Altinn Resource Registry (see ResourceType). + /// + + [JsonPropertyName("serviceResourceType")] + public string ServiceResourceType { get; set; } + + /// + /// The aggregated status of the dialog. + /// + + [JsonPropertyName("status")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntities_DialogStatus Status { get; set; } + + /// + /// Current display state. + /// + + [JsonPropertyName("systemLabel")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogEndUserContextsEntities_SystemLabel SystemLabel { get; set; } + + /// + /// The date and time when the dialog was last updated. + /// + + [JsonPropertyName("updatedAt")] + public System.DateTimeOffset UpdatedAt { get; set; } + + /// + /// The timestamp when the dialog will be made visible for authorized end users. + /// + + [JsonPropertyName("visibleFrom")] + public System.DateTimeOffset? VisibleFrom { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesSearch_DialogActivity + { + /// + /// The date and time when the activity was created. + /// + + [JsonPropertyName("createdAt")] + public System.DateTimeOffset? CreatedAt { get; set; } + + /// + /// Unstructured text describing the activity. Only set if the activity type is "Information". + /// + + [JsonPropertyName("description")] + public ICollection Description { get; set; } + + /// + /// An arbitrary string with a service-specific activity type. + ///
+ ///
Consult the service-specific documentation provided by the service owner for details (if in use). + ///
+ + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// The unique identifier for the activity in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The actor that performed the activity. + /// + + [JsonPropertyName("performedBy")] + public V1ServiceOwnerCommonActors_Actor PerformedBy { get; set; } + + /// + /// If the activity is related to a particular transmission, this field will contain the transmission identifier. + /// + + [JsonPropertyName("transmissionId")] + public System.Guid? TransmissionId { get; set; } + + /// + /// The type of activity. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesActivities_DialogActivityType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogsQueriesSearch_DialogSeenLog + { + /// + /// The unique identifier for the seen log entry in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// Flag indicating whether the seen log entry was created by the end user supplied in the query. + /// + + [JsonPropertyName("isCurrentEndUser")] + public bool IsCurrentEndUser { get; set; } + + /// + /// Flag indicating whether the seen log entry was created via the service owner. + ///
+ ///
This is used when the service owner uses the service owner API to implement its own frontend. + ///
+ + [JsonPropertyName("isViaServiceOwner")] + public bool? IsViaServiceOwner { get; set; } + + /// + /// The timestamp when the dialog revision was seen. + /// + + [JsonPropertyName("seenAt")] + public System.DateTimeOffset SeenAt { get; set; } + + /// + /// The actor that saw the dialog revision. + /// + + [JsonPropertyName("seenBy")] + public V1ServiceOwnerCommonActors_Actor SeenBy { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogTransmissionsCreate_TransmissionRequest + { + /// + /// The transmission-level attachments. + /// + + [JsonPropertyName("attachments")] + public ICollection Attachments { get; set; } + + /// + /// Contains an authorization resource attributeId, that can used in custom authorization rules in the XACML service + ///
policy, which by default is the policy belonging to the service referred to by "serviceResource" in the dialog. + ///
+ ///
Can also be used to refer to other service policies. + ///
+ + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The transmission unstructured text content. + /// + + [JsonPropertyName("content")] + public V1ServiceOwnerDialogsCommandsUpdate_TransmissionContent Content { get; set; } + + /// + /// If supplied, overrides the creating date and time for the transmission. + ///
If not supplied, the current date /time will be used. + ///
+ + [JsonPropertyName("createdAt")] + public System.DateTimeOffset CreatedAt { get; set; } + + /// + /// Arbitrary URI/URN describing a service-specific transmission type. + ///
+ ///
Refer to the service-specific documentation provided by the service owner for details (if in use). + ///
+ + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// The UUDIv7 of the action may be provided to support idempotent additions to the list of transmissions. + ///
If not supplied, a new UUIDv7 will be generated. + ///
+ + [JsonPropertyName("id")] + public System.Guid? Id { get; set; } + + /// + /// Reference to any other transmission that this transmission is related to. + /// + + [JsonPropertyName("relatedTransmissionId")] + public System.Guid? RelatedTransmissionId { get; set; } + + /// + /// The actor that sent the transmission. + /// + + [JsonPropertyName("sender")] + public V1ServiceOwnerCommonActors_Actor Sender { get; set; } + + /// + /// The type of transmission. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesTransmissions_DialogTransmissionType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogTransmissionsQueriesGet_Attachment + { + /// + /// The display name of the attachment that should be used in GUIs. + /// + + [JsonPropertyName("displayName")] + public ICollection DisplayName { get; set; } + + /// + /// The unique identifier for the attachment in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The URLs associated with the attachment, each referring to a different representation of the attachment. + /// + + [JsonPropertyName("urls")] + public ICollection Urls { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogTransmissionsQueriesGet_AttachmentUrl + { + /// + /// The type of consumer the URL is intended for. + /// + + [JsonPropertyName("consumerType")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Attachments_AttachmentUrlConsumerType ConsumerType { get; set; } + + /// + /// The unique identifier for the attachment URL in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The media type of the attachment. + /// + + [JsonPropertyName("mediaType")] + public string MediaType { get; set; } + + /// + /// The fully qualified URL of the attachment. Will be set to "urn:dialogporten:unauthorized" if the user is + ///
not authorized to access the transmission. + ///
+ + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogTransmissionsQueriesGet_Content + { + /// + /// Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. + ///
Allowed media types: application/vnd.dialogporten.frontchannelembed+json;type=markdown + ///
+ + [JsonPropertyName("contentReference")] + public V1CommonContent_ContentValue ContentReference { get; set; } + + /// + /// The summary of the content. + /// + + [JsonPropertyName("summary")] + public V1CommonContent_ContentValue Summary { get; set; } + + /// + /// The title of the content. + /// + + [JsonPropertyName("title")] + public V1CommonContent_ContentValue Title { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogTransmissionsQueriesGet_Transmission + { + /// + /// The attachments associated with the transmission. + /// + + [JsonPropertyName("attachments")] + public ICollection Attachments { get; set; } + + /// + /// The authorization attribute associated with the transmission. + /// + + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The content of the transmission. + /// + + [JsonPropertyName("content")] + public V1ServiceOwnerDialogTransmissionsQueriesGet_Content Content { get; set; } + + /// + /// The date and time when the transmission was created. + /// + + [JsonPropertyName("createdAt")] + public System.DateTimeOffset CreatedAt { get; set; } + + /// + /// The date and time when the transmission was deleted, if applicable. + /// + + [JsonPropertyName("deletedAt")] + public System.DateTimeOffset? DeletedAt { get; set; } + + /// + /// The extended type URI for the transmission. + /// + + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// The unique identifier for the transmission in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The unique identifier for the related transmission, if any. + /// + + [JsonPropertyName("relatedTransmissionId")] + public System.Guid? RelatedTransmissionId { get; set; } + + /// + /// The sender actor information for the transmission. + /// + + [JsonPropertyName("sender")] + public V1ServiceOwnerCommonActors_Actor Sender { get; set; } + + /// + /// The type of the transmission. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesTransmissions_DialogTransmissionType Type { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogTransmissionsQueriesSearch_Attachment + { + /// + /// The display name of the attachment that should be used in GUIs. + /// + + [JsonPropertyName("displayName")] + public ICollection DisplayName { get; set; } + + /// + /// The unique identifier for the attachment in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The URLs associated with the attachment, each referring to a different representation of the attachment. + /// + + [JsonPropertyName("urls")] + public ICollection Urls { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogTransmissionsQueriesSearch_AttachmentUrl + { + /// + /// The type of consumer the URL is intended for. + /// + + [JsonPropertyName("consumerType")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public Attachments_AttachmentUrlConsumerType ConsumerType { get; set; } + + /// + /// The unique identifier for the attachment URL in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The media type of the attachment. + /// + + [JsonPropertyName("mediaType")] + public string MediaType { get; set; } + + /// + /// The fully qualified URL of the attachment. Will be set to "urn:dialogporten:unauthorized" if the user is + ///
not authorized to access the transmission. + ///
+ + [JsonPropertyName("url")] + public System.Uri Url { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogTransmissionsQueriesSearch_Content + { + /// + /// Front-channel embedded content. Used to dynamically embed content in the frontend from an external URL. + /// + + [JsonPropertyName("contentReference")] + public V1CommonContent_ContentValue ContentReference { get; set; } + + /// + /// The summary of the content. + /// + + [JsonPropertyName("summary")] + public V1CommonContent_ContentValue Summary { get; set; } + + /// + /// The title of the content. + /// + + [JsonPropertyName("title")] + public V1CommonContent_ContentValue Title { get; set; } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))")] + public partial class V1ServiceOwnerDialogTransmissionsQueriesSearch_Transmission + { + /// + /// The attachments associated with the transmission. + /// + + [JsonPropertyName("attachments")] + public ICollection Attachments { get; set; } + + /// + /// The authorization attribute associated with the transmission. + /// + + [JsonPropertyName("authorizationAttribute")] + public string AuthorizationAttribute { get; set; } + + /// + /// The content of the transmission. + /// + + [JsonPropertyName("content")] + public V1ServiceOwnerDialogTransmissionsQueriesSearch_Content Content { get; set; } + + /// + /// The date and time when the transmission was created. + /// + + [JsonPropertyName("createdAt")] + public System.DateTimeOffset CreatedAt { get; set; } + + /// + /// The date and time when the transmission was deleted, if applicable. + /// + + [JsonPropertyName("deletedAt")] + public System.DateTimeOffset? DeletedAt { get; set; } + + /// + /// The extended type URI for the transmission. + /// + + [JsonPropertyName("extendedType")] + public System.Uri ExtendedType { get; set; } + + /// + /// The unique identifier for the transmission in UUIDv7 format. + /// + + [JsonPropertyName("id")] + public System.Guid Id { get; set; } + + /// + /// The unique identifier for the related transmission, if any. + /// + + [JsonPropertyName("relatedTransmissionId")] + public System.Guid? RelatedTransmissionId { get; set; } + + /// + /// The sender actor information for the transmission. + /// + + [JsonPropertyName("sender")] + public V1ServiceOwnerCommonActors_Actor Sender { get; set; } + + /// + /// The type of the transmission. + /// + + [JsonPropertyName("type")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public DialogsEntitiesTransmissions_DialogTransmissionType Type { get; set; } + + } + + +} + +#pragma warning restore 108 +#pragma warning restore 114 +#pragma warning restore 472 +#pragma warning restore 612 +#pragma warning restore 1573 +#pragma warning restore 1591 +#pragma warning restore 8073 +#pragma warning restore 3016 +#pragma warning restore 8603 +#pragma warning restore 8604 +#pragma warning restore 8625 diff --git a/src/Digdir.Library.Dialogporten.WebApiClient/Interfaces/IDialogportenSettings.cs b/src/Digdir.Library.Dialogporten.WebApiClient/Interfaces/IDialogportenSettings.cs new file mode 100644 index 000000000..7cdb8651f --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient/Interfaces/IDialogportenSettings.cs @@ -0,0 +1,29 @@ +namespace Digdir.Library.Dialogporten.WebApiClient.Interfaces; + +public interface IDialogportenSettings +{ + /// + /// ClientID to use + /// + string ClientId { get; set; } + + /// + /// Scopes to request. Must be provisioned on the supplied client. + /// + string Scope { get; set; } + + /// + /// Resource claim for assertion. This will be the `aud`-claim in the received access token + /// + string Resource { get; set; } + + /// + /// The Maskinporten environment. Valid values are ver1, ver2, test or prod + /// + string Environment { get; set; } + + /// + /// Base64 Encoded Json Web Key + /// + string EncodedJwk { get; set; } +} diff --git a/src/Digdir.Library.Dialogporten.WebApiClient/Interfaces/IIdentifiable.cs b/src/Digdir.Library.Dialogporten.WebApiClient/Interfaces/IIdentifiable.cs new file mode 100644 index 000000000..20c0107a3 --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient/Interfaces/IIdentifiable.cs @@ -0,0 +1,7 @@ +namespace Digdir.Library.Dialogporten.WebApiClient.Interfaces; + +public interface IIdentifiable +{ + Guid Id { get; } + Guid RevisionId { get; } +} diff --git a/src/Digdir.Library.Dialogporten.WebApiClient/README.md b/src/Digdir.Library.Dialogporten.WebApiClient/README.md new file mode 100644 index 000000000..33ab21fa0 --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient/README.md @@ -0,0 +1,205 @@ +# SO SDK + +Simple overview +Refit-based client SDK Based on https://github.com/altinn/altinn-apiclient-maskinporten + +The refit-Interface is autogenerated with refitter. It uses OperationId to create method names. +Uses refit IApiResponse on returns. + +## Installation + +Install nuget + +## Usage + +This library provides extensions methods providing means to create dialogporten clients. + +Setup + +```C# +var configuration = new ConfigurationBuilder() + .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) + .Build(); + +var services = new ServiceCollection(); + +services.AddSingleton(configuration); + +services.AddDialogportenClient(); +services.AddDialogTokenVerifer(); +var dialogportenClient = serviceProvider.GetRequiredService(); +``` + +AppSettings + +```JSON +{ + "DialogportenSettings": { + "Environment": "", + "Maskinporten": { + "ClientId": "", + "Scope": "", + "EncodedJwk": "" + } + }, + "Ed25519Keys": { + "Primary": { + "Kid": "", + "PublicComponent": "" + }, + "Secondary": { + "Kid": "", + "PublicComponent": "" + } + } +} +``` + +Basic usage + +```C# +// Basic Usage example + +// Create a dialog +var createDialogCommand = new V1ServiceOwnerDialogsCommandsCreate_DialogCommand +{ + // createDialogCommand.Id = Guid.Parse("01927a6d-40d8-728b-b3da-845b680840d9"); + ServiceResource = "urn:altinn:resource:super-simple-service", + Party = "urn:altinn:person:identifier-no:14886498226", + SystemLabel = DialogEndUserContextsEntities_SystemLabel.Default, + Status = DialogsEntities_DialogStatus.New, + Progress = 2, + Content = new V1ServiceOwnerDialogsCommandsCreate_Content + { + Title = new V1CommonContent_ContentValue + { + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved" + }, + new V1CommonLocalizations_Localization + { + LanguageCode = "en", + Value = "Main" + } + ], + MediaType = "text/plain" + }, + Summary = new V1CommonContent_ContentValue + { + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved Summary" + }, + new V1CommonLocalizations_Localization + { + LanguageCode = "en", + Value = "Main Summary" + } + ], + MediaType = "text/plain" + } + + + }, + Transmissions = + [ + new V1ServiceOwnerDialogsCommandsCreate_Transmission + { + Attachments = + [ + new V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachment + { + DisplayName = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved misson" + } + ], + Urls = + [ + new V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachmentUrl + { + ConsumerType = Attachments_AttachmentUrlConsumerType.Gui, + Url = new Uri("https://digdir.apps.tt02.altinn.no/some-other-url") + } + ] + + } + ], + Content = new V1ServiceOwnerDialogsCommandsCreate_TransmissionContent + { + Summary = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Tranmission summary" + } + ] + }, + Title = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Tranmission Title" + } + ] + } + }, + Sender = new V1ServiceOwnerCommonActors_Actor + { + ActorType = Actors_ActorType.ServiceOwner + }, + Type = DialogsEntitiesTransmissions_DialogTransmissionType.Information + } + ] +}; +var response = await dialogportenClient.DialogsPost(createDialogCommand); +if (response.IsSuccessStatusCode) +{ + Console.WriteLine(response.StatusCode); + string guid = response.Content; +} +``` + +```C# +// Patch Dialog +List patchDocument = +[ + new() + { + Op = "replace", + OperationType = JsonPatchOperations_OperationType.Replace, + Path = "/progress", + Value = 50 + } +]; +var patchResponse = await dialogportenClient.V1ServiceOwnerDialogsPatchDialog(guid, patchDocument, null); +Console.WriteLine(patchResponse.IsSuccessStatusCode); +Console.WriteLine(patchResponse.StatusCode); +``` + +DialogToken verification + +```C# +var verifier = serviceProvider.GetRequiredService(); +var token = ""; // Dialog token +Console.WriteLine(verifier.Verify(token)); +var dict = DialogTokenVerifier.GetDialogTokenClaims(token); +``` diff --git a/src/Digdir.Library.Dialogporten.WebApiClient/Services/DialogTokenVerifier.cs b/src/Digdir.Library.Dialogporten.WebApiClient/Services/DialogTokenVerifier.cs new file mode 100644 index 000000000..4580444f7 --- /dev/null +++ b/src/Digdir.Library.Dialogporten.WebApiClient/Services/DialogTokenVerifier.cs @@ -0,0 +1,69 @@ +using System.Buffers.Text; +using System.Text; +using System.Text.Json; +using NSec.Cryptography; + +namespace Digdir.Library.Dialogporten.WebApiClient.Services; + +public sealed class DialogTokenVerifier(string kid, PublicKey publicKey) +{ + public bool Verify(string token) + { + var parts = token.Split('.'); + if (parts.Length != 3) return false; + var header = Base64Url.DecodeFromChars(parts[0]); + + var headerJson = JsonSerializer.Deserialize(header); + if (headerJson.TryGetProperty("kid", out var value)) + { + if (value.GetString() != kid) return false; + } + else + { + return false; + } + var signature = Base64Url.DecodeFromChars(parts[2]); + return SignatureAlgorithm.Ed25519.Verify(publicKey, Encoding.UTF8.GetBytes(parts[0] + '.' + parts[1]), signature); + + } + public static Dictionary GetDialogTokenClaims(string token) + { + var claims = new Dictionary(); + + var parts = token.Split('.'); + if (parts.Length != 3) + { + throw new ArgumentException("Invalid dialog token"); + } + + var bodyJson = JsonSerializer.Deserialize(Base64Url.DecodeFromChars(parts[1])); + + // Maps bodyJson -> DialogTokenClaimTypes + var fieldsInfo = typeof(DialogTokenClaimTypes).GetFields().Where(f => f.FieldType == typeof(string)); + foreach (var fieldInfo in fieldsInfo) + { + var value = fieldInfo.GetValue("string"); + if (value != null && bodyJson.TryGetProperty(value.ToString()!, out var jsonValue)) + { + claims.Add(value.ToString()!, jsonValue); + } + } + return claims; + } +} + +public static class DialogTokenClaimTypes +{ + public const string JwtId = "jti"; + public const string Issuer = "iss"; + public const string IssuedAt = "iat"; + public const string NotBefore = "nbf"; + public const string Expires = "exp"; + public const string AuthenticationLevel = "l"; + public const string AuthenticatedParty = "c"; + public const string DialogParty = "p"; + public const string SupplierParty = "u"; + public const string ServiceResource = "s"; + public const string DialogId = "i"; + public const string Actions = "a"; +} diff --git a/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/.refitter b/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/.refitter new file mode 100644 index 000000000..700fb94a8 --- /dev/null +++ b/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/.refitter @@ -0,0 +1,18 @@ +{ + "openApiPath": "../../docs/schema/V1/swagger.verified.json", + "namespace": "Digdir.Library.Dialogporten.WebApiClient.Features.V1", + "outputFolder": "refitter", + "operationNameGenerator": "SingleClientFromOperationId", + "trimUnusedSchema": true, + "multipleInterfaces": "ByTag", + "includeTags": [ + "Serviceowner" + ], + "useCancellationTokens": true, + "returnIApiResponse": true, + "useDynamicQuerystringParameters": true, + "outputFilename": "RefitterInterface.cs", + "codeGeneratorSettings": { + "dateFormat": "yyyy-MM-ddTHH:mm:ssZ" + } +} diff --git a/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests.csproj b/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests.csproj new file mode 100644 index 000000000..2025a8d4c --- /dev/null +++ b/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests.csproj @@ -0,0 +1,47 @@ + + + + net9.0 + enable + enable + false + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/RefitterInterfaceTests.cs b/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/RefitterInterfaceTests.cs new file mode 100644 index 000000000..1505278b9 --- /dev/null +++ b/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/RefitterInterfaceTests.cs @@ -0,0 +1,37 @@ +namespace Digdir.Library.Dialogporten.WebApiClient.Integration.Tests; + +public sealed class RefitterInterfaceTests +{ + + [Fact] + public async Task FailIfRefitterInterfaceDoesNotMatch() + { + var rootPath = GetSolutionRootFolder(); + var webApiClientPath = Path.Combine(rootPath!, "src/Digdir.Library.Dialogporten.WebApiClient/Features/V1"); + var currentDirectory = Path.Combine(rootPath!, "tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests"); + var newRifitterPath = Path.Combine(currentDirectory, "refitter/RefitterInterface.cs"); + var newRefitter = File.ReadAllText(newRifitterPath); + Assert.True(File.Exists(newRifitterPath)); + await Verify(newRefitter, extension: "cs") + .UseFileName("RefitterInterface") + .UseDirectory(webApiClientPath); + + var path = Path.Combine(webApiClientPath, "RefitterInterface.received.cs"); + if (File.Exists(path)) + { + File.Delete(path); + } + Assert.False(File.Exists(path)); + } + private static string? GetSolutionRootFolder() + { + var currentDirectory = Directory.GetCurrentDirectory(); + var solutionFolder = currentDirectory; + while (solutionFolder != null && Directory.GetFiles(solutionFolder, "*.sln").Length == 0) + { + solutionFolder = Directory.GetParent(solutionFolder)?.FullName; + } + return solutionFolder; + } + +} diff --git a/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/Tests.cs b/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/Tests.cs new file mode 100644 index 000000000..445cd0f0e --- /dev/null +++ b/tests/Digdir.Library.Dialogporten.WebApiClient.Integration.Tests/Tests.cs @@ -0,0 +1,554 @@ +using System.Net; +using Digdir.Library.Dialogporten.WebApiClient.Extensions; +using Digdir.Library.Dialogporten.WebApiClient.Features.V1; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +namespace Digdir.Library.Dialogporten.WebApiClient.Integration.Tests; + +public class WebApiClientFixture : IDisposable +{ + public IServiceownerApi DialogportenClient { get; } + public WebApiClientFixture() + { + + var configuration = new ConfigurationBuilder().AddUserSecrets().Build(); + // .AddJsonFile("appsettings.local.json", optional: false, reloadOnChange: true) + var services = new ServiceCollection(); + + services.AddSingleton(configuration); + + services.AddDialogportenClient(); + services.AddDialogTokenVerifer(); + DialogportenClient = services.BuildServiceProvider().GetRequiredService(); + + } + + public void Dispose() + { + GC.SuppressFinalize(this); + } +} + +public class Tests(WebApiClientFixture fixture) : IClassFixture, IDisposable +{ + private readonly List _dialogIds = []; + [Fact] + public async Task Create_Invalid_Dialog_Returns_400() + { + var createDialogCommand = CreateCommand(); + createDialogCommand.Progress = 200; + var createResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsCreateDialog(createDialogCommand); + + Assert.Equal(HttpStatusCode.BadRequest, createResponse.StatusCode); + } + + + [Fact] + public async Task Purge_Dialog_Returns_204() + { + var createDialogCommand = CreateCommand(); + var dialogId = await CreateDialog(createDialogCommand); + var purgeResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsPurgePurgeDialog(dialogId, null); + Assert.Equal(HttpStatusCode.NoContent, purgeResponse.StatusCode); + + var getResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsGetGetDialog(dialogId, null!, CancellationToken.None); + Assert.Equal(HttpStatusCode.NotFound, getResponse.StatusCode); + } + private async Task CreateDialog(V1ServiceOwnerDialogsCommandsCreate_DialogCommand createDialogCommand) + { + + var createResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsCreateDialog(createDialogCommand); + + Assert.Equal(HttpStatusCode.Created, createResponse.StatusCode); + Assert.NotNull(createResponse.Content); + Assert.True(Guid.TryParse(createResponse.Content!.Replace("\"", "").Trim(), out var dialogId)); + return dialogId; + } + + [Fact] + public async Task Patch_Invalid_Dialog_Returns_400() + { + var createDialogCommand = CreateCommand(); + var dialogId = await CreateDialog(createDialogCommand); + _dialogIds.Add(dialogId); + + List patchDocument = + [ + new() + { + Op = "replace", + OperationType = JsonPatchOperations_OperationType.Replace, + Path = "/progress", + Value = 500 + } + ]; + var patchResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsPatchDialog(dialogId, patchDocument, null, CancellationToken.None); + Assert.Equal(HttpStatusCode.BadRequest, patchResponse.StatusCode); + } + [Fact] + public async Task Patch_Dialog_Returns_204() + { + var createDialogCommand = CreateCommand(); + var dialogId = await CreateDialog(createDialogCommand); + _dialogIds.Add(dialogId); + + List patchDocument = + [ + new() + { + Op = "replace", + OperationType = JsonPatchOperations_OperationType.Replace, + Path = "/progress", + Value = 50 + } + ]; + var patchResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsPatchDialog(dialogId, patchDocument, null, CancellationToken.None); + Assert.Equal(HttpStatusCode.NoContent, patchResponse.StatusCode); + + var getResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsGetGetDialog(dialogId, null!, CancellationToken.None); + + Assert.Equal(HttpStatusCode.OK, getResponse.StatusCode); + Assert.Equal(50, getResponse.Content!.Progress); + } + + [Fact] + public async Task Get_Dialog_Returns_200() + { + var createDialogCommand = CreateCommand(); + var dialogId = await CreateDialog(createDialogCommand); + + var getResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsGetGetDialog(dialogId, null!, CancellationToken.None); + + Assert.Equal(HttpStatusCode.OK, getResponse.StatusCode); + _dialogIds.Add(dialogId); + } + [Fact] + public async Task Update_Invalid_Dialog_Returns_400() + { + var createDialogCommand = CreateCommand(); + var dialogId = await CreateDialog(createDialogCommand); + _dialogIds.Add(dialogId); + + var updateDialogCommand = UpdateCommand(); + updateDialogCommand.Progress = 200; + var updateResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsUpdateDialog(dialogId, updateDialogCommand, null!, CancellationToken.None); + Assert.Equal(HttpStatusCode.BadRequest, updateResponse.StatusCode); + } + [Fact] + public async Task Update_Dialog_Returns_204() + { + var createDialogCommand = CreateCommand(); + var dialogId = await CreateDialog(createDialogCommand); + _dialogIds.Add(dialogId); + + var updateDialogCommand = UpdateCommand(); + var updateResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsUpdateDialog(dialogId, updateDialogCommand, null!, CancellationToken.None); + Assert.Equal(HttpStatusCode.NoContent, updateResponse.StatusCode); + + var getResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsGetGetDialog(dialogId, null!); + Assert.Equal(HttpStatusCode.OK, getResponse.StatusCode); + Assert.Equal(updateDialogCommand.Progress, getResponse.Content!.Progress); + } + [Fact] + public async Task Search_Dialog_Returns_200() + { + /* + * Amund Q:. + * [x] Refit støtter date format. + * [x] Refitter trenger at swagger sier "date" på format. + * [x] Swagger sier nå "date-time" + * [x] Refit støtter custom date format + * [x] Refitter søtter ikke custom date format + * [x] Få Swagger gen til å generete "date" istedet for "date-time"? + * [x] lag til date-time støtte i refitter + * [x] Legge til støtte for custom date format i Refitter + * [x] Virker doable, Relativt lett leslig kilde kode. + * [x] Lagde PR med forandringene, blitt Merget inn + * [ ] Venter på preview av refitter blir lansert + */ + + var dateOffset = DateTimeOffset.UtcNow; + var createDialogCommand = CreateCommand(); + var dialogId = await CreateDialog(createDialogCommand); + _dialogIds.Add(dialogId); + var param = new V1ServiceOwnerDialogsSearchSearchDialogQueryParams + { + CreatedAfter = dateOffset + }; + var searchResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsSearchSearchDialog(param, CancellationToken.None); + Assert.Equal(HttpStatusCode.OK, searchResponse.StatusCode); + Assert.NotNull(searchResponse.Content); + Assert.Single(searchResponse.Content!.Items); + + } + + [Fact] + public async Task Search_Multiple_Dialogs() + { + var dateOffset = DateTime.UtcNow; + var dialogsCreated = 5; + for (var i = 0; i < dialogsCreated; i++) + { + var createDialogCommand = CreateCommand(); + var dialogId = await CreateDialog(createDialogCommand); + _dialogIds.Add(dialogId); + } + var param = new V1ServiceOwnerDialogsSearchSearchDialogQueryParams + { + CreatedAfter = dateOffset + }; + var searchResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsSearchSearchDialog(param, CancellationToken.None); + Assert.Equal(HttpStatusCode.OK, searchResponse.StatusCode); + Assert.NotNull(searchResponse.Content); + Assert.Equal(dialogsCreated, searchResponse.Content!.Items.Count); + } + + [Fact] + public async Task Delete_Dialog_Returns_204() + { + var createDialogCommand = CreateCommand(); + var dialogId = await CreateDialog(createDialogCommand); + _dialogIds.Add(dialogId); + + var deleteResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsDeleteDialog(dialogId, null); + Assert.Equal(HttpStatusCode.NoContent, deleteResponse.StatusCode); + + var getResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsGetGetDialog(dialogId, null!); + Assert.Equal(HttpStatusCode.OK, getResponse.StatusCode); + Assert.NotNull(getResponse.Content!.DeletedAt); + + } + + [Fact] + public async Task Create_Dialog_Transmission_returns_201() + { + + var createDialogCommand = CreateCommand(); + createDialogCommand.Transmissions = []; + var dialogId = await CreateDialog(createDialogCommand); + _dialogIds.Add(dialogId); + var createTransmission = new V1ServiceOwnerDialogTransmissionsCreate_TransmissionRequest + { + Attachments = [], + Content = new V1ServiceOwnerDialogsCommandsUpdate_TransmissionContent + { + Summary = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Sammendrag" + } + ] + }, + Title = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Dette er en tittel" + } + ] + } + }, + Sender = new V1ServiceOwnerCommonActors_Actor + { + ActorType = Actors_ActorType.ServiceOwner + }, + Type = DialogsEntitiesTransmissions_DialogTransmissionType.Information + }; + var transmissionResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogTransmissionsCreateDialogTransmission(dialogId, createTransmission, null!); + Assert.Equal(HttpStatusCode.Created, transmissionResponse.StatusCode); + + } + private static V1ServiceOwnerDialogsCommandsUpdate_Dialog UpdateCommand() + { + var createDialogCommand = new V1ServiceOwnerDialogsCommandsUpdate_Dialog + { + Activities = [], + Status = DialogsEntities_DialogStatus.New, + Progress = 60, + Attachments = [], + GuiActions = [], + ApiActions = [], + SearchTags = [], + Content = new V1ServiceOwnerDialogsCommandsUpdate_Content + { + Title = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved" + }, + new V1CommonLocalizations_Localization + { + LanguageCode = "en", + Value = "Main" + } + ], + }, + Summary = new V1CommonContent_ContentValue + { + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved Summary" + }, + new V1CommonLocalizations_Localization + { + LanguageCode = "en", + Value = "Main Summary" + } + ], + MediaType = "text/plain" + } + + + }, + Transmissions = + [ + new V1ServiceOwnerDialogsCommandsUpdate_Transmission + { + Attachments = + [ + new V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachment + { + DisplayName = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved mission" + } + ], + Urls = + [ + new V1ServiceOwnerDialogsCommandsUpdate_TransmissionAttachmentUrl + { + ConsumerType = Attachments_AttachmentUrlConsumerType.Gui, + Url = new Uri("https://digdir.apps.tt02.altinn.no/some-other-url") + } + ] + + } + ], + Content = new V1ServiceOwnerDialogsCommandsUpdate_TransmissionContent + { + Summary = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Transmission summary" + } + ] + }, + Title = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Transmission Title" + } + ] + } + }, + Sender = new V1ServiceOwnerCommonActors_Actor + { + ActorType = Actors_ActorType.ServiceOwner + }, + Type = DialogsEntitiesTransmissions_DialogTransmissionType.Information + } + ], + VisibleFrom = null, + }; + return createDialogCommand; + } + private static V1ServiceOwnerDialogsCommandsCreate_DialogCommand CreateCommand() + { + var now = DateTimeOffset.UtcNow; + var createDialogCommand = new V1ServiceOwnerDialogsCommandsCreate_DialogCommand + { + GuiActions = [], + Activities = + [ + new V1ServiceOwnerDialogsCommandsCreate_Activity + { + CreatedAt = now, + Description = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Dette er en beskrivelse" + } + ], + PerformedBy = new V1ServiceOwnerCommonActors_Actor + { + ActorType = Actors_ActorType.ServiceOwner + }, + Type = DialogsEntitiesActivities_DialogActivityType.Information + } + ], + ApiActions = + [ + new V1ServiceOwnerDialogsCommandsCreate_ApiAction + { + Action = "submit", + Endpoints = + [ + new V1ServiceOwnerDialogsCommandsCreate_ApiActionEndpoint + { + HttpMethod = Http_HttpVerb.POST, + RequestSchema = new Uri("https://digdir.apps.tt02.altinn.no/digdir/super-simple-service/api/jsonschema/mainform-20231015"), + ResponseSchema = new Uri("https://docs.altinn.studio/swagger/altinn-app-v1.json#/components/schemas/DataElement"), + Url = new Uri("https://digdir.apps.tt02.altinn.no/digdir/super-simple-service/#/instance/50756302/58d88b01-8840-8771-a6dd-e51e9809df2c/data?dataType=mainform-20231015"), + Version = "20231015" + } + ] + } + ], + Attachments = [], + // createDialogCommand.Id = Guid.Parse("01927a6d-40d8-728b-b3da-845b680840d9"); + ServiceResource = "urn:altinn:resource:super-simple-service", + Party = "urn:altinn:person:identifier-no:14886498226", + SystemLabel = DialogEndUserContextsEntities_SystemLabel.Default, + Status = DialogsEntities_DialogStatus.New, + Progress = 2, + SearchTags = + [ + new V1ServiceOwnerDialogsCommandsCreate_SearchTag + { + Value = "Search tag" + } + ], + Content = new V1ServiceOwnerDialogsCommandsCreate_Content + { + Title = new V1CommonContent_ContentValue + { + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved" + }, + new V1CommonLocalizations_Localization + { + LanguageCode = "en", + Value = "Main" + } + ], + MediaType = "text/plain" + }, + Summary = new V1CommonContent_ContentValue + { + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved Summary" + }, + new V1CommonLocalizations_Localization + { + LanguageCode = "en", + Value = "Main Summary" + } + ], + MediaType = "text/plain" + } + }, + Transmissions = + [ + new V1ServiceOwnerDialogsCommandsCreate_Transmission + { + Attachments = + [ + new V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachment + { + DisplayName = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Hoved mission" + } + ], + Urls = + [ + new V1ServiceOwnerDialogsCommandsCreate_TransmissionAttachmentUrl + { + ConsumerType = Attachments_AttachmentUrlConsumerType.Gui, + Url = new Uri("https://digdir.apps.tt02.altinn.no/some-other-url") + } + ] + } + ], + Content = new V1ServiceOwnerDialogsCommandsCreate_TransmissionContent + { + Summary = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Transmission summary" + } + ] + }, + Title = new V1CommonContent_ContentValue + { + MediaType = "text/plain", + Value = + [ + new V1CommonLocalizations_Localization + { + LanguageCode = "nb", + Value = "Transmission Title" + } + ] + } + }, + Sender = new V1ServiceOwnerCommonActors_Actor + { + ActorType = Actors_ActorType.ServiceOwner + }, + Type = DialogsEntitiesTransmissions_DialogTransmissionType.Information + } + ], + }; + return createDialogCommand; + } + + public async void Dispose() + { + foreach (var dialogId in _dialogIds) + { + var purgeResponse = await fixture.DialogportenClient.V1ServiceOwnerDialogsPurgePurgeDialog(dialogId, null!); + Assert.True(purgeResponse.IsSuccessStatusCode); + } + GC.SuppressFinalize(this); + } +}